{"id":37126327,"url":"https://github.com/vvanglro/gredlock","last_synced_at":"2026-01-14T14:36:00.023Z","repository":{"id":38108267,"uuid":"496517741","full_name":"vvanglro/gredlock","owner":"vvanglro","description":"🔒 The golang implemetation of Redis distributed locks","archived":false,"fork":false,"pushed_at":"2022-11-07T09:44:46.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-23T01:31:03.731Z","etag":null,"topics":["go","go-redis-lock","redis-go","redislock","redlock"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vvanglro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-26T07:08:17.000Z","updated_at":"2023-05-29T02:44:04.000Z","dependencies_parsed_at":"2022-09-03T23:03:34.802Z","dependency_job_id":null,"html_url":"https://github.com/vvanglro/gredlock","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vvanglro/gredlock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvanglro%2Fgredlock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvanglro%2Fgredlock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvanglro%2Fgredlock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvanglro%2Fgredlock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vvanglro","download_url":"https://codeload.github.com/vvanglro/gredlock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvanglro%2Fgredlock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28423787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"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","go-redis-lock","redis-go","redislock","redlock"],"created_at":"2026-01-14T14:35:59.464Z","updated_at":"2026-01-14T14:36:00.013Z","avatar_url":"https://github.com/vvanglro.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## gredlock\n\nThe golang redlock algorithm implementation.\n\n## Installation\n\n```shell\ngo get -u github.com/vvanglro/gredlock@v0.1.3\n```\n\n## Quickstart\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\tred \"github.com/go-redis/redis/v8\"\n\t\"github.com/vvanglro/gredlock/redlock\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\toptions := []*red.Options{\n\t\t{\n\t\t\tNetwork: \"tcp\",\n\t\t\tAddr:    \"localhost:56379\",\n\t\t},\n\t\t{\n\t\t\tNetwork: \"tcp\",\n\t\t\tAddr:    \"localhost:56378\",\n\t\t},\n\t}\n\n\tlocker := redlock.NewRedisLock(ctx, options...)\n\tlock, err := locker.SetLock(ctx, \"my-key\", \"123\", 50)\n\tfmt.Println(lock)\n\tfmt.Println(err)\n\tttl, err := locker.GetLockTtl(ctx, \"my-key\", \"123\")\n\tfmt.Println(ttl)\n\tfmt.Println(err)\n\tisLock := locker.IsLocked(ctx, \"my-key\")\n\tfmt.Println(isLock)\n\tunlock, err := locker.UnSetLock(ctx, \"my-key\", \"123\")\n\tfmt.Println(unlock)\n\tfmt.Println(err)\n}\n```\n\n## Developing\n\n### Running Tests\n\n```bash\n# Start the Redis Containers\ndocker-compose up -d\n\n# Run Tests\ngo test ./...\n\n# Stop the Containers\ndocker-compose down\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvanglro%2Fgredlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvvanglro%2Fgredlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvanglro%2Fgredlock/lists"}