{"id":34956777,"url":"https://github.com/iamatypeofwalrus/batch","last_synced_at":"2025-12-26T22:17:38.177Z","repository":{"id":92631630,"uuid":"134505490","full_name":"iamatypeofwalrus/batch","owner":"iamatypeofwalrus","description":"Multipart/Batch http handler for Go","archived":false,"fork":false,"pushed_at":"2019-11-10T01:22:55.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-06-20T03:48:34.530Z","etag":null,"topics":["batching","go","golang","multipart"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamatypeofwalrus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-23T03:03:50.000Z","updated_at":"2022-11-02T05:01:32.000Z","dependencies_parsed_at":"2023-04-28T11:25:48.003Z","dependency_job_id":null,"html_url":"https://github.com/iamatypeofwalrus/batch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iamatypeofwalrus/batch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fbatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fbatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fbatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fbatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamatypeofwalrus","download_url":"https://codeload.github.com/iamatypeofwalrus/batch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fbatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28062474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-26T02:00:06.189Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batching","go","golang","multipart"],"created_at":"2025-12-26T22:17:36.093Z","updated_at":"2025-12-26T22:17:38.171Z","avatar_url":"https://github.com/iamatypeofwalrus.png","language":"Go","readme":"[![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoicWxUemVobEZQZW56S1hQckxFOE1UaGtUeGk4cjZoNWt4V05EbmZ6SkkvS1NzSG9zbStsampjZy9PYngzenlBN1lvb2ZhUWlzbE5jNW5EcThsbjdaWHJzPSIsIml2UGFyYW1ldGVyU3BlYyI6IlVDL0pqNlYzZUsvUFJGT0wiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=master)](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoicWxUemVobEZQZW56S1hQckxFOE1UaGtUeGk4cjZoNWt4V05EbmZ6SkkvS1NzSG9zbStsampjZy9PYngzenlBN1lvb2ZhUWlzbE5jNW5EcThsbjdaWHJzPSIsIml2UGFyYW1ldGVyU3BlYyI6IlVDL0pqNlYzZUsvUFJGT0wiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=master)\n[![GoDoc](https://godoc.org/github.com/iamatypeofwalrus/batch?status.svg)](https://godoc.org/github.com/iamatypeofwalrus/batch)\n[![Go Report Card](https://goreportcard.com/badge/github.com/iamatypeofwalrus/batch)](https://goreportcard.com/report/github.com/iamatypeofwalrus/batch)\n# Batch\n\nBatch is a simple Go library for handling multipart batch requests. It adheres to the [HTTP Multipart Batched Request Format draft spec](https://tools.ietf.org/id/draft-snell-http-batch-00.html).\n\n## Note\nThe draft spec is not well specified when it comes to whether or not upstream requests use `http` or `https`. The `http.Client` expects either when it makes a request.\n\nBy default all requests made by Batch use `http`. However, individual requests can set the `x-use-https` header in the Multipart/Batch message to use `https`.\n\nHere's a complete example of a Batch request where the batch message uses the `x-use-https` header.\n\n```\nPOST / HTTP/1.1\nHost: example.org\nContent-Type: multipart/batch; type=\"application/http;version=1.1\" boundary=batch\nMime-Version: 1.0\n\n--batch\nContent-Type: application/http;version=1.1\nContent-Transfer-Encoding: binary\nContent-ID: \u003cdf536860-34f9-11de-b418-0800200c9a66@example.org\u003e\nx-use-https: true\n\nPOST /example/application HTTP/1.1\nHost: example.org\nContent-Type: text/plain\nContent-Length: 3\n\nFoo\n--batch--\n```\n\n## Examples\n\n### Simple\nBatch adheres to the `http.Handler` interface and it can be provided directly to `http.ListenAndServe`.\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/iamatypeofwalrus/batch\"\n)\n\nfunc main() {\n\tb := batch.New()\n\thttp.ListenAndServe(\":8080\", b)\n}\n```\n\n### Custom\nYou can customize the HTTP Client that Batch uses to perform a single request by providing it with any struct that adheres to the `batch.HTTPClient` interface. The `http.Client` adheres to this interface.\n\nYou can provide Batch with a `batch.Logger` in order to capture any error messages that occur when processing requests. `log.Logger` adheres to this interface.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/iamatypeofwalrus/batch\"\n)\n\nfunc main() {\n\tl := log.New(os.Stdout, \"\", log.LstdFlags)\n\tb := \u0026batch.Batch{\n\t\tLog:    l,\n\t\tClient: http.DefaultClient,\n\t}\n\n\thttp.HandleFunc(\"/batch\", b.ServeHTTP)\n\n\tlog.Println(\"listening on :8080\")\n\thttp.ListenAndServe(\":8080\", nil)\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamatypeofwalrus%2Fbatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamatypeofwalrus%2Fbatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamatypeofwalrus%2Fbatch/lists"}