{"id":37144044,"url":"https://github.com/proway2/kvserver","last_synced_at":"2026-01-14T16:54:54.666Z","repository":{"id":133393213,"uuid":"170978909","full_name":"proway2/kvserver","owner":"proway2","description":"Simple yet fully functional in-memory key-value storage server based on HTTP protocol with elements being purged when expired. All operations run in constant time.","archived":false,"fork":false,"pushed_at":"2025-07-13T17:24:34.000Z","size":90,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-13T17:42:00.083Z","etag":null,"topics":["database","elements-purged","expiration","golang","gplv3","http-protocol","in-memory","key","key-value","key-value-database","key-value-store","server","storage-server","ttl","ttl-cache","value"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/proway2.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}},"created_at":"2019-02-16T08:08:30.000Z","updated_at":"2025-07-12T10:30:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"8693634c-63f3-4fb5-8563-4d2ca9b0e753","html_url":"https://github.com/proway2/kvserver","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/proway2/kvserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proway2%2Fkvserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proway2%2Fkvserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proway2%2Fkvserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proway2%2Fkvserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/proway2","download_url":"https://codeload.github.com/proway2/kvserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proway2%2Fkvserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28427072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","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":["database","elements-purged","expiration","golang","gplv3","http-protocol","in-memory","key","key-value","key-value-database","key-value-store","server","storage-server","ttl","ttl-cache","value"],"created_at":"2026-01-14T16:54:53.967Z","updated_at":"2026-01-14T16:54:54.658Z","avatar_url":"https://github.com/proway2.png","language":"Go","readme":"![Build\u0026Test](https://github.com/proway2/kvserver/workflows/Build\u0026Test/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/proway2/kvserver)](https://goreportcard.com/report/github.com/proway2/kvserver)\n\n# kvserver\nSimple yet fully functional in-memory key-value storage server based on HTTP protocol with elements purged based on TTL. All operations run in constant time.    \nOperations provided by server:\n\n- storing/updating value by its key\n- getting value by its key\n- deleting value by its key\n- key-value element is cleaned up when expired (works automatically).\n\n# Features\n\n- all operations have time complexity of ```O(1)```, i.e. always run in constant time.    \n- hits TTL as much accurate as it's possible.    \n- lower CPU cycles consumption during approximation and idle.    \n- TTL approximation's divider is always 2, i.e. next check time = current time + (time to the next element to purge)/2.\n\n# Installation\nClone and run ```go install``` in project folder.\n\n# Usage\nCommand line arguments:\n```bash\n$ kvserver -h\nUsage of kvserver:\n  -addr string\n    \tIP address to bind to (default \"127.0.0.1\")\n  -port int\n    \tport to listen to (default 8080)\n  -ttl uint\n    \telement's (key-value) lifetime in the storage, secs. (default 60)\n```\n# API\nBase URL ```http://\u003chost\u003e:\u003cport\u003e/key/\u003ckey_name\u003e```, where ```\u003ckey_name\u003e``` - is the name of the key to be stored. Key and its value are always string.\n## Storing/Updating value by its key\n_HTTP method_: ```POST```    \n_Request's parameter name_: ```value```    \n_Success code_: ```200```    \n_Error code_: ```400```, empty key is provided.    \n_Note_: TTL is reset for any subsequent requests for the same key.\n\n## Getting value by its key\n_HTTP method_: ```GET```    \n_Request's parameter name_: no parameter is needed.    \n_Success code_: ```200```, response's body contains string value for the key.    \n_Error code_: ```404```, key is not found in the storage.    \n\n## Deleting value by its key\n_HTTP method_: ```POST```    \n_Request's parameter name_: no parameter is needed.    \n_Success code_: ```200```, value is successfully deleted.    \n_Error code_: ```404```, key is not found in the storage.    \n\nWhen error is occured code ```400``` is returned by server.\n\n# Tests\nRun ```go test -v -cover -count=1 ./...```.\n\n# License\nGPL v3\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproway2%2Fkvserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproway2%2Fkvserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproway2%2Fkvserver/lists"}