All Projects → eddycjy → redis-protocol-example

eddycjy / redis-protocol-example

Licence: MIT license
用 Go 来了解一下 Redis 通讯协议

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to redis-protocol-example

PSAVanCanBridge
VAN - CAN protocol bridge (V2C) for cars made by PSA Group (Peugeot, Citroen)
Stars: ✭ 67 (+71.79%)
Mutual labels:  protocol
rconsharp
rconsharp is a Valve RCON protocol implementation written in C# targeting netstandard 2.1
Stars: ✭ 43 (+10.26%)
Mutual labels:  protocol
GEO-network-client
Reference implementation of the GEO Protocol.
Stars: ✭ 19 (-51.28%)
Mutual labels:  protocol
SwiftArchitectureWithPOP
A base architecture written in swift and protocol oriented, for building new apps easily and quickly
Stars: ✭ 28 (-28.21%)
Mutual labels:  protocol
wayland-explorer
Easily browse and read Wayland protocols documentation
Stars: ✭ 78 (+100%)
Mutual labels:  protocol
nat-api
↔️ Fast port mapping with UPnP and NAT-PMP
Stars: ✭ 22 (-43.59%)
Mutual labels:  protocol
LXFProtocolTool
由Swift中协议方式实现功能的实用工具库【Refreshable、EmptyDataSetable 支持 Rx 】
Stars: ✭ 101 (+158.97%)
Mutual labels:  protocol
ByteBuffer
nodejs版本的ByteBuffer和C++通信的利器!
Stars: ✭ 70 (+79.49%)
Mutual labels:  protocol
MqttAndroidExample
An example Android app using MQTT protocol
Stars: ✭ 19 (-51.28%)
Mutual labels:  protocol
trinity-eth
No description or website provided.
Stars: ✭ 14 (-64.1%)
Mutual labels:  protocol
ipfs-companion
Browser extension that simplifies access to IPFS resources on the web
Stars: ✭ 1,745 (+4374.36%)
Mutual labels:  protocol
WSD-python
Web Services for Devices (WSD) tools and utilities for cross platform support
Stars: ✭ 22 (-43.59%)
Mutual labels:  protocol
sirdez
Glorious Binary Serialization and Deserialization for TypeScript.
Stars: ✭ 20 (-48.72%)
Mutual labels:  protocol
ErpNet.FP
ErpNet.FP is a light-weight cross-platform Http server facilitating printing to fiscal printers through simple JSON Api.
Stars: ✭ 75 (+92.31%)
Mutual labels:  protocol
ws-promise
A tiny, Promise-based WebSocket protocol allowing request-response usage in ECMAScript
Stars: ✭ 20 (-48.72%)
Mutual labels:  protocol
Rubicon
Swift parser + mock generator
Stars: ✭ 42 (+7.69%)
Mutual labels:  protocol
memcacher
C++ implementation of Memcache Binary Protocol.
Stars: ✭ 16 (-58.97%)
Mutual labels:  protocol
memcache
Node.js memcached client with the most efficient ASCII protocol parser
Stars: ✭ 26 (-33.33%)
Mutual labels:  protocol
protocol
Covee protocol for decentralized teamwork
Stars: ✭ 18 (-53.85%)
Mutual labels:  protocol
kleros
Kleros smart contracts
Stars: ✭ 203 (+420.51%)
Mutual labels:  protocol

redis-protocol-example

用 Go 来了解一下 Redis 通讯协议,本项目支持 Redis 的五种通讯协议,如下:

  • 状态回复(status reply)
  • 错误回复(error reply)
  • 整数回复(integer reply)
  • 批量回复(bulk reply)
  • 多条批量回复(multi bulk reply)

安装

$ go get github.com/EDDYCJY/redis-protocol-example

使用

Status Reply

$ go run main.go SET test01 value01
2018/06/06 21:29:07 Reply: OK
2018/06/06 21:29:07 Command: +OK

Error Reply

$ go run main.go error
2018/06/06 22:20:39 Reply: ERR unknown command 'error'
2018/06/06 22:20:39 Command: -ERR unknown command 'error'

Integer Reply

$ go run main.go EXPIRE test01 3600
2018/06/06 22:18:00 Reply: 1
2018/06/06 22:18:00 Command: :1

Bulk Reply

$ go run main.go GET test01
2018/06/06 22:13:36 Reply: value01
2018/06/06 22:13:36 Command: $7
value01

Multi Bulk Reply

$ go run main.go LPUSH test-multi 01
2018/06/06 22:23:50 Reply: 1
2018/06/06 22:23:50 Command: :1

$ go run main.go LPUSH test-multi 02
2018/06/06 22:23:54 Reply: 2
2018/06/06 22:23:54 Command: :2

$ go run main.go LPUSH test-multi 03
2018/06/06 22:23:57 Reply: 3
2018/06/06 22:23:57 Command: :3

$ go run main.go LRANGE test-multi 0 10
2018/06/06 22:24:10 Reply: [03 02 01]
2018/06/06 22:24:10 Command: *3
$2
03
$2
02
$2
01
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].