Unknwon 2fd69f13d9 vendor: check in vendors 7 年之前
..
LICENSE 2fd69f13d9 vendor: check in vendors 7 年之前
Makefile 2fd69f13d9 vendor: check in vendors 7 年之前
README.md 2fd69f13d9 vendor: check in vendors 7 年之前
command.go 2fd69f13d9 vendor: check in vendors 7 年之前
commands.go 2fd69f13d9 vendor: check in vendors 7 年之前
doc.go 2fd69f13d9 vendor: check in vendors 7 年之前
error.go 2fd69f13d9 vendor: check in vendors 7 年之前
multi.go 2fd69f13d9 vendor: check in vendors 7 年之前
parser.go 2fd69f13d9 vendor: check in vendors 7 年之前
pipeline.go 2fd69f13d9 vendor: check in vendors 7 年之前
pool.go 2fd69f13d9 vendor: check in vendors 7 年之前
pubsub.go 2fd69f13d9 vendor: check in vendors 7 年之前
rate_limit.go 2fd69f13d9 vendor: check in vendors 7 年之前
redis.go 2fd69f13d9 vendor: check in vendors 7 年之前
script.go 2fd69f13d9 vendor: check in vendors 7 年之前
sentinel.go 2fd69f13d9 vendor: check in vendors 7 年之前

README.md

Redis client for Golang Build Status

Supports:

  • Redis 2.8 commands except QUIT, MONITOR, SLOWLOG and SYNC.
  • Pub/sub.
  • Transactions.
  • Pipelining.
  • Connection pool.
  • TLS connections.
  • Thread safety.
  • Timeouts.
  • Redis Sentinel.

API docs: http://godoc.org/gopkg.in/redis.v2. Examples: http://godoc.org/gopkg.in/redis.v2#pkg-examples.

Installation

Install:

go get gopkg.in/redis.v2

Look and feel

Some corner cases:

SORT list LIMIT 0 2 ASC
vals, err := client.Sort("list", redis.Sort{Offset: 0, Count: 2, Order: "ASC"}).Result()

ZRANGEBYSCORE zset -inf +inf WITHSCORES LIMIT 0 2
vals, err := client.ZRangeByScoreWithScores("zset", redis.ZRangeByScore{
    Min: "-inf",
    Max: "+inf",
    Offset: 0,
    Count: 2,
}).Result()

ZINTERSTORE out 2 zset1 zset2 WEIGHTS 2 3 AGGREGATE SUM
vals, err := client.ZInterStore("out", redis.ZStore{Weights: []int64{2, 3}}, "zset1", "zset2").Result()

EVAL "return {KEYS[1],ARGV[1]}" 1 "key" "hello"
vals, err := client.Eval("return {KEYS[1],ARGV[1]}", []string{"key"}, []string{"hello"}).Result()
PANIC: session(release): write data/sessions/b/6/b6dcacb51e18ffe5: no space left on device

PANIC

session(release): write data/sessions/b/6/b6dcacb51e18ffe5: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)