{"id":16920548,"url":"https://github.com/arriqaaq/zset","last_synced_at":"2025-04-11T16:39:48.949Z","repository":{"id":55051947,"uuid":"465254164","full_name":"arriqaaq/zset","owner":"arriqaaq","description":"ZSet is an in-memory Redis like sorted set datastructure","archived":false,"fork":false,"pushed_at":"2022-03-20T17:27:03.000Z","size":11,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T12:51:04.605Z","etag":null,"topics":["data-structure","data-structures","golang","redis","skiplist"],"latest_commit_sha":null,"homepage":"","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/arriqaaq.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}},"created_at":"2022-03-02T10:15:31.000Z","updated_at":"2025-01-03T06:30:05.000Z","dependencies_parsed_at":"2022-08-14T10:10:37.582Z","dependency_job_id":null,"html_url":"https://github.com/arriqaaq/zset","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arriqaaq%2Fzset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arriqaaq%2Fzset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arriqaaq%2Fzset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arriqaaq%2Fzset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arriqaaq","download_url":"https://codeload.github.com/arriqaaq/zset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441924,"owners_count":21104104,"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":["data-structure","data-structures","golang","redis","skiplist"],"created_at":"2024-10-13T19:48:42.915Z","updated_at":"2025-04-11T16:39:48.915Z","avatar_url":"https://github.com/arriqaaq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zset\n\nGetting Started\n===============\n\n## Installing\n\nTo start using hash, install Go and run `go get`:\n\n```sh\n$ go get -u github.com/arriqaaq/zset\n```\n\nThis will retrieve the library.\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/arriqaaq/zset\"\n)\n\ntype kv struct{ k, v int }\n\nfunc main() {\n\tkey := \"zset1\"\n\n\t// ZAdd (accepts any value)\n\tn := zset.New()\n\tn.ZAdd(key, 1, \"ced\", nil)\n\tn.ZAdd(key, 1, \"efg\", \u0026kv{1, 2})\n\n\t// ZScore\n\t_, score := n.ZScore(key, \"ced\")\n\tfmt.Println(\"score: \", int(score))\n\t// score: 1\n\n\t// ZRank\n\trank := n.ZRank(key, \"ced\")\n\tfmt.Println(\"zrank: \", int(rank))\n\t// zrank: 0\n\n\t// ZRevRank\n\trank = n.ZRevRank(key, \"ced\")\n\tfmt.Println(\"zrevrank: \", int(rank))\n\t// zrevrank: 1\n\n\t// ZIncrBy\n\tn.ZIncrBy(key, 300, \"ced\")\n\t_, score = n.ZScore(key, \"ced\")\n\tfmt.Println(\"score: \", int(score))\n\t// score: 301\n}\n```\n\n## Supported Commands\n\n```go\nSupported  commands\n\nZADD\nZCARD\nZINCRBY\nZPOPMAX\nZPOPMIN\nZRANGE\nZRANGEBYSCORE\nZRANGEWITHSSCORES\nZRANK\nZREM\nZREVRANGE\nZREVRANGEWITHSSCORES\nZREVRANK\nZSCORE\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farriqaaq%2Fzset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farriqaaq%2Fzset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farriqaaq%2Fzset/lists"}