Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultApplication = "Default-Application" KeyRedisDefault = "dbkvconfiglistener" )
Const Default Config
View Source
const ( ConfigNotFoundMsg = "ConfigNotFound" UpdateTooFast = "UpdateConfigIsTooFast" OnlyInsertNewConfig = "OnlyInsertNewConfig" )
Const For Error
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBKVCfg ¶
type DBKVCfg struct {
// contains filtered or unexported fields
}
DBKVCfg struct library DBKV Config
func NewDBKVConfig ¶
func NewDBKVConfig(listKey []KeyValueInit, master, slave *sqlx.DB, redisPool *redis.Pool, opts ...OptionsCfg) (*DBKVCfg, error)
NewDBKVConfig Init Library support slave master DB
func (*DBKVCfg) InsertConfig ¶
InsertConfig insert new config value without publish message
func (*DBKVCfg) UpdateConfig ¶
UpdateConfig validating first after that update on DB and set to redis
type KeyValueInit ¶
type KeyValueInit struct { KeyConfig string DefaultValue interface{} }
KeyValueInit from User User must set default value ex. for int using 0 or string using "" If config with struct must using struct json with pointer
Source Files ¶
Click to show internal directories.
Click to hide internal directories.