Documentation ¶
Index ¶
- Variables
- func DeRegisterNode(nid string) error
- func GetGameServerNodes() map[string]*nodes.Node
- func RegisterNode(nid string, node *nodes.Node) error
- type DCM
- type KvPair
- type KvPairs
- type RedisDCM
- func (r *RedisDCM) DelGameData(k string) error
- func (r *RedisDCM) DelUserData(uid int, k string) error
- func (r *RedisDCM) DelValue(k string) error
- func (r *RedisDCM) GetGameData(k string, v interface{}) error
- func (r *RedisDCM) GetPatternKeys(prefix string) []string
- func (r *RedisDCM) GetPrefixValue(k string) (*KvPairs, error)
- func (r *RedisDCM) GetUserData(uid int, k string, v interface{}) error
- func (r *RedisDCM) GetValue(k string) (*KvPair, error)
- func (r *RedisDCM) SetValue(k string, v []byte) error
- func (r *RedisDCM) StoreGameData(k string, v interface{}) error
- func (r *RedisDCM) StoreUserData(uid int, k string, v interface{}) error
- func (r *RedisDCM) WrapKey(k string) string
- type RedisDCMOpts
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 GetGameServerNodes ¶ added in v0.4.4
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 RedisDCM ¶
type RedisDCM struct {
// contains filtered or unexported fields
}
func NewRedisDCM ¶
func NewRedisDCM(opts ...RedisDCMOpts) *RedisDCM
func (*RedisDCM) DelGameData ¶
func (*RedisDCM) GetGameData ¶
func (*RedisDCM) GetPatternKeys ¶
func (*RedisDCM) GetUserData ¶
func (*RedisDCM) StoreGameData ¶
func (*RedisDCM) StoreUserData ¶
type RedisDCMOpts ¶
type RedisDCMOpts func(r *RedisDCM)
func WithAddrs ¶
func WithAddrs(addrs []string) RedisDCMOpts
func WithPrefix ¶
func WithPrefix(prefix string) RedisDCMOpts
Click to show internal directories.
Click to hide internal directories.