{"id":24033747,"url":"https://github.com/daanv2/go-locks","last_synced_at":"2026-06-20T17:32:10.756Z","repository":{"id":225636040,"uuid":"766452582","full_name":"DaanV2/go-locks","owner":"DaanV2","description":"A simple library that provides pools of locks for Go. It is useful when you need to lock on a resource that cannot carry its lock. Such as files, network connections, etc.","archived":false,"fork":false,"pushed_at":"2026-02-14T00:04:05.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-14T06:28:59.365Z","etag":null,"topics":["go","golang","locks","mutex","pool"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/daanv2/go-locks","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/DaanV2.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-03T10:03:58.000Z","updated_at":"2026-02-14T00:03:38.000Z","dependencies_parsed_at":"2025-12-16T05:05:44.975Z","dependency_job_id":null,"html_url":"https://github.com/DaanV2/go-locks","commit_stats":null,"previous_names":["daanv2/go-locks"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/DaanV2/go-locks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fgo-locks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fgo-locks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fgo-locks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fgo-locks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DaanV2","download_url":"https://codeload.github.com/DaanV2/go-locks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaanV2%2Fgo-locks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34580039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"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":["go","golang","locks","mutex","pool"],"created_at":"2025-01-08T18:54:33.120Z","updated_at":"2026-06-20T17:32:10.733Z","avatar_url":"https://github.com/DaanV2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Locks\n\n[![CI](https://github.com/DaanV2/go-locks/actions/workflows/pipeline.yaml/badge.svg)](https://github.com/DaanV2/go-locks/actions/workflows/pipeline.yaml)\n\nA simple library that provides pools of locks for Go. It is useful when you need to lock on a resource that cannot carry its lock.\nSuch as files, network connections, etc.\n\n## Install\n\n```bash\ngo get github.com/daanv2/go-locks\n```\n\n## Usage\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/daanv2/go-locks\"\n)\n\nfunc main() {\n    pool := locks.NewPool(100)\n\n    lock := pool.GetLock(uint64)\n    lock.Lock()\n    defer lock.Unlock()\n\n    // Do something with the resource\n\n    // For files:\n    key := locks.KeyForString(\"file.txt\")\n    lock := pool.GetLock(key)\n    lock.Lock()\n    defer lock.Unlock()\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaanv2%2Fgo-locks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaanv2%2Fgo-locks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaanv2%2Fgo-locks/lists"}