{"id":19197700,"url":"https://github.com/eddycjy/redis-protocol-example","last_synced_at":"2025-05-09T00:52:30.070Z","repository":{"id":57487251,"uuid":"136320836","full_name":"eddycjy/redis-protocol-example","owner":"eddycjy","description":"用 Go 来了解一下 Redis 通讯协议","archived":false,"fork":false,"pushed_at":"2018-06-06T14:34:20.000Z","size":4,"stargazers_count":42,"open_issues_count":1,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T10:41:14.617Z","etag":null,"topics":["go","golang","protocol","redis"],"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/eddycjy.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":"2018-06-06T11:44:41.000Z","updated_at":"2023-09-08T17:41:24.000Z","dependencies_parsed_at":"2022-09-01T23:02:08.197Z","dependency_job_id":null,"html_url":"https://github.com/eddycjy/redis-protocol-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddycjy%2Fredis-protocol-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddycjy%2Fredis-protocol-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddycjy%2Fredis-protocol-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddycjy%2Fredis-protocol-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eddycjy","download_url":"https://codeload.github.com/eddycjy/redis-protocol-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171233,"owners_count":21865289,"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":["go","golang","protocol","redis"],"created_at":"2024-11-09T12:17:51.421Z","updated_at":"2025-05-09T00:52:30.041Z","avatar_url":"https://github.com/eddycjy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redis-protocol-example\n\n用 Go 来了解一下 Redis 通讯协议，本项目支持 Redis 的五种通讯协议，如下：\n\n- 状态回复（status reply）\n- 错误回复（error reply）\n- 整数回复（integer reply）\n- 批量回复（bulk reply）\n- 多条批量回复（multi bulk reply）\n\n## 安装\n```\n$ go get github.com/EDDYCJY/redis-protocol-example\n```\n\n## 使用\n\n### Status Reply\n\n```\n$ go run main.go SET test01 value01\n2018/06/06 21:29:07 Reply: OK\n2018/06/06 21:29:07 Command: +OK\n```\n\n### Error Reply\n\n```\n$ go run main.go error\n2018/06/06 22:20:39 Reply: ERR unknown command 'error'\n2018/06/06 22:20:39 Command: -ERR unknown command 'error'\n```\n\n### Integer Reply\n\n```\n$ go run main.go EXPIRE test01 3600\n2018/06/06 22:18:00 Reply: 1\n2018/06/06 22:18:00 Command: :1\n```\n\n### Bulk Reply\n\n```\n$ go run main.go GET test01\n2018/06/06 22:13:36 Reply: value01\n2018/06/06 22:13:36 Command: $7\nvalue01\n```\n\n### Multi Bulk Reply\n\n```\n$ go run main.go LPUSH test-multi 01\n2018/06/06 22:23:50 Reply: 1\n2018/06/06 22:23:50 Command: :1\n\n$ go run main.go LPUSH test-multi 02\n2018/06/06 22:23:54 Reply: 2\n2018/06/06 22:23:54 Command: :2\n\n$ go run main.go LPUSH test-multi 03\n2018/06/06 22:23:57 Reply: 3\n2018/06/06 22:23:57 Command: :3\n\n$ go run main.go LRANGE test-multi 0 10\n2018/06/06 22:24:10 Reply: [03 02 01]\n2018/06/06 22:24:10 Command: *3\n$2\n03\n$2\n02\n$2\n01\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddycjy%2Fredis-protocol-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddycjy%2Fredis-protocol-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddycjy%2Fredis-protocol-example/lists"}