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

package kvdb

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

Index

Package Files

kvdb.go

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

Directories

PathSynopsis
backend/kvdb_mongodb
backend/kvdbredis
types

Package kvdb imports 10 packages (graph) and is imported by 2 packages. Updated 2017-11-18. Refresh now. Tools for package owners.