Documentation ¶
Index ¶
- Constants
- Variables
- type BatchCommands
- type Commands
- type Config
- type Connection
- type HashBatchCommands
- type HashCommands
- type HyperLogLogBatchCommands
- type HyperLogLogCommands
- type KeyBatchCommands
- type KeyCommands
- type ListBatchCommands
- type ListCommands
- type Pipeline
- type Pool
- type PooledConnection
- type PubSub
- type ScanCommands
- type SetBatchCommands
- type SetCommands
- type SortedSetBatchCommands
- type SortedSetCommands
- type StringBatchCommands
- type StringCommands
- type Transaction
- type Transactions
- type UnpooledConnection
- type Z
Constants ¶
View Source
const Unlimited = 0
Variables ¶
View Source
var ( DefaultConfig = Config{ MaxOpenConnections: Unlimited, MaxIdleConnections: 50, IdleTimeout: 1 * time.Minute, Wait: true, } ErrPoolExhausted = errors.New("connection pool exhausted") )
View Source
var (
ErrNil = redigo.ErrNil
)
Functions ¶
This section is empty.
Types ¶
type BatchCommands ¶
type BatchCommands interface { KeyBatchCommands StringBatchCommands HashBatchCommands ListBatchCommands SetBatchCommands SortedSetBatchCommands HyperLogLogBatchCommands }
Commands with no results, to be used in transactions/pipelining.
type Commands ¶
type Commands interface { KeyCommands StringCommands HashCommands ListCommands SetCommands SortedSetCommands HyperLogLogCommands ScanCommands }
Commands with results
type Connection ¶
type Connection interface { Commands Transactions Send(command string, args ...interface{}) error Do(command string, args ...interface{}) (interface{}, error) Transaction(func(Transaction)) ([]interface{}, error) Pipelined(func(Pipeline)) ([]interface{}, error) PipelinedDiscarding(f func(Pipeline)) error Flush() error Receive() (interface{}, error) }
type HashBatchCommands ¶
type HashBatchCommands interface { HGet(key string, field string) error HGetAll(key string) error HIncrBy(key string, field string, value int64) error HSet(key string, field string, value string) error HMGet(key string, fields ...string) error HMSet(key string, args map[string]interface{}) error HDel(key string, field string) error }
type HashCommands ¶
type HashCommands interface { HGet(key string, field string) (string, error) // HGetAll returns a map containing all the fields and values in the specified key. // As specified by the Redis docs, because non-existing keys are treated as empty hashes, // calling this on a non-existant key will return an empty map and a nil error. HGetAll(key string) (map[string]string, error) HIncrBy(key string, field string, value int64) (newValue int64, err error) HSet(key string, field string, value string) (isNew bool, err error) // HMGet returns a map of the specified fields to their values in the specified key. As is // consistent with redigo.Strings, nil values (missing fields) are converted to empty strings. // As specified by the Redis docs, because non-existing keys are treated as empty hashes, // calling this on a non-existant key will return a map of the specified keys to empty strings. HMGet(key string, fields ...string) (map[string]string, error) HMSet(key string, args map[string]interface{}) error HDel(key string, field string) (bool, error) }
Hashes - http://redis.io/commands#hash
type HyperLogLogCommands ¶
type HyperLogLogCommands interface { PFAdd(key string, values ...string) (int, error) PFCount(key string) (int, error) PFMerge(mergedKey string, keysToMerge ...string) (bool, error) }
HyperLogLog
type KeyBatchCommands ¶
type KeyCommands ¶
type ListBatchCommands ¶
type ListCommands ¶
type ListCommands interface { BLPop(timeout int, keys ...string) (listName string, value string, err error) BRPop(timeout int, keys ...string) (listName string, value string, err error) LIndex(key string, index int) (string, error) LLen(key string) (int, error) LPop(key string) (string, error) LPush(key string, values ...string) (int, error) LTrim(key string, startIndex int, endIndex int) error LRange(key string, startIndex int, endIndex int) ([]string, error) LRem(key string, count int, value string) (int, error) RPop(key string) (string, error) RPush(key string, values ...string) (int, error) }
Lists - http://redis.io/commands#list
type Pipeline ¶
type Pipeline interface { BatchCommands // contains filtered or unexported methods }
type Pool ¶
type Pool interface { Commands GetConnection() (PooledConnection, error) Return(PooledConnection) Do(f func(Connection)) error Transaction(func(Transaction)) ([]interface{}, error) Pipelined(func(Pipeline)) ([]interface{}, error) PipelinedDiscarding(f func(Pipeline)) error Shutdown() }
type PooledConnection ¶
type PooledConnection interface { Connection Release() }
type ScanCommands ¶
type ScanCommands interface { Scan(cursor int, match string, count int) (nextCursor int, matches []string, err error) SScan(key string, cursor int, match string, count int) (nextCursor int, matches []string, err error) ZScan(key string, cursor int, match string, count int) (nextCursor int, matches []string, scores []float64, err error) }
type SetBatchCommands ¶
type SetBatchCommands interface { SAdd(key string, member string, members ...string) error SRem(key string, member string, members ...string) error SPop(key string) error SMembers(key string) error SRandMember(key string, count int) error SDiff(key string, keys ...string) error SMove(source, destination, member string) error }
type SetCommands ¶
type SetCommands interface { SAdd(key string, member string, members ...string) (int, error) SCard(key string) (int, error) SRem(key, member string, members ...string) (int, error) SPop(key string) (string, error) SMembers(key string) ([]string, error) SRandMember(key string, count int) ([]string, error) SDiff(key string, keys ...string) ([]string, error) SIsMember(key string, member string) (bool, error) SMove(source, destination, member string) (bool, error) }
Sets - http://redis.io/commands#set
type SortedSetBatchCommands ¶
type SortedSetBatchCommands interface { ZAdd(key string, args ...interface{}) error ZCard(key string) error ZRange(key string, start, stop int) error ZRangeWithScores(key string, start, stop int) error ZRangeByScore(key, min, max string) error ZRangeByScoreWithScores(key, min, max string) error ZRangeByScoreWithLimit(key, min, max string, offset, count int) error ZRangeByScoreWithScoresWithLimit(key, min, max string, offset, count int) error ZRevRange(key string, start, stop int) error ZRevRangeWithScores(key string, start, stop int) error ZRevRangeByScore(key, min, max string) error ZRevRangeByScoreWithScores(key, min, max string) error ZRevRangeByScoreWithLimit(key, min, max string, offset, count int) error ZRevRangeByScoreWithScoresWithLimit(key, min, max string, offset, count int) error ZRank(key, member string) error ZRem(key string, members ...string) error ZRemRangeByRank(key string, start, stop int) error ZScore(key string, member string) error ZIncrBy(key string, score float64, value string) error }
type SortedSetCommands ¶
type SortedSetCommands interface { ZAdd(key string, args ...interface{}) (int, error) ZCard(key string) (int, error) ZRange(key string, start, stop int) ([]string, error) ZRangeWithScores(key string, start, stop int) ([]Z, error) ZRangeByScore(key, min, max string) ([]string, error) ZRangeByScoreWithScores(key, min, max string) ([]Z, error) ZRangeByScoreWithLimit(key, min, max string, offset, count int) ([]string, error) ZRangeByScoreWithScoresWithLimit(key, min, max string, offset, count int) ([]Z, error) ZRevRange(key string, start, stop int) ([]string, error) ZRevRangeWithScores(key string, start, stop int) ([]Z, error) ZRevRangeByScore(key, min, max string) ([]string, error) ZRevRangeByScoreWithScores(key, min, max string) ([]Z, error) ZRevRangeByScoreWithLimit(key, min, max string, offset, count int) ([]string, error) ZRevRangeByScoreWithScoresWithLimit(key, min, max string, offset, count int) ([]Z, error) ZRank(key, member string) (int, error) ZRem(key string, members ...string) (removed int, err error) ZRemRangeByRank(key string, start, stop int) (int, error) ZScore(key string, member string) (score float64, err error) ZIncrBy(key string, score float64, value string) (int, error) }
Sorted Sets - http://redis.io/commands#sorted_set
type StringBatchCommands ¶
type StringCommands ¶
type StringCommands interface { Get(key string) (string, error) Set(key, value string) error SetEx(key, value string, expire int) error SetNX(key, value string) (bool, error) Incr(key string) (int, error) }
Strings - http://redis.io/commands#string
type Transaction ¶
type Transaction interface { Pipeline }
type Transactions ¶
type UnpooledConnection ¶
type UnpooledConnection interface { Connection Close() }
func NewConnection ¶
func NewConnection(url *netURL.URL) (UnpooledConnection, error)
Click to show internal directories.
Click to hide internal directories.