Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorKeyValuePairs = errors.New("invalid key value pairs")
)
Functions ¶
This section is empty.
Types ¶
type DBOption ¶
type DBOption func(d *Option)
func DefaultLimit ¶
DefaultLimit specify default limit of children pagination for DB.
func KeyPathSep ¶
KeyPathSep specify separater of key path for DB, default is ".".
type DeleteOption ¶
type DeleteOption func(d *Deleter)
func DeleteChildren ¶
func DeleteChildren() DeleteOption
DeleteChildren specify to delete children for `Delete()` or `DeleteMulti()`.
type GetOption ¶
type GetOption func(g *Getter)
func GetChildren ¶
GetChildren specify to get children and set children pagination for `Get()` or `GetMulti()`. Start is the start key of children, could be full key or bare key, if using for `GetMulti()` to get children of every key, should use bare key for start. Limit is the maximum count of children of every key.
type KVDB ¶
type KVDB interface { // Get get node of key, which include value and optional children key value // pairs with pagination. Get(key string, opts ...GetOption) (*Node, error) // GetMulti get node map of keys, which include value and optional children // key value pairs with pagination of every key. GetMulti(keys []string, opts ...GetOption) (map[string]Node, error) // Set set value for key with options, which you can specify expire time of // key. Set(key, value string, opts ...SetOption) error // SetMulti set key value pairs with options, which you can specify expire // time of keys. // For example, SetMulti([]string{"a", 1, "b", 2}) means set value 1 for key // a and set value 2 for key b. SetMulti(kvPairs []string, opts ...SetOption) error // Delete delete key with options, which you can specify also delete // children of this key. // Delete would not effect on any other keys, for example, if you delete the // key without any option, you can still use it's child keys or parent key. Delete(key string, opts ...DeleteOption) error // DeleteMulti delete keys with options, which you can specify also delete // children of these keys. // DeleteMulti would not effect on any other keys, for example, if you // delete the key without any option, you can still use it's child keys or // parent key. DeleteMulti(keys []string, opts ...DeleteOption) error // Exist check if key is exist. Exist(key string) (bool, error) // Cleanup delete all expired keys from DB. Cleanup() error // Close close DB. should only execute once and cannot use after close. Close() error }
Click to show internal directories.
Click to hide internal directories.