{"id":43763938,"url":"https://github.com/dylanplecki/contextlock","last_synced_at":"2026-02-05T15:35:03.558Z","repository":{"id":47627249,"uuid":"398027914","full_name":"dylanplecki/contextlock","owner":"dylanplecki","description":"A Golang context-compatible sync.Locker implementation.","archived":false,"fork":false,"pushed_at":"2021-08-20T23:21:11.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T09:48:39.172Z","etag":null,"topics":["distributed-lock","go","golang"],"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/dylanplecki.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-08-19T17:45:07.000Z","updated_at":"2024-06-21T09:48:39.173Z","dependencies_parsed_at":"2022-07-22T12:32:27.117Z","dependency_job_id":null,"html_url":"https://github.com/dylanplecki/contextlock","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dylanplecki/contextlock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanplecki%2Fcontextlock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanplecki%2Fcontextlock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanplecki%2Fcontextlock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanplecki%2Fcontextlock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dylanplecki","download_url":"https://codeload.github.com/dylanplecki/contextlock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanplecki%2Fcontextlock/sbom","scorecard":{"id":362243,"data":{"date":"2025-08-11","repo":{"name":"github.com/dylanplecki/contextlock","commit":"7e9af4516e09a88d11681a45a9447b6c6557c2cc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yaml:1","Warn: no topLevel permission defined: .github/workflows/test.yaml: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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/dylanplecki/contextlock/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/dylanplecki/contextlock/test.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/dylanplecki/contextlock/test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/dylanplecki/contextlock/test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/dylanplecki/contextlock/test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/dylanplecki/contextlock/test.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yaml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/dylanplecki/contextlock/test.yaml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction 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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 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"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2025-3488 / GHSA-6v2p-p543-phr9"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T11:06:39.372Z","repository_id":47627249,"created_at":"2025-08-18T11:06:39.372Z","updated_at":"2025-08-18T11:06:39.372Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29124802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"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":["distributed-lock","go","golang"],"created_at":"2026-02-05T15:35:03.496Z","updated_at":"2026-02-05T15:35:03.550Z","avatar_url":"https://github.com/dylanplecki.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Golang Context Lock\r\n===================\r\n\r\n[![Go Reference](https://pkg.go.dev/badge/github.com/dylanplecki/contextlock.svg)](https://pkg.go.dev/github.com/dylanplecki/contextlock)\r\n![CI Status](https://github.com/dylanplecki/contextlock/actions/workflows/test.yaml/badge.svg?branch=master)\r\n[![codecov](https://codecov.io/gh/dylanplecki/contextlock/branch/master/graph/badge.svg?token=R66LXRJKJ9)](https://codecov.io/gh/dylanplecki/contextlock)\r\n\r\n```golang\r\n// ContextLocker extends the sync.Locker interface to support two new\r\n// lock/unlock methods, LockContext and UnlockContext. These methods perform\r\n// similar operations (and are directly compatible with) the original Lock and\r\n// Unlock methods, but accept an additional context.Context argument used to\r\n// terminate lock acquisition attempts prematurely.\r\n//\r\n// If the lock is not successfully acquired or released via a context-compatible\r\n// method, an error will be returned describing why.\r\n//\r\n// This lock interface can be used to front remote or distributed locks while\r\n// using a similar interface to the local sync.Mutex-style locks. Because of\r\n// this, care should be taken when selecting implementations for and adding\r\n// ContextLocker acquisitions/releases to performance-critical code.\r\n//\r\n// The sync.Locker interface is fully compatible with the new context-compatible\r\n// ContextLocker methods. Thus, it is acceptable for a caller to call Lock then\r\n// UnlockContext, or call LockContext then Unlock.\r\ntype ContextLocker interface {\r\n\tsync.Locker\r\n\r\n\t// LockContext provides exclusive control of the ContextLocker object if and\r\n\t// only if the error returned is nil. A subsequent call to Unlock or\r\n\t// UnlockContext from any goroutine will release control of the\r\n\t// ContextLocker object.\r\n\tLockContext(ctx context.Context) error\r\n\r\n\t// UnlockContext releases control of the ContextLocker object. If the\r\n\t// ContextLocker has not been locked prior to this call via either Lock o\r\n\t// LockContext, the behavior of this method is undefined, but may likely\r\n\t// panic.\r\n\tUnlockContext(ctx context.Context) error\r\n}\r\n```\r\n\r\n## Local Locks\r\n\r\nThe \"local\" `ContextLock` types are acquired and released using state local to the executing computer.\r\n\r\nThese local locks may be slower than a typical mutex, but are typically faster than the distributed locks below.\r\n\r\n**Available Local Locks:**\r\n\r\n- [`ChanLock`](https://pkg.go.dev/github.com/dylanplecki/contextlock/locks/local/chanlock#ChanLock) - A process-local, context-aware lock using Golang channels.\r\n\r\n## Distributed Locks\r\n\r\nThe \"distributed\" `ContextLock` types are acquired and released using state present outside the local computer, and may\r\nbe located across a network of other computers.\r\n\r\nThese distributed locks can come in several localities and may have configurable scopes, meaning that locks can be\r\nacquired and released across specific subsets of computers with varying performance implications.\r\n\r\nTypically, distributed locks tend to be far slower than local locks due to network latency.\r\n\r\n**Available Distributed Locks:**\r\n\r\n- [`GCSLock`](https://pkg.go.dev/github.com/dylanplecki/contextlock/locks/distributed/gcslock#GCSLock) - A globally-distributed, fault-tolerant lock using Google Cloud Storage.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanplecki%2Fcontextlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylanplecki%2Fcontextlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanplecki%2Fcontextlock/lists"}