{"id":18917781,"url":"https://github.com/tus/tusd-etcd3-locker","last_synced_at":"2025-04-15T09:32:09.456Z","repository":{"id":68300958,"uuid":"208114487","full_name":"tus/tusd-etcd3-locker","owner":"tus","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-18T11:57:50.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T19:39:08.175Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tus.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-12T18:06:17.000Z","updated_at":"2024-11-28T16:32:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"948c03c9-922d-43c6-9672-5e930c9dd46a","html_url":"https://github.com/tus/tusd-etcd3-locker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tus%2Ftusd-etcd3-locker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tus%2Ftusd-etcd3-locker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tus%2Ftusd-etcd3-locker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tus%2Ftusd-etcd3-locker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tus","download_url":"https://codeload.github.com/tus/tusd-etcd3-locker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249042986,"owners_count":21203391,"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","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":[],"created_at":"2024-11-08T10:28:07.416Z","updated_at":"2025-04-15T09:32:09.430Z","avatar_url":"https://github.com/tus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tusd-etcd3-locker\n\nThis repository contains an etcd3-backed locker for tusd for handling concurrent uploads.\n\nTo initialize a locker, a pre-existing connected etcd3 client must be present.\n\n```\n  client, err := clientv3.New(clientv3.Config{\n      Endpoints:   []string{harness.Endpoint},\n      DialTimeout: 5 * time.Second,\n  })\n```\n\nImport the package:\n\n```\nimport \"github.com/tusd/tusd-etcd3-locker/pkg/etcd3locker\"\n```\n\nFor the most basic locker (e.g. non-shared etcd3 cluster / use default TTLs), a locker can be instantiated like the following:\n\n```\n  locker, err := etcd3locker.New(client)\n  if err != nil {\n      return nil, fmt.Errorf(\"Failed to create etcd locker: %v\", err.Error())\n  }\n```\n\nThe locker will need to be included in composer that is used by tusd:\n\n```\n  composer := handler.NewStoreComposer()\n  locker.UseIn(composer)\n```\n\nFor a shared etcd3 cluster, you may want to modify the prefix that etcd3locker uses to ensure proper namespacing:\n\n```\n  locker, err := etcd3locker.NewWithPrefix(client, \"my-prefix\")\n  if err != nil {\n      return nil, fmt.Errorf(\"Failed to create etcd locker: %v\", err.Error())\n  }\n```\n\nFor full control over all options, an etcd3.LockerOptions may be passed into etcd3.NewWithLockerOptions like the following example:\n\n```\n  ttl := 15 // seconds\n  options := etcd3locker.NewLockerOptions(ttl, \"my-prefix\")\n  locker, err := etcd3locker.NewWithLockerOptions(client, options)\n  if err != nil {\n      return nil, fmt.Errorf(\"Failed to create etcd locker: %v\", err.Error())\n  }\n```\n\nAs of this time of writing, this locker has been tested on etcd versions 3.1/3.2/3.3.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftus%2Ftusd-etcd3-locker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftus%2Ftusd-etcd3-locker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftus%2Ftusd-etcd3-locker/lists"}