Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFoundEntry = errors.New("not found entry") ErrInvalidEntry = errors.New("invalid entry") ErrNotMatchTypeMessage = errors.New("not match type message") ErrNotMatchTypeMessageStatus = errors.New("not match type message status") ErrNotMatchTypeSubscription = errors.New("not match type subscription") ErrNotMatchTypeTopic = errors.New("not match type topic") ErrNotSupportOperation = errors.New("not support operation") ErrNotSupportDriver = errors.New("not support driver") )
datastore errors
Functions ¶
func SpecifyDump ¶
SpecifyDump return Dump entries, each Datastore type
Types ¶
type Config ¶
type Config struct { Redis *RedisConfig `yaml:"redis"` MySQL *MySQLConfig `yaml:"mysql"` }
Config is specific datastore config, written under "datastore"
var GlobalConfig *Config
GlobalConfig keep config TODO: abort global variables
type Datastore ¶
type Datastore interface { Set(key, value interface{}) error Get(key interface{}) (interface{}, error) Delete(key interface{}) error Dump() (map[interface{}]interface{}, error) }
Datastore is behavior like Key-Value store
func LoadDatastore ¶
LoadDatastore load backend datastore from cnofiguration json file.
type Memory ¶
type Memory struct { Store map[interface{}]interface{} // contains filtered or unexported fields }
Memory is datastore driver for "in memory"
type MySQL ¶
MySQL is MySQL datastore driver
func (*MySQL) DumpPrefix ¶
DumpPrefix return stored items when match prefix key
type MySQLConfig ¶
type MySQLConfig struct { Addr string `yaml:"addr"` Host string `yaml:"host"` Port int `yaml:"port"` User string `yaml:"user"` Password string `yaml:"password"` }
MySQLConfig represent config for the MySQL
Click to show internal directories.
Click to hide internal directories.