{"id":16112552,"url":"https://github.com/mhmtszr/pipeline","last_synced_at":"2026-04-01T18:36:05.640Z","repository":{"id":143489106,"uuid":"615173334","full_name":"mhmtszr/pipeline","owner":"mhmtszr","description":"Golang pipeline solution with generics.","archived":false,"fork":false,"pushed_at":"2026-03-19T10:58:23.000Z","size":29,"stargazers_count":33,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-20T03:58:57.389Z","etag":null,"topics":["chainofresponsibility","go","golang","pipeline"],"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/mhmtszr.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,"zenodo":null}},"created_at":"2023-03-17T05:30:03.000Z","updated_at":"2026-03-19T10:56:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"04c5714e-e719-427a-a76b-0b25e05a6c62","html_url":"https://github.com/mhmtszr/pipeline","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mhmtszr/pipeline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fpipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fpipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fpipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fpipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhmtszr","download_url":"https://codeload.github.com/mhmtszr/pipeline/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmtszr%2Fpipeline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["chainofresponsibility","go","golang","pipeline"],"created_at":"2024-10-09T20:08:24.808Z","updated_at":"2026-04-01T18:36:05.550Z","avatar_url":"https://github.com/mhmtszr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pipeline [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![Go Report Card][go-report-img]][go-report]\n\n![133256800-8d51f5e5-1cc5-45d2-a195-28e95f1cb92c](https://user-images.githubusercontent.com/35079195/226874057-bc579acd-1f0a-4dc7-85dc-8ec73811e56e.jpeg)\n\n\nGo pipeline solution that can be used in many different combinations for chaining pipeline steps.\n\nInspired by [@bilal-kilic](https://github.com/bilal-kilic)'s Kotlin implementation [boru](https://github.com/Trendyol/boru).\n\n### Usage\nSupports 1.22+ Go versions because of Go Generics\n```\ngo get github.com/mhmtszr/pipeline\n```\n### Examples\n#### Basic Pipeline\n``` go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/mhmtszr/pipeline\"\n)\n\nfunc square(ctx *int, next func(*int) error) error {\n\t*ctx = (*ctx) * (*ctx)\n\tfmt.Printf(\"After first step: %d\\n\", *ctx)\n\treturn next(ctx)\n}\n\nfunc add(ctx *int, next func(*int) error) error {\n\t*ctx = (*ctx) + (*ctx)\n\tfmt.Printf(\"After second step: %d\\n\", *ctx)\n\treturn next(ctx)\n}\n\nfunc main() {\n\tp := pipeline.NewBuilder[*int]().Use(square).Use(add).Build()\n\tnm := 3\n\t_ = p.Execute(\u0026nm)\n}\n// After first step: 9\n// After second step: 18\n```\n\n#### Concurrent Pipeline\n\n``` go\np := pipeline.NewBuilder[*atomic.Uint64]().\n\tUseConcurrent(\n\t\tfunc(ctx *atomic.Uint64) error {\n\t\t\tctx.Add(ctx.Load())\n\t\t\treturn nil\n\t\t},\n\t\tfunc(ctx *atomic.Uint64) error {\n\t\t\tctx.Add(ctx.Load())\n\t\t\treturn nil\n\t\t},\n\t).Build()\n\nvar nmb atomic.Uint64\nnmb.Add(5)\n_ = p.Execute(\u0026nmb)\n```\n\n#### Conditional Pipeline\n\n``` go\np := pipeline.NewBuilder[*int]().\n\tUseConditional(\n\t\tfunc(ctx *int) bool { return *ctx == 3 },\n\t\t[]pipeline.StepFunc[*int]{square},\n\t\t[]pipeline.StepFunc[*int]{add},\n\t).Use(add).Build()\n\nnm := 3\n_ = p.Execute(\u0026nm)\n// nm == 18\n\nnm = 4\n_ = p.Execute(\u0026nm)\n// nm == 16\n```\n[doc-img]: https://godoc.org/github.com/mhmtszr/pipeline?status.svg\n[doc]: https://godoc.org/github.com/mhmtszr/pipeline\n[ci-img]: https://github.com/mhmtszr/pipeline/actions/workflows/build-test.yml/badge.svg\n[ci]: https://github.com/mhmtszr/pipeline/actions/workflows/build-test.yml\n[cov-img]: https://codecov.io/gh/mhmtszr/pipeline/branch/master/graph/badge.svg\n[cov]: https://codecov.io/gh/mhmtszr/pipeline\n[go-report-img]: https://goreportcard.com/badge/github.com/mhmtszr/pipeline\n[go-report]: https://goreportcard.com/report/github.com/mhmtszr/pipeline\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmtszr%2Fpipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhmtszr%2Fpipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmtszr%2Fpipeline/lists"}