Documentation
¶
Overview ¶
Package redistypes provides Redis data types in Go. It a very thin layer on top of https://github.com/garyburd/redigo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Type ¶
type Type interface { // Name returns the name of the key in Redis. Name() string // Delete implements the Redis command DEL. If a key exists in Redis, it is // deleted and true is returned. If it does not exist, false is returned. // // See https://redis.io/commands/del. Delete() (bool, error) // Exists implements the Redis command EXISTS. It determines if the key exists in // Redis. Exists returns true if it exists or false if it does not. // // See https://redis.io/commands/exists. Exists() (bool, error) // Expire implements the Redis command EXPIRE. It sets a timeout (given in seconds) // on the key, after which the key is deleted automatically. To remove the timeout, // call the Persist method. For more information about timeouts, see the // documentation. // // Expire uses the Redis command EXPIRE, which has second precision. If timeout // has more precision than that, an error is returned to avoid ambiguity in rounding. // For a more precise version of Expire, see PExpire. // // Expire returns true if the key exists and the timeout was set, or false otherwise. // // See https://redis.io/commands/expire. Expire(timeout time.Duration) (bool, error) // PExpire implements the Redis command PEXPIRE. It sets a timeout (given in // milliseconds) on the key, after which the key is deleted automatically. To // remove the timeout, call the Persist method. For more information about timeouts, // see the documentation. // // PExpire uses the Redis command PEXPIRE, which has millisecond precision. If timeout // has more precision than that, an error is returned to avoid ambiguity in rounding. // For a less precise version of PExpire, see Expire. // // PExpire returns true if the key exists and the timeout was set, or false otherwise. // // See https://redis.io/commands/pexpire. PExpire(timeout time.Duration) (bool, error) // Persist implements the Redis command PERSIST. It causes a volatile key to persist. // // See https://redis.io/commands/persist. Persist() (bool, error) // Rename renames the key to newkey, both in the Type and in Redis. If // newkey already exists in Redis, it is overwritten. // // See https://redis.io/commands/rename. Rename(newkey string) error // RenameNX renames the key to newkey, both in the Type and in Redis. If // the key was renamed successfully, true is returned. If newkey already exists // in Redis, false is returned. // // See https://redis.io/commands/renamenx. RenameNX(newkey string) (bool, error) }
Type is an interface containing methods that every Redis type supports. These methods operate on keys in Redis with name equal to Name(), and they do not depend on the type of value stored in the key.
Directories
¶
Path | Synopsis |
---|---|
Package hyperloglog contains a Go implementation of the HyperLogLog data structure in Redis.
|
Package hyperloglog contains a Go implementation of the HyperLogLog data structure in Redis. |
Package internal contains internal functions used by redistypes.
|
Package internal contains internal functions used by redistypes. |
test
Package test contains functions used for testing in redistypes.
|
Package test contains functions used for testing in redistypes. |
Package list contains a Go implementation of the list data structure in Redis.
|
Package list contains a Go implementation of the list data structure in Redis. |
Click to show internal directories.
Click to hide internal directories.