{"id":16874401,"url":"https://github.com/xiaost/redisgo","last_synced_at":"2025-10-06T00:43:17.493Z","repository":{"id":87083060,"uuid":"128957751","full_name":"xiaost/redisgo","owner":"xiaost","description":"A high performance and simple redis client for Go(golang)","archived":false,"fork":false,"pushed_at":"2019-02-22T08:15:59.000Z","size":24,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T11:57:35.947Z","etag":null,"topics":["go","golang","redis","redis-client"],"latest_commit_sha":null,"homepage":null,"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/xiaost.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":"2018-04-10T15:44:15.000Z","updated_at":"2019-09-10T03:46:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"5dda7e1a-66f0-4d10-8b65-79a93eabc86b","html_url":"https://github.com/xiaost/redisgo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xiaost/redisgo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaost%2Fredisgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaost%2Fredisgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaost%2Fredisgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaost%2Fredisgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaost","download_url":"https://codeload.github.com/xiaost/redisgo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaost%2Fredisgo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278542680,"owners_count":26004060,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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":["go","golang","redis","redis-client"],"created_at":"2024-10-13T15:32:34.264Z","updated_at":"2025-10-06T00:43:17.472Z","avatar_url":"https://github.com/xiaost.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redisgo\n\n[![GoDoc](https://godoc.org/github.com/xiaost/redisgo?status.svg)](https://godoc.org/github.com/xiaost/redisgo)\n\nA high performance and simple redis client for Go(golang).\n\nIt is inspired by [redigo](https://github.com/gomodule/redigo).\n\nhere is benchmark results compare to [redigo](https://github.com/gomodule/redigo) and [go-redis](https://github.com/go-redis/redis) with go1.10.1, i7-7700:\n\n```\nBenchmarkCmdSetRedisgo \t10000000\t       188 ns/op\t       5 B/op\t       0 allocs/op\nBenchmarkCmdSetRedigo  \t 5000000\t       329 ns/op\t     112 B/op\t       5 allocs/op\nBenchmarkCmdSetGoredis \t 2000000\t       748 ns/op\t     372 B/op\t       9 allocs/op\n```\n\n### Usage\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"log\"\n    \"net\"\n\n    \"github.com/xiaost/redisgo\"\n)\n\nfunc main() {\n    pool := redisgo.NewPool(func(ctx context.Context) (*redisgo.Conn, error) {\n        conn, err := net.Dial(\"tcp\", \"127.0.0.1:6379\")\n        if err != nil {\n            return nil, err\n        }\n        return redisgo.NewConn(conn), nil\n    })\n\n    redisconn, err := pool.Get(context.TODO())\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer redisconn.Close() // returns to pool\n\n    err = redisconn.DoNoReply(\"SET\", \"hello\", \"world\")\n    /*  or you can do it like this:\n    reply, err := c.Do(cmd, args...)\n    if err == nil {\n        err = reply.Err()\n        reply.Free()\n    }\n    */\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    b, err := redisconn.DoBytes(\"GET\", \"hello\")\n    /* or you can do it like this:\n    var b []byte\n    reply, err := c.Do(\"GET\", \"hello\")\n    if err == nil {\n        b, err = reply.Bytes()\n        reply.Free()\n    }\n    */\n    if err != nil { // err == redisgo.ErrNil if not exists\n        log.Fatal(err)\n    }\n    if s := string(b); s != \"world\" {\n        log.Fatal(s)\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaost%2Fredisgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaost%2Fredisgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaost%2Fredisgo/lists"}