Documentation ¶
Index ¶
- Constants
- Variables
- type Key
- type Nodis
- func (n *Nodis) BLPop(key string, timeout time.Duration) []byte
- func (n *Nodis) BRPop(key string, timeout time.Duration) []byte
- func (n *Nodis) BitCount(key string, start, end int64) int64
- func (n *Nodis) Clear()
- func (n *Nodis) Close() error
- func (n *Nodis) Decr(key string) int64
- func (n *Nodis) Del(keys ...string) int64
- func (n *Nodis) Exists(keys ...string) int64
- func (n *Nodis) Expire(key string, seconds int64) int64
- func (n *Nodis) ExpireAt(key string, timestamp time.Time) int64
- func (n *Nodis) ExpireAtGT(key string, timestamp time.Time) int64
- func (n *Nodis) ExpireAtLT(key string, timestamp time.Time) int64
- func (n *Nodis) ExpireAtNX(key string, timestamp time.Time) int64
- func (n *Nodis) ExpireAtXX(key string, timestamp time.Time) int64
- func (n *Nodis) ExpireGT(key string, seconds int64) int64
- func (n *Nodis) ExpireLT(key string, seconds int64) int64
- func (n *Nodis) ExpireNX(key string, seconds int64) int64
- func (n *Nodis) ExpirePX(key string, milliseconds int64) int64
- func (n *Nodis) ExpireXX(key string, seconds int64) int64
- func (n *Nodis) Get(key string) []byte
- func (n *Nodis) GetBit(key string, offset int64) int64
- func (n *Nodis) GetEntry(key string) []byte
- func (n *Nodis) HClear(key string)
- func (n *Nodis) HDel(key string, fields ...string) int64
- func (n *Nodis) HExists(key string, field string) bool
- func (n *Nodis) HGet(key string, field string) []byte
- func (n *Nodis) HGetAll(key string) map[string][]byte
- func (n *Nodis) HIncrBy(key string, field string, value int64) int64
- func (n *Nodis) HIncrByFloat(key string, field string, value float64) float64
- func (n *Nodis) HKeys(key string) []string
- func (n *Nodis) HLen(key string) int64
- func (n *Nodis) HMGet(key string, fields ...string) [][]byte
- func (n *Nodis) HMSet(key string, fields map[string][]byte)
- func (n *Nodis) HScan(key string, cursor int64, match string, count int64) (int64, map[string][]byte)
- func (n *Nodis) HSet(key string, field string, value []byte)
- func (n *Nodis) HSetNX(key string, field string, value []byte) bool
- func (n *Nodis) HVals(key string) [][]byte
- func (n *Nodis) Incr(key string) int64
- func (n *Nodis) Keys(pattern string) []string
- func (n *Nodis) LIndex(key string, index int64) []byte
- func (n *Nodis) LInsert(key string, pivot, data []byte, before bool) int64
- func (n *Nodis) LLen(key string) int64
- func (n *Nodis) LPop(key string, count int64) [][]byte
- func (n *Nodis) LPopRPush(source, destination string) []byte
- func (n *Nodis) LPush(key string, values ...[]byte) int64
- func (n *Nodis) LPushX(key string, data []byte) int64
- func (n *Nodis) LRange(key string, start, stop int64) [][]byte
- func (n *Nodis) LRem(key string, count int64, data []byte) int64
- func (n *Nodis) LSet(key string, index int64, data []byte) bool
- func (n *Nodis) LTrim(key string, start, stop int64)
- func (n *Nodis) Patch(ops ...*pb.Op) error
- func (n *Nodis) Publish(addr string, pattern []string) error
- func (n *Nodis) RPop(key string, count int64) [][]byte
- func (n *Nodis) RPopLPush(source, destination string) []byte
- func (n *Nodis) RPush(key string, values ...[]byte) int64
- func (n *Nodis) RPushX(key string, data []byte) int64
- func (n *Nodis) Rename(key, key2 string) error
- func (n *Nodis) SAdd(key string, members ...string) int64
- func (n *Nodis) SCard(key string) int64
- func (n *Nodis) SDiff(keys ...string) []string
- func (n *Nodis) SInter(keys ...string) []string
- func (n *Nodis) SIsMember(key, member string) bool
- func (n *Nodis) SMembers(key string) []string
- func (n *Nodis) SPop(key string, count int64) []string
- func (n *Nodis) SRem(key string, members ...string) int64
- func (n *Nodis) SScan(key string, cursor int64, match string, count int64) (int64, []string)
- func (n *Nodis) Scan(cursor int64, match string, count int64) (int64, []string)
- func (n *Nodis) Serve(addr string) error
- func (n *Nodis) Set(key string, value []byte)
- func (n *Nodis) SetBit(key string, offset int64, value bool) int
- func (n *Nodis) SetEX(key string, value []byte, seconds int64)
- func (n *Nodis) SetEntry(data []byte) error
- func (n *Nodis) SetNX(key string, value []byte) bool
- func (n *Nodis) SetPX(key string, value []byte, milliseconds int64)
- func (n *Nodis) SetXX(key string, value []byte) bool
- func (n *Nodis) Snapshot(path string)
- func (n *Nodis) Subscribe(addr string) error
- func (n *Nodis) TTL(key string) time.Duration
- func (n *Nodis) Type(key string) string
- func (n *Nodis) UnWatch(id int)
- func (n *Nodis) Watch(pattern []string, fn func(op *pb.Operation)) int
- func (n *Nodis) ZAdd(key string, member string, score float64)
- func (n *Nodis) ZAddGT(key string, member string, score float64) int64
- func (n *Nodis) ZAddLT(key string, member string, score float64) int64
- func (n *Nodis) ZAddNX(key string, member string, score float64) int64
- func (n *Nodis) ZAddXX(key string, member string, score float64) int64
- func (n *Nodis) ZCard(key string) int64
- func (n *Nodis) ZClear(key string)
- func (n *Nodis) ZExists(key string, member string) bool
- func (n *Nodis) ZIncrBy(key string, member string, score float64) float64
- func (n *Nodis) ZRange(key string, start int64, stop int64) []string
- func (n *Nodis) ZRangeByScore(key string, min float64, max float64) []string
- func (n *Nodis) ZRangeByScoreWithScores(key string, min float64, max float64) []*zset.Item
- func (n *Nodis) ZRangeWithScores(key string, start int64, stop int64) []*zset.Item
- func (n *Nodis) ZRank(key string, member string) int64
- func (n *Nodis) ZRankWithScore(key string, member string) (int64, *zset.Item)
- func (n *Nodis) ZRem(key string, members ...string) int64
- func (n *Nodis) ZRemRangeByRank(key string, start int64, stop int64) int64
- func (n *Nodis) ZRemRangeByScore(key string, min float64, max float64) int64
- func (n *Nodis) ZRevRange(key string, start int64, stop int64) []string
- func (n *Nodis) ZRevRangeByScore(key string, min float64, max float64) []string
- func (n *Nodis) ZRevRangeByScoreWithScores(key string, min float64, max float64) []*zset.Item
- func (n *Nodis) ZRevRangeWithScores(key string, start int64, stop int64) []*zset.Item
- func (n *Nodis) ZRevRank(key string, member string) int64
- func (n *Nodis) ZRevRankWithScore(key string, member string) (int64, *zset.Item)
- func (n *Nodis) ZScore(key string, member string) float64
- type Options
Constants ¶
const ( FileSizeKB = 1024 FileSizeMB = 1024 * FileSizeKB FileSizeGB = 1024 * FileSizeMB )
Variables ¶
var DefaultOptions = &Options{ Path: "data", FileSize: FileSizeGB, TidyDuration: 60 * time.Second, LockPoolSize: 10240, }
var (
ErrCorruptedData = errors.New("corrupted data")
)
var (
ErrUnknownOperation = errors.New("unknown operation")
)
Functions ¶
This section is empty.
Types ¶
type Nodis ¶
func (*Nodis) ExpireAtGT ¶ added in v1.5.0
ExpireAtGT the keys only when the new expiry is greater than current one
func (*Nodis) ExpireAtLT ¶ added in v1.5.0
ExpireAtLT the keys only when the new expiry is less than current one
func (*Nodis) ExpireAtNX ¶ added in v1.5.0
ExpireAtNX the keys only when the key has no expiry
func (*Nodis) ExpireAtXX ¶ added in v1.5.0
ExpireAtXX the keys only when the key has an existing expiry
func (*Nodis) ExpireGT ¶ added in v1.5.0
ExpireGT the keys only when the new expiry is greater than current one
func (*Nodis) ExpireLT ¶ added in v1.5.0
ExpireLT the keys only when the new expiry is less than current one
func (*Nodis) HIncrByFloat ¶
func (*Nodis) SPop ¶ added in v1.5.0
SPop removes and returns a random element from the set value stored at key.
func (*Nodis) SetEX ¶ added in v1.5.0
SetEX set a key with specified expire time, in seconds (a positive integer).
func (*Nodis) SetPX ¶ added in v1.5.0
SetPX set a key with specified expire time, in milliseconds (a positive integer).
func (*Nodis) ZRangeByScore ¶
func (*Nodis) ZRangeByScoreWithScores ¶
func (*Nodis) ZRangeWithScores ¶
func (*Nodis) ZRankWithScore ¶ added in v1.5.0
func (*Nodis) ZRemRangeByRank ¶
func (*Nodis) ZRemRangeByScore ¶
func (*Nodis) ZRevRangeByScore ¶
func (*Nodis) ZRevRangeByScoreWithScores ¶
func (*Nodis) ZRevRangeWithScores ¶
func (*Nodis) ZRevRankWithScore ¶ added in v1.5.0
type Options ¶
type Options struct { // Path is the path to the database. Path string // TidyDuration is the interval which the database is flushing unused keys to disk. // This is useful for reducing the risk of data loss in the event of a crash. // It is also used for refreshing hot keys. TidyDuration time.Duration // FileSize is the size of each file. The default value is 1GB. FileSize int64 // SnapshotDuration is the interval at which the database is snapshotted. // Default 0 for disabling snapshot. and you can call Snapshot manually. SnapshotDuration time.Duration // Filesystem is the filesystem to use. The default is the memory filesystem. Filesystem fs.Fs // Synchronizer is the synchronizer to use. The default is nil and no synchronization is performed. Synchronizer sync.Synchronizer // LockPoolSize is the key locks pool size LockPoolSize int }
Options represents the configuration options for the database.