{"id":30883437,"url":"https://github.com/globocom/go-buffer","last_synced_at":"2025-09-08T09:45:53.035Z","repository":{"id":45186869,"uuid":"249481283","full_name":"globocom/go-buffer","owner":"globocom","description":"Asynchronous data buffer for Go applications","archived":false,"fork":false,"pushed_at":"2023-10-21T02:54:47.000Z","size":320,"stargazers_count":22,"open_issues_count":2,"forks_count":6,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-06-20T06:44:44.206Z","etag":null,"topics":["async","buffer","go"],"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/globocom.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":"2020-03-23T16:15:51.000Z","updated_at":"2024-01-17T13:26:13.000Z","dependencies_parsed_at":"2024-06-19T05:31:57.413Z","dependency_job_id":"ba0e4bd1-4464-486e-ad09-62831720fe6b","html_url":"https://github.com/globocom/go-buffer","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/globocom/go-buffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-buffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-buffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-buffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-buffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globocom","download_url":"https://codeload.github.com/globocom/go-buffer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-buffer/sbom","scorecard":{"id":430056,"data":{"date":"2025-08-11","repo":{"name":"github.com/globocom/go-buffer","commit":"9df20154bb050636434ad506ce52aa7088e5593a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":2,"reason":"Found 7/24 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/globocom/go-buffer/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/globocom/go-buffer/go.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T03:07:34.858Z","repository_id":45186869,"created_at":"2025-08-19T03:07:34.858Z","updated_at":"2025-08-19T03:07:34.858Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274166947,"owners_count":25233959,"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-09-08T02:00:09.813Z","response_time":121,"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":["async","buffer","go"],"created_at":"2025-09-08T09:45:47.877Z","updated_at":"2025-09-08T09:45:53.017Z","avatar_url":"https://github.com/globocom.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"gopher.png\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/workflow/status/globocom/go-buffer/Go?style=flat-square\"\u003e\n  \u003ca href=\"https://github.com/globocom/go-buffer/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/globocom/go-buffer?color=blue\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/github/go-mod/go-version/globocom/go-buffer?style=flat-square\"\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/globocom/go-buffer\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Go-reference-blue?style=flat-square\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# go-buffer\n\n`go-buffer` represents a buffer that asynchronously flushes its contents. It is useful for applications that need to aggregate data before writing it to an external storage. A buffer is flushed manually, or automatically when it becomes full or after an interval has elapsed, whichever comes first.\n\n## Installation\n\n    go get github.com/globocom/go-buffer\n\n## Examples\n\n### Size-triggered flush\n\n```golang\npackage main\n\nimport (\n  \"time\"\n\n  \"github.com/globocom/go-buffer/v2\"\n)\n\nfunc main() {\n  buff := buffer.New(\n    // buffer can hold up to 5 items\n    buffer.WithSize(5),\n    // call this function when the buffer needs flushing\n    buffer.WithFlusher(buffer.FlusherFunc(func(items []interface{}) {\n      for _, item := range items {\n        println(item.(string))\n      }\n    })),\n  )\n  // ensure the buffer\n  defer buff.Close()\n\n  buff.Push(\"item 1\")\n  buff.Push(\"item 2\")\n  buff.Push(\"item 3\")\n  buff.Push(\"item 4\")\n  buff.Push(\"item 5\")\n\n  // block the current goroutine\n  time.Sleep(3 * time.Second)\n\n  println(\"done\")\n}\n```\n\n### Interval-triggered flush\n\n```golang\npackage main\n\nimport (\n  \"time\"\n\n  \"github.com/globocom/go-buffer/v2\"\n)\n\nfunc main() {\n  buff := buffer.New(\n    // buffer can hold up to 5 items\n    buffer.WithSize(5),\n    // buffer will be flushed every second, regardless of\n    // how many items were pushed\n    buffer.WithFlushInterval(time.Second),\n    // call this function when the buffer needs flushing\n    buffer.WithFlusher(buffer.FlusherFunc(func(items []interface{}) {\n      for _, item := range items {\n        println(item.(string))\n      }\n    })),\n  )\n  defer buff.Close()\n\n  buff.Push(\"item 1\")\n  buff.Push(\"item 2\")\n  buff.Push(\"item 3\")\n\n  // block the current goroutine\n  time.Sleep(3 * time.Second)\n\n  println(\"done\")\n}\n```\n\n### Manual flush\n\n```golang\npackage main\n\nimport (\n  \"time\"\n\n  \"github.com/globocom/go-buffer/v2\"\n)\n\nfunc main() {\n  buff := buffer.New(\n    // buffer can hold up to 5 items\n    buffer.WithSize(5),\n    // call this function when the buffer needs flushing\n    buffer.WithFlusher(buffer.FlusherFunc(func(items []interface{}) {\n      for _, item := range items {\n        println(item.(string))\n      }\n    })),\n  )\n  defer buff.Close()\n\n  buff.Push(\"item 1\")\n  buff.Push(\"item 2\")\n  buff.Push(\"item 3\")\n\n  // block the current goroutine\n  time.Sleep(3*time.Second)\n\n  buff.Flush()\n  println(\"done\")\n}\n```\n\n## Documentation\n\nVisit [Pkg.go.dev](https://pkg.go.dev/github.com/globocom/go-buffer) for full documentation.\n\n## License\n\n[MIT License](https://github.com/globocom/go-buffer/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Fgo-buffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobocom%2Fgo-buffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Fgo-buffer/lists"}