Hi all,

I wrote a Redis Module: redis-protobuf 
<https://github.com/sewenew/redis-protobuf>, which can read and write 
Protobuf <https://developers.google.com/protocol-buffers/> messages.

This module uses Protobuf Reflection to operate Protobuf messages, so you 
only need to provide .proto files, then you can read and write these 
pre-defined Protobuf messages.

Please see the doc <https://github.com/sewenew/redis-protobuf> for more 
info.

You can try the following examples with a docker image 
<https://cloud.docker.com/repository/docker/sewenew/redis-protobuf>:


127.0.0.1:6379 
<http://www.google.com/url?q=http%3A%2F%2F127.0.0.1%3A6379&sa=D&sntz=1&usg=AFQjCNH7UNekBOD4RskE5S9pEphId4DIdA>>
 
MODULE LIST
1) 1) "name"
   2) "PB"
   3) "ver"
   4) (integer) 0
127.0.0.1:6379> PB.SCHEMA Msg
"message Msg {\n  int32 i = 1;\n  SubMsg sub = 2;\n  repeated int32 arr = 
3;\n}\n"
127.0.0.1:6379> PB.SET key Msg '{"i" : 1, "sub" : {"s" : "string", "i" : 
2}, "arr" : [1, 2, 3]}'
(integer) 1
127.0.0.1:6379> PB.GET key --FORMAT JSON Msg
"{\"i\":1,\"sub\":{\"s\":\"string\",\"i\":2},\"arr\":[1,2,3]}"
127.0.0.1:6379> PB.SET key Msg.i 10
(integer) 1
127.0.0.1:6379> PB.SET key Msg.sub.s redis-protobuf
(integer) 1
127.0.0.1:6379> PB.SET key Msg.arr[0] 2
(integer) 1
127.0.0.1:6379> PB.GET key Msg.i
(integer) 10
127.0.0.1:6379> PB.GET key Msg.sub.s
"redis-protobuf"
127.0.0.1:6379> PB.GET key Msg.arr[0]
(integer) 2
127.0.0.1:6379> PB.GET key --FORMAT JSON Msg.sub
"{\"s\":\"redis-protobuf\",\"i\":2}"
127.0.0.1:6379> PB.DEL key Msg
(integer) 1

If you have any problem or suggestion on this module, free feel to let me 
know.

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/06341b18-88ad-4230-9983-df74801122e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to