goworld: github.com/xiaonanln/goworld/engine/kvdb Index | Files | Directories

package kvdb

import "github.com/xiaonanln/goworld/engine/kvdb"


Package Files


func Get Uses

func Get(key string, callback KVDBGetCallback)

Get gets value of key from KVDB, returns in callback

func GetOrPut Uses

func GetOrPut(key string, val string, callback KVDBGetOrPutCallback)

GetOrPut gets value of key from KVDB, if val not exists or is "", put key-value to KVDB.

func GetRange Uses

func GetRange(beginKey string, endKey string, callback KVDBGetRangeCallback)

GetRange retrives key-value items of specified key range, returns in callback

func Initialize Uses

func Initialize()

Initialize the KVDB

Called by game server engine

func NextLargerKey Uses

func NextLargerKey(key string) string

NextLargerKey finds the next key that is larger than the specified key, but smaller than any other keys that is larger than the specified key

func Put Uses

func Put(key string, val string, callback KVDBPutCallback)

Put puts key-value item to KVDB, returns in callback

type KVDBGetCallback Uses

type KVDBGetCallback func(val string, err error)

KVDBGetCallback is type of KVDB Get callback

type KVDBGetOrPutCallback Uses

type KVDBGetOrPutCallback func(oldVal string, err error)

KVDBGetOrPutCallback is type of KVDB GetOrPut callback

type KVDBGetRangeCallback Uses

type KVDBGetRangeCallback func(items []kvdbtypes.KVItem, err error)

KVDBGetRangeCallback is type of KVDB GetRange callback

type KVDBPutCallback Uses

type KVDBPutCallback func(err error)

KVDBPutCallback is type of KVDB Get callback



Package kvdb imports 11 packages (graph) and is imported by 5 packages. Updated 2018-04-20. Refresh now. Tools for package owners.