{"id":20791467,"url":"https://github.com/kvtools/etcdv2","last_synced_at":"2026-02-18T03:34:44.906Z","repository":{"id":59047356,"uuid":"533847626","full_name":"kvtools/etcdv2","owner":"kvtools","description":"Valkeyrie: etcdv2","archived":false,"fork":false,"pushed_at":"2025-03-27T22:47:50.000Z","size":129,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-01T05:03:48.021Z","etag":null,"topics":["etcd","etcdv2","go","golang","kv-store","valkeyrie"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kvtools.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},"funding":{"github":"ldez","ko_fi":"ldez_oss","liberapay":"ldez","thanks_dev":"u/gh/ldez"}},"created_at":"2022-09-07T16:25:10.000Z","updated_at":"2025-06-25T11:48:54.000Z","dependencies_parsed_at":"2024-06-20T04:39:13.237Z","dependency_job_id":"f1b12fee-31c9-45e7-b25a-005be63d4fc0","html_url":"https://github.com/kvtools/etcdv2","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kvtools/etcdv2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvtools%2Fetcdv2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvtools%2Fetcdv2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvtools%2Fetcdv2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvtools%2Fetcdv2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvtools","download_url":"https://codeload.github.com/kvtools/etcdv2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvtools%2Fetcdv2/sbom","scorecard":{"id":574601,"data":{"date":"2025-08-11","repo":{"name":"github.com/kvtools/etcdv2","commit":"62533828ce8c072ace5b522876541579f666a44f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml: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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/kvtools/etcdv2/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/kvtools/etcdv2/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/kvtools/etcdv2/build.yml/main?enable=pin","Warn: downloadThenRun not pinned by hash: .github/workflows/build.yml:29","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 downloadThenRun 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":"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":"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: Apache License 2.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":"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":"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":"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"}}]},"last_synced_at":"2025-08-20T17:18:59.657Z","repository_id":59047356,"created_at":"2025-08-20T17:18:59.657Z","updated_at":"2025-08-20T17:18:59.657Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29567500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"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":["etcd","etcdv2","go","golang","kv-store","valkeyrie"],"created_at":"2024-11-17T15:44:49.149Z","updated_at":"2026-02-18T03:34:39.898Z","avatar_url":"https://github.com/kvtools.png","language":"Go","funding_links":["https://github.com/sponsors/ldez","https://ko-fi.com/ldez_oss","https://liberapay.com/ldez","https://thanks.dev/u/gh/ldez"],"categories":[],"sub_categories":[],"readme":"# Valkeyrie etcd v2\n\n[![GoDoc](https://godoc.org/github.com/kvtools/etcdv2?status.png)](https://godoc.org/github.com/kvtools/etcdv2)\n[![Build Status](https://github.com/kvtools/etcdv2/actions/workflows/build.yml/badge.svg)](https://github.com/kvtools/etcdv2/actions/workflows/build.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/kvtools/etcdv2)](https://goreportcard.com/report/github.com/kvtools/etcdv2)\n\n[`valkeyrie`](https://github.com/kvtools/valkeyrie) provides a Go native library to store metadata using Distributed Key/Value stores (or common databases).\n\n## Compatibility\n\nA **storage backend** in `valkeyrie` implements (fully or partially) the [Store](https://github.com/kvtools/valkeyrie/blob/master/store/store.go#L69) interface.\n\n| Calls                 | Etcd |\n|-----------------------|:----:|\n| Put                   | 🟢️  |\n| Get                   | 🟢️  |\n| Delete                | 🟢️  |\n| Exists                | 🟢️  |\n| Watch                 | 🟢️  |\n| WatchTree             | 🟢️  |\n| NewLock (Lock/Unlock) | 🟢️  |\n| List                  | 🟢️  |\n| DeleteTree            | 🟢️  |\n| AtomicPut             | 🟢️  |\n| AtomicDelete          | 🟢️  |\n\n## Supported Versions\n\nEtcd versions \u003e= `2.0` with **APIv2** (*deprecated*)\n\n## Etcd Versions\n\nSupport for etcd comes with two API versions: **APIv2** and **APIv3**.\nWe recommend you use the new **APIv3** because of incompatibilities of **APIv2** with other stores.\nUse **APIv2** only if you plan to support older versions of etcd.\n\n### Etcd APIv2 Pitfalls\n\nIn the case you plan to support etcd with **APIv2**, please be aware of some pitfalls.\n\n#### Etcd directory/key Distinction\n\n`etcd` with APIv2 makes the distinction between keys and directories. The result with `valkeyrie` is that when using the etcd driver:\n\n- You cannot store values on directories\n- You cannot invoke `WatchTree` (watching on child values), on a regular key\n\nThis is fundamental difference from stores like `Consul` and `zookeeper` which are more permissive and allow the same set of operations on keys and directories (called a Node for zookeeper).\n\n### `Put`\n\n`etcd` cannot put values on directories, so this puts a major restriction compared to `Consul` and `zookeeper`.\n\nIf you want to support all those three backends, you should make sure to only put data on **leaves**.\n\nFor example:\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\t\"github.com/kvtools/valkeyrie/store\"\n)\n\nfunc foo(ctx context.Context, kv store.Store) {\n\t_ = kv.Put(ctx, \"path/to/key/bis\", []byte(\"foo\"), nil)\n\t_ = kv.Put(ctx, \"path/to/key\", []byte(\"bar\"), nil)\n}\n```\n\nWill work on `Consul` and `zookeeper` but fail for `etcd`.\nThis is because the first `Put` in the case of `etcd` will recursively create the directory hierarchy and `path/to/key` is now considered as a directory.\nThus, values should always be stored on leaves if the support for all backends is planned.\n\n#### `WatchTree`\n\nWhen initializing the `WatchTree`, the natural way to do so is through the following code:\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\t\"github.com/kvtools/valkeyrie/store\"\n)\n\nfunc foo(ctx context.Context, kv store.Store) error {\n\tkey := \"path/to/key\"\n\texists, _ := kv.Exists(ctx, key, nil)\n\tif !exists {\n\t\terr := kv.Put(ctx, key, []byte(\"data\"), nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tevents, err := kv.WatchTree(key, nil, nil)\n\t// ...\n\n\treturn nil\n}\n```\n\nThe code above will not work across backends and etcd with **APIv2** will fail on the `WatchTree` call. What happens exactly:\n\n- `Consul` will create a regular `key` because it has no distinction between directories and keys. This is not an issue as we can invoke `WatchTree` on regular keys.\n- `zookeeper` is going to create a `node` that can either be a directory or a key during the lifetime of a program, but it does not matter as a directory can hold values and be watchable like a regular key.\n- `etcd` is going to create a regular `key`. We cannot invoke `WatchTree` on regular keys using etcd.\n\nTo use `WatchTree` with every supported backend, we need to enforce a parameter that is only interpreted with `etcd` **APIv2** and which asks the client to create a `directory` instead of a key.\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\t\"github.com/kvtools/valkeyrie/store\"\n)\n\nfunc foo(ctx context.Context, kv store.Store) error {\n\tkey := \"path/to/key\"\n\texists, _ := kv.Exists(ctx, key, nil)\n\tif !exists {\n\t\t// We enforce IsDir = true to make sure etcd creates a directory\n\t\terr := kv.Put(ctx, key, []byte(\"data\"), \u0026store.WriteOptions{IsDir: true})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tevents, err := kv.WatchTree(ctx, key, nil)\n\t// ...\n\n\treturn nil\n}\n```\n\nThe code above will work for all backends but make sure not to try to store any value on that path as the call to `Put` will fail for `etcd`\n(you can only put at `path/to/key/foo`, `path/to/key/bar` for example).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvtools%2Fetcdv2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvtools%2Fetcdv2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvtools%2Fetcdv2/lists"}