Documentation ¶
Index ¶
- Constants
- Variables
- type Entity
- 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) Clear()
- func (n *Nodis) Close() error
- func (n *Nodis) Del(key string)
- func (n *Nodis) Exists(key string) bool
- func (n *Nodis) Expire(key string, seconds int64)
- func (n *Nodis) ExpireAt(key string, timestamp time.Time)
- func (n *Nodis) Get(key string) []byte
- func (n *Nodis) HClear(key string)
- func (n *Nodis) HDel(key string, field string)
- 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) int
- 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 int, match string, count int) (int, 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) Keys(pattern string) []string
- func (n *Nodis) LIndex(key string, index int) []byte
- func (n *Nodis) LInsert(key string, pivot, data []byte, before bool) int
- func (n *Nodis) LLen(key string) int
- func (n *Nodis) LPop(key string) []byte
- func (n *Nodis) LPopRPush(source, destination string) []byte
- func (n *Nodis) LPush(key string, values ...[]byte)
- func (n *Nodis) LPushX(key string, data []byte) int
- func (n *Nodis) LRange(key string, start, stop int) [][]byte
- func (n *Nodis) LRem(key string, count int, data []byte) int
- func (n *Nodis) LSet(key string, index int, data []byte) bool
- func (n *Nodis) LTrim(key string, start, stop int)
- func (n *Nodis) RPop(key string) []byte
- func (n *Nodis) RPopLPush(source, destination string) []byte
- func (n *Nodis) RPush(key string, values ...[]byte)
- func (n *Nodis) RPushX(key string, data []byte) int
- func (n *Nodis) Recycle()
- func (n *Nodis) Rename(key, key2 string) error
- func (n *Nodis) SAdd(key string, members ...string) int
- func (n *Nodis) SCard(key string) int
- func (n *Nodis) SDiff(key string, sets ...string) []string
- func (n *Nodis) SInter(key string, sets ...string) []string
- func (n *Nodis) SIsMember(key, member string) bool
- func (n *Nodis) SMembers(key string) []string
- func (n *Nodis) Scan(cursor int, match string, count int) (int, []string)
- func (n *Nodis) Set(key string, value []byte, ttl int64)
- func (n *Nodis) Snapshot(path string)
- func (n *Nodis) TTL(key string) time.Duration
- func (n *Nodis) Type(key string) string
- func (n *Nodis) ZAdd(key string, member string, score float64)
- 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) 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) ZScore(key string, member string) float64
- type Options
Constants ¶
View Source
const ( FileSizeKB = 1024 FileSizeMB = 1024 * FileSizeKB FileSizeGB = 1024 * FileSizeMB )
Variables ¶
View Source
var DefaultOptions = &Options{ Path: "data", FileSize: FileSizeGB, RecycleDuration: 60 * time.Second, }
View Source
var (
ErrCorruptedData = errors.New("corrupted data")
)
Functions ¶
This section is empty.
Types ¶
type Entity ¶ added in v1.1.0
type Entity struct { Key string Value ds.DataStruct ExpiredAt int64 }
type Nodis ¶
func (*Nodis) HIncrByFloat ¶
func (*Nodis) Recycle ¶ added in v1.0.8
func (n *Nodis) Recycle()
Recycle removes expired and unused keys
func (*Nodis) ZRangeByScore ¶
func (*Nodis) ZRangeByScoreWithScores ¶
func (*Nodis) ZRangeWithScores ¶
func (*Nodis) ZRemRangeByRank ¶
func (*Nodis) ZRemRangeByScore ¶
func (*Nodis) ZRevRangeByScore ¶
func (*Nodis) ZRevRangeByScoreWithScores ¶
func (*Nodis) ZRevRangeWithScores ¶
type Options ¶
type Options struct { // Path is the path to the database. Path string // RecycleDuration is the interval at which the database is recycled . // This is useful for reducing the risk of data loss in the event of a crash. // It is also used for refreshing hot keys. RecycleDuration 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 }
Options represents the configuration options for the database.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.