{"id":20045303,"url":"https://github.com/sergeyfrolov/bsbuffer","last_synced_at":"2025-09-03T13:38:06.113Z","repository":{"id":57486533,"uuid":"90970545","full_name":"sergeyfrolov/bsbuffer","owner":"sergeyfrolov","description":"BSBuffer: B - Blocking - Read() calls are blocking. S - Safe - Supports arbitrary amount of readers and writers. Could be unblocked and turned into SBuffer. \"Smart data structures and dumb code works a lot better than the other way around.\"(c)","archived":false,"fork":false,"pushed_at":"2018-09-03T21:39:50.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-13T21:40:39.159Z","etag":null,"topics":["blocking","buffer","concurrent-buffer","goroutine-safe","safe"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergeyfrolov.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":"2017-05-11T11:12:11.000Z","updated_at":"2022-12-19T16:08:58.000Z","dependencies_parsed_at":"2022-09-01T22:31:54.252Z","dependency_job_id":null,"html_url":"https://github.com/sergeyfrolov/bsbuffer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sergeyfrolov/bsbuffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeyfrolov%2Fbsbuffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeyfrolov%2Fbsbuffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeyfrolov%2Fbsbuffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeyfrolov%2Fbsbuffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergeyfrolov","download_url":"https://codeload.github.com/sergeyfrolov/bsbuffer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeyfrolov%2Fbsbuffer/sbom","scorecard":{"id":812236,"data":{"date":"2025-08-11","repo":{"name":"github.com/sergeyfrolov/bsbuffer","commit":"94e85abb850729a5f54f383e8175e62931d04748"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"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":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: 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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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"}}]},"last_synced_at":"2025-08-23T13:27:28.615Z","repository_id":57486533,"created_at":"2025-08-23T13:27:28.615Z","updated_at":"2025-08-23T13:27:28.615Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273453231,"owners_count":25108470,"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-03T02:00:09.631Z","response_time":76,"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":["blocking","buffer","concurrent-buffer","goroutine-safe","safe"],"created_at":"2024-11-13T11:06:23.692Z","updated_at":"2025-09-03T13:38:06.062Z","avatar_url":"https://github.com/sergeyfrolov.png","language":"Go","readme":"# bsbuffer\n`import \"github.com/SergeyFrolov/bsbuffer\"`\n\n* [Overview](#pkg-overview)\n* [Imported Packages](#pkg-imports)\n* [Index](#pkg-index)\n\n## \u003ca name=\"pkg-overview\"\u003eOverview\u003c/a\u003e\n\n## \u003ca name=\"pkg-imports\"\u003eImported Packages\u003c/a\u003e\n\nNo packages beyond the Go standard library are imported.\n\n## \u003ca name=\"pkg-index\"\u003eIndex\u003c/a\u003e\n* [type BSBuffer](#BSBuffer)\n  * [func NewBSBuffer() \\*BSBuffer](#NewBSBuffer)\n  * [func (b \\*BSBuffer) Read(p []byte) (n int, err error)](#BSBuffer.Read)\n  * [func (b \\*BSBuffer) Unblock()](#BSBuffer.Unblock)\n  * [func (b \\*BSBuffer) Write(p []byte) (n int, err error)](#BSBuffer.Write)\n\n#### \u003ca name=\"pkg-files\"\u003ePackage files\u003c/a\u003e\n[bsbuffer.go](./bsbuffer.go) \n\n## \u003ca name=\"BSBuffer\"\u003etype\u003c/a\u003e [BSBuffer](./bsbuffer.go#L17-L29)\n``` go\ntype BSBuffer struct {\n    sync.Mutex\n    // contains filtered or unexported fields\n}\n```\nBSBuffer:\nB - Blocking - Read() calls are blocking.\nS - Safe - Supports arbitrary amount of readers and writers.\nCould be unblocked and turned into SBuffer.\n\n### \u003ca name=\"NewBSBuffer\"\u003efunc\u003c/a\u003e [NewBSBuffer](./bsbuffer.go#L32)\n``` go\nfunc NewBSBuffer() *BSBuffer\n```\nCreates new BSBuffer\n\n### \u003ca name=\"BSBuffer.Read\"\u003efunc\u003c/a\u003e (\\*BSBuffer) [Read](./bsbuffer.go#L63)\n``` go\nfunc (b *BSBuffer) Read(p []byte) (n int, err error)\n```\nReads data from the BSBuffer, blocking until a writer arrives or the BSBuffer is unblocked.\nIf the write end is closed with an error, that error is returned as err; otherwise err is EOF.\nSupports multiple concurrent goroutines and p is valid forever.\n\n### \u003ca name=\"BSBuffer.Unblock\"\u003efunc\u003c/a\u003e (\\*BSBuffer) [Unblock](./bsbuffer.go#L108)\n``` go\nfunc (b *BSBuffer) Unblock()\n```\nTurns BSBuffer into SBuffer: Read() is no longer blocking, but still safe.\nUnblock() is safe to call multiple times.\n\n### \u003ca name=\"BSBuffer.Write\"\u003efunc\u003c/a\u003e (\\*BSBuffer) [Write](./bsbuffer.go#L85)\n``` go\nfunc (b *BSBuffer) Write(p []byte) (n int, err error)\n```\nNon-blocking write appends the contents of p to the buffer, growing the buffer as needed.\nThe return value n is the length of p; err is always nil.\nIf the buffer becomes too large, Write will panic with ErrTooLarge.\nSupports multiple concurrent goroutines and p is safe for reuse right away.\n\n- - -\nGenerated by [godoc2ghmd](https://github.com/GandalfUK/godoc2ghmd)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergeyfrolov%2Fbsbuffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergeyfrolov%2Fbsbuffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergeyfrolov%2Fbsbuffer/lists"}