{"id":34627959,"url":"https://github.com/jobala/middleware_pipeline","last_synced_at":"2026-05-26T08:01:41.435Z","repository":{"id":57561502,"uuid":"328374432","full_name":"jobala/middleware_pipeline","owner":"jobala","description":"Middleware Pipeline for the Go HTTP Client","archived":false,"fork":false,"pushed_at":"2021-01-23T08:09:44.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-07-28T12:56:59.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jobala.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}},"created_at":"2021-01-10T12:10:15.000Z","updated_at":"2023-02-11T06:01:40.000Z","dependencies_parsed_at":"2022-09-10T06:14:26.994Z","dependency_job_id":null,"html_url":"https://github.com/jobala/middleware_pipeline","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"purl":"pkg:github/jobala/middleware_pipeline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fmiddleware_pipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fmiddleware_pipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fmiddleware_pipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fmiddleware_pipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jobala","download_url":"https://codeload.github.com/jobala/middleware_pipeline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fmiddleware_pipeline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28004519,"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-24T02:00:07.193Z","response_time":83,"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":[],"created_at":"2025-12-24T16:13:16.485Z","updated_at":"2025-12-24T16:13:17.143Z","avatar_url":"https://github.com/jobala.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Middleware Pipeline\n\nMiddleware Pipeline for the Go HTTP Client.\n\n## Getting Started\n\nCreate a middleware\n\n```go\ntype AuthorizationMiddleware struct{}\n\nfunc (s AuthorizationMiddleware) Intercept(pipeline pipeline.Pipeline, req *http.Request) (*http.Response, error) {\n\treq.Header.Add(\"Authorization\", \"Bearer token\")\n\n\tbody, _ := httputil.DumpRequest(req, true)\n\tlog.Println(fmt.Sprintf(\"%s\", string(body)))\n\n\t/*\n\tIf you want to perform an action based on the response, do the following\n\t\n\tresp, err = pipeline.Next\n\t// perform some action\n\n\treturn resp, err\n\t*/\n\treturn pipeline.Next(req)\n}\n```\n\nCreate a transport object\n\n```go\n// NewCustomTransport can take multiple middlewares\ntransport := pipeline.NewCustomTransport(\u0026AuthorizationMiddleware{})\n\ntransport.MaxIdleConns = 10\ntransport.IdleConnTimeout = 30 * time.Second\n```\n\nHook up transport with HTTP client\n\n```go\nclient := \u0026http.Client{Transport: transport}\nresp, err := client.Get(\"https://example.com\")\n\nif err == nil {\n  fmt.Println(resp.Status)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjobala%2Fmiddleware_pipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjobala%2Fmiddleware_pipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjobala%2Fmiddleware_pipeline/lists"}