Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erpeng/godis-cli
redis-cli go version
https://github.com/erpeng/godis-cli
go redis redis-cli
Last synced: 5 days ago
JSON representation
redis-cli go version
- Host: GitHub
- URL: https://github.com/erpeng/godis-cli
- Owner: erpeng
- License: mit
- Created: 2019-01-30T11:59:42.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-31T14:39:57.000Z (almost 6 years ago)
- Last Synced: 2024-08-01T19:32:29.800Z (3 months ago)
- Topics: go, redis, redis-cli
- Language: Go
- Homepage: https://segmentfault.com/a/1190000018082587
- Size: 18.6 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[中文](/README_CN.md)
# godis-cli
go version redis-cli## install
go get github.com/erpeng/godis-cli## usage
go run godis-cli.go## sub pattern
when execute subscribe command ,godis-cli enters subscribe pattern(non-blocking)
[sub]> subscribe foo
in subscribe pattern,only subscribe/psubscribe/unsubscribe/punsubscribe/ping command can execute.when someone pu blish some message on channel foo,godis-cli can receive message and print it.we can exit sub pattern use `exit`,then we enter normal pattern.Also,we use `exit` exit normal pattern## example
>bogon:godis-cli didi$ go run godis-cli.go
> set k1 v1 //normal pattern
OK
> get k1
v1
> subscribe foo //enter sub pattern
subscribe foo 1
[sub]>subscribe foo1
subscribe foo1 2
[sub]> unsubscribe foo1
unsubscribe foo1 1
[sub]> ping
pong
[sub]> get k1 //we can't execute get in sub pattern
Redis Error: only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context
[sub]> exit //exit sub pattern
exit sub pattern....
>get k1//now we can execute get in normal pattern
v1
> exit