package
0.0.0-20190422025920-beccf3fe4313
Repository: https://github.com/changwh/go-common.git
Documentation: pkg.go.dev
# README
Redigo
Redigo is a Go client for the Redis database.
Features
- A Print-like API with support for all Redis commands.
- Pipelining, including pipelined transactions.
- Publish/Subscribe.
- Connection pooling.
- Script helper type with optimistic use of EVALSHA.
- Helper functions for working with command replies.
Documentation
Installation
Install Redigo using the "go get" command:
go get github.com/garyburd/redigo/redis
The Go distribution is Redigo's only dependency.
Related Projects
- rafaeljusto/redigomock - A mock library for Redigo.
- chasex/redis-go-cluster - A Redis cluster client implementation.
Contributing
Gary is looking for someone to take over maintenance of this project. If you are interested, contact Gary at the email address listed on his GitHub profile page.
PRs for major features will not be accepted until a new maintainer is found. Bug reports and PRs for bug fixes are welcome.
License
Redigo is available under the Apache License, Version 2.0.
# Functions
Bool is a helper that converts a command reply to a boolean.
Bytes is a helper that converts a command reply to a slice of bytes.
ByteSlices is a helper that converts an array command reply to a [][]byte.
Dial connects to the Redis server at the given network and address using the specified options.
DialConnectTimeout specifies the timeout for connecting to the Redis server.
DialDatabase specifies the database to select when dialing a connection.
DialNetDial specifies a custom dial function for creating TCP connections.
DialPassword specifies the password to use when connecting to the Redis server.
DialReadTimeout specifies the timeout for reading a single command reply.
DialStats specifies stat func for stats.default statfunc.
DialTimeout acts like Dial but takes timeouts for establishing the connection to the server, writing a command and reading a reply.
DialURL connects to a Redis server at the given URL using the Redis URI scheme.
DialWriteTimeout specifies the timeout for writing a single command.
Float64 is a helper that converts a command reply to 64 bit float.
Int is a helper that converts a command reply to an integer.
Int64 is a helper that converts a command reply to 64 bit integer.
Int64Map is a helper that converts an array of strings (alternating key, value) into a map[string]int64.
Int64s is a helper that converts an array command reply to a []int64.
IntMap is a helper that converts an array of strings (alternating key, value) into a map[string]int.
Ints is a helper that converts an array command reply to a []int.
LookupCommandInfo get command info.
MockWith return a mock conn.
MultiBulk is a helper that converts an array command reply to a []interface{}.
NewConn new a redis conn.
NewLoggingConn returns a logging wrapper around a connection.
NewPool creates a new pool.
NewScript returns a new script object.
Scan copies from src to the values pointed at by dest.
ScanSlice scans src to the slice pointed to by dest.
ScanStruct scans alternating names and values from src to a struct.
String is a helper that converts a command reply to a string.
StringMap is a helper that converts an array of strings (alternating key, value) into a map[string]string.
Strings is a helper that converts an array command reply to a []string.
Uint64 is a helper that converts a command reply to 64 bit integer.
Values is a helper that converts an array command reply to a []interface{}.
# Variables
ErrNil indicates that a reply value is nil.
# Structs
CommandInfo command info.
Config client settings.
DialOption specifies an option for dialing a Redis server.
Message represents a message notification.
MockErr for unit test.
PMessage represents a pmessage notification.
Pong represents a pubsub pong notification.
Pool .
PubSubConn wraps a Conn with convenience methods for subscribers.
Script encapsulates the source, hash and key count for a Lua script.
Subscription represents a subscribe or unsubscribe notification.
# Interfaces
Conn represents a connection to a Redis server.