{"id":21296955,"url":"https://github.com/reddec/api-kv","last_synced_at":"2025-03-15T17:27:45.439Z","repository":{"id":174715618,"uuid":"652719110","full_name":"reddec/api-kv","owner":"reddec","description":"API-first, Key-Value storage designed with simplicity in mind, and powered by SQLite.","archived":false,"fork":false,"pushed_at":"2023-06-15T14:47:39.000Z","size":103,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T00:06:38.926Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reddec.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}},"created_at":"2023-06-12T16:46:55.000Z","updated_at":"2023-06-12T16:47:33.000Z","dependencies_parsed_at":"2024-02-06T05:45:30.073Z","dependency_job_id":null,"html_url":"https://github.com/reddec/api-kv","commit_stats":null,"previous_names":["reddec/api-kv"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapi-kv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapi-kv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapi-kv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapi-kv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reddec","download_url":"https://codeload.github.com/reddec/api-kv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243765059,"owners_count":20344526,"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-21T14:31:18.338Z","updated_at":"2025-03-15T17:27:45.417Z","avatar_url":"https://github.com/reddec.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API-KV: Simple and Flexible Key-Value Storage\n\n![apikv-logo.png](_docs/apikv-logo.png)\n\nWelcome to API-KV, a user-friendly and versatile Key-Value storage designed with simplicity and API-first in mind.\nPowered by SQLite and implemented in Golang, API-KV offers an effortless experience for managing your data.\n\nFeatures:\n\n- **Easy to Use**: With API-KV, you can get started in no time. Simply download the binary and run it, and you're good\n  to go. No complicated setup required!\n- **Flexible Storage**: API-KV leverages the power of SQLite to provide a reliable and efficient storage solution for\n  your key-value data.\n- **Pre-built Docker Containers**: We have pre-built Docker containers available, making it even easier to deploy API-KV\n  in your preferred environment.\n- **Unbound experience**: Say goodbye to RAM limitations and the complexities of embedded DB-Per-App. API-KV, allows you\n  to store everything on disk while maintaining efficient indexing and automatic removal of expired items.\n- **Namespaces**: No more conflicts between apps or pre-defined databases. Organize keys in namespaces, which are\n  dynamically created without restrictions.\n\nSelf-hosted friendly.\n\n## Installation\n\n- Via GitHub [releases](https://github.com/reddec/api-kv/releases/latest)\n- Via Go install: `go install -v github.com/reddec/api-kv/cmd/...@latest`\n- Via [Docker image](https://github.com/reddec/api-kv/pkgs/container/api-kv) (x64 and\n  arm): `ghcr.io/reddec/api-kv:latest`\n\n## Usage\n\n- [OpenAPI spec](openapi.yaml)\n- [Live docs](https://elements-demo.stoplight.io/?spec=https://raw.githubusercontent.com/reddec/api-kv/master/openapi.yaml)\n- [![](https://godoc.org/github.com/reddec/api-kv/api/client?status.svg)](http://godoc.org/github.com/reddec/api-kv/api/client)\n  generated Go API client\n\nBasic rules of URL: `/\u003cnamespace\u003e/\u003ckey\u003e`, and content is value.\n\nCreate (or update) record\n\n    curl -v -H 'X-Api-Key: changeme' --data-binary 'Hello world' http://127.0.0.1:8080/demo/key1\n\nCreate (or update) record with TTL (2 minutes)\n\n    curl -v -H 'X-Api-Key: changeme' --data-binary 'Hello world' http://127.0.0.1:8080/demo/key1?ttl=120\n\nGet record\n\n    curl -v -H 'X-Api-Key: changeme' http://127.0.0.1:8080/demo/key1\n\nIterate over keys in namespace\n\n    curl -v -H 'X-Api-Key: changeme' http://127.0.0.1:8080/demo\n\nDelete record\n\n    curl -v -X DELETE -H 'X-Api-Key: changeme' http://127.0.0.1:8080/demo/key1\n\nDelete namespace\n\n    curl -v -X DELETE -H 'X-Api-Key: changeme' http://127.0.0.1:8080/demo\n\n### Go client\n\n```go\n// errors omitted for demonstration purpose\nkv, _ := client.Dial(\"https://example.com\", \"my-app\", \"my-secret-token\")\n\n// set item\n_ = kv.Set(ctx, \"foo\", []byte(\"bar\"))\n_ = kv.Set(ctx, \"bar\", []byte(\"baz\"))\n\n// set item with expiration\n_ = kv.SetExpire(ctx, \"alice\", []byte(\"bob\"), time.Minute)\n\n// get item\nvalue, _ := kv.Get(ctx, \"foo\")\n\n// delete item\n_ = kv.Delete(ctx, \"foo\")\n\n// errors omitted for demonstration purpose\nkv, _ := Dial(\"https://example.com\", \"my-app\", \"deadbeaf\")\n\n// iterate\nit := kv.Keys()\nfor it.Next(ctx) {\n    for _, key := range it.Keys() {\n        fmt.Println(key)\n    }\n}\n\n// check errors\nif it.Error() != nil {\n    panic(it.Error())\n}\n\n// destroy namespace\n_ = kv.Destroy(ctx)\n```\n\n## Configuration\n\n`api-kv serve`\n\n```\nUsage:\n  api-kv [OPTIONS] serve [serve-OPTIONS]\n\nHelp Options:\n  -h, --help                  Show this help message\n\n[serve command options]\n      -b, --bind=             API binding address (default: 127.0.0.1:8080) [$API_KV_BIND]\n      -d, --dir=              Directory to store data (default: data) [$API_KV_DIR]\n      -t, --token=            Authorization token (default: changeme) [$API_KV_TOKEN]\n          --batch-size=       Batch size for keys iteration (default: 20) [$API_KV_BATCH_SIZE]\n          --cleanup-interval= Cleanup interval for expired items (default: 1m) [$API_KV_CLEANUP_INTERVAL]\n```\n\n- For docker distribution:\n    - the bind address is `0.0.0.0:8080`\n    - the directory is `/data`\n\n## Community and Contributions\n\nWe encourage you to join our community and contribute to API-KV's development. Whether it's reporting bugs, suggesting\nfeatures, or submitting pull requests, your input is highly valued. Together, we can make API-KV even better!\n\nJoin the conversation on our GitHub Discussions page and check out our contribution guidelines to get started.\n\n## License\n\nAPI-KV is open-source and released under the MIT License. Feel free to use, modify, and distribute it as per the terms\nof the license.\n\nWe hope you enjoy using API-KV! If you have any questions or need assistance, don't hesitate to reach out. Happy coding!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Fapi-kv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freddec%2Fapi-kv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Fapi-kv/lists"}