dcm

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPrefix      = "DCM:"
	StoreUserKeyprefix = "store_user_"
	StoreGameKeyprefix = "store_game_"
)
View Source
var (
	DefaultDCMAddrs = []string{"127.0.0.1:6379"}
)

Functions

func DeRegisterNode

func DeRegisterNode(nid string) error

func GetGameServerNodes added in v0.4.4

func GetGameServerNodes() map[string]*nodes.Node

func RegisterNode

func RegisterNode(nid string, node *nodes.Node) error

Types

type DCM

type DCM interface {
	SetValue(k string, v []byte) error
	GetValue(k string) (*KvPair, error)
	DelValue(k string) error
	GetPrefixValue(k string) (*KvPairs, error)
	StoreUserData(uid int, k string, v interface{}) error
	GetUserData(uid int, k string, v interface{}) error
	DelUserData(uid int, k string) error
	StoreGameData(k string, v interface{}) error
	GetGameData(k string, v interface{}) error
	DelGameData(k string) error
}
var (
	DCManager DCM
)

type KvPair

type KvPair struct {
	Key   string
	Value []byte
}

type KvPairs

type KvPairs struct {
	Pairs []*KvPair
}

type RedisDCM

type RedisDCM struct {
	// contains filtered or unexported fields
}

func NewRedisDCM

func NewRedisDCM(opts ...RedisDCMOpts) *RedisDCM

func (*RedisDCM) DelGameData

func (r *RedisDCM) DelGameData(k string) error

func (*RedisDCM) DelUserData

func (r *RedisDCM) DelUserData(uid int, k string) error

func (*RedisDCM) DelValue

func (r *RedisDCM) DelValue(k string) error

func (*RedisDCM) GetGameData

func (r *RedisDCM) GetGameData(k string, v interface{}) error

func (*RedisDCM) GetPatternKeys

func (r *RedisDCM) GetPatternKeys(prefix string) []string

func (*RedisDCM) GetPrefixValue

func (r *RedisDCM) GetPrefixValue(k string) (*KvPairs, error)

func (*RedisDCM) GetUserData

func (r *RedisDCM) GetUserData(uid int, k string, v interface{}) error

func (*RedisDCM) GetValue

func (r *RedisDCM) GetValue(k string) (*KvPair, error)

func (*RedisDCM) SetValue

func (r *RedisDCM) SetValue(k string, v []byte) error

func (*RedisDCM) StoreGameData

func (r *RedisDCM) StoreGameData(k string, v interface{}) error

func (*RedisDCM) StoreUserData

func (r *RedisDCM) StoreUserData(uid int, k string, v interface{}) error

func (*RedisDCM) WrapKey

func (r *RedisDCM) WrapKey(k string) string

type RedisDCMOpts

type RedisDCMOpts func(r *RedisDCM)

func WithAddrs

func WithAddrs(addrs []string) RedisDCMOpts

func WithPrefix

func WithPrefix(prefix string) RedisDCMOpts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL