{"id":43261986,"url":"https://github.com/hyperboloide/pipe","last_synced_at":"2026-02-01T14:08:04.557Z","repository":{"id":31103161,"uuid":"34662443","full_name":"hyperboloide/pipe","owner":"hyperboloide","description":"A simple Go stream processing library that works like Unix pipes","archived":false,"fork":false,"pushed_at":"2017-10-29T01:21:10.000Z","size":2805,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T19:47:54.827Z","etag":null,"topics":["go","pipe","stream"],"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/hyperboloide.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":"2015-04-27T11:22:37.000Z","updated_at":"2022-03-03T14:55:29.000Z","dependencies_parsed_at":"2022-09-08T20:52:23.134Z","dependency_job_id":null,"html_url":"https://github.com/hyperboloide/pipe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hyperboloide/pipe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperboloide%2Fpipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperboloide%2Fpipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperboloide%2Fpipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperboloide%2Fpipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperboloide","download_url":"https://codeload.github.com/hyperboloide/pipe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperboloide%2Fpipe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28980198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T13:38:33.235Z","status":"ssl_error","status_checked_at":"2026-02-01T13:38:32.912Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["go","pipe","stream"],"created_at":"2026-02-01T14:08:03.895Z","updated_at":"2026-02-01T14:08:04.543Z","avatar_url":"https://github.com/hyperboloide.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pipe\n\n[![Build Status](https://travis-ci.org/hyperboloide/pipe.svg)](https://travis-ci.org/hyperboloide/pipe)\n[![GoDoc](https://godoc.org/github.com/hyperboloide/pipe?status.svg)](https://godoc.org/github.com/hyperboloide/pipe)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hyperboloide/pipe)](https://goreportcard.com/report/github.com/hyperboloide/pipe)\n\nA simple stream processing library that works like Unix pipes.\nThis library is fully asynchronous.\nCreate a Pipe from a Reader, add some transformation functions and get the result writed to a Writer.\n\nTo install :\n```sh\n$ go get github.com/hyperboloide/pipe\n```\n\nThen add the following import :\n```go\nimport \"github.com/hyperboloide/pipe\"\n```\n\n\n### Example\n\nBellow is a very basic example that:\n\n1. Open a file\n2. Compress it\n3. Save it\n\n```go\npackage main\n\nimport (\n    \"compress/gzip\"\n    \"github.com/hyperboloide/pipe\"\n    \"io\"\n    \"log\"\n    \"os\"\n)\n\nfunc zip(r io.Reader, w io.Writer) error {\n    gzw, err := gzip.NewWriterLevel(w, gzip.BestSpeed)\n    if err != nil {\n        return err\n    }\n    defer gzw.Close()\n    _, err = io.Copy(gzw, r)\n    return err\n}\n\nfunc main() {\n\n    // pipe input\n    in, err := os.Open(\"test.txt\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer in.Close()\n\n    // pipe output\n    out, err := os.Create(\"test.txt.tgz\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer out.Close()\n\n    // create a new pipe with a io.Reader\n    // Push a transformation function\n    // Set output\n    // Exec and get errors if any\n    if err := pipe.New(in).Push(zip).To(out).Exec(); err != nil {\n        log.Fatal(err)\n    }\n}\n```\n\n### Readers and Writers\n\nPipe also provides a set of Reader/Writer to read from and write to.\n\n* [S3](https://github.com/hyperboloide/pipe/blob/master/rw/s3.go)\n* [Google Cloud Storage](https://github.com/hyperboloide/pipe/blob/master/rw/google_cloud.go)\n* [File](https://github.com/hyperboloide/pipe/blob/master/rw/file.go)\n\nHere is an example:\n\n```go\nimport (\n\t\"github.com/hyperboloide/pipe\"\n\t\"github.com/hyperboloide/pipe/rw\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc DemoRW() {\n\n\tin, err := os.Open(\"test.txt\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer in.Close()\n\n\tfile := \u0026rw.File{AllowSub: true}\n\n\t// Always start before use. Note that an RW after Start can be reused.\n\tif err := file.Start(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Obtain a writer\n\tw, err := file.NewWriter(\"copy.txt\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// ToCloser() closes the connection at the end of the write.\n\tif err := pipe.New(binReader).ToCloser(w).Exec(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nIt's also easy to create your own, just implement the [ReadWriteDeleter](https://github.com/hyperboloide/pipe/blob/master/rw/rw.go) interface.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperboloide%2Fpipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperboloide%2Fpipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperboloide%2Fpipe/lists"}