Documentation ¶
Index ¶
- type Redis
- func (e *Redis) CheckIfNotTask(keys *goredis.ScanIterator) bool
- func (e *Redis) Connect() bool
- func (e *Redis) CountRedisKey(pattern string, ignoreState string) int
- func (e *Redis) CountRedisKeyState(pattern string, state string) int
- func (e *Redis) DelRedisKey(key string) int64
- func (e *Redis) GetAllRedisKeys(pattern string) *goredis.ScanIterator
- func (e *Redis) GetRedisKey(key string) string
- func (e *Redis) GetTaskFromEvent(update *mesosproto.Event_Update) *cfg.Command
- func (e *Redis) GetTaskFromTaskID(taskID string) *cfg.Command
- func (e *Redis) PingRedis() error
- func (e *Redis) SaveConfig(config cfg.Config)
- func (e *Redis) SaveFrameworkRedis(framework *cfg.FrameworkConfig)
- func (e *Redis) SaveTaskRedis(cmd *cfg.Command)
- func (e *Redis) SetRedisKey(data []byte, key string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct { Client *goredis.Client CTX context.Context Server string Password string DB int Prefix string Mesos mesos.Mesos }
Redis struct about the redis connection
func New ¶
func New(cfg *cfg.Config, frm *cfg.FrameworkConfig) *Redis
New will create a new Redis object
func (*Redis) CheckIfNotTask ¶
func (e *Redis) CheckIfNotTask(keys *goredis.ScanIterator) bool
CheckIfNotTask check if the redis key is a mesos task
func (*Redis) CountRedisKey ¶
CountRedisKey will get back the count of the redis key
func (*Redis) CountRedisKeyState ¶ added in v1.1.0
CountRedisKeyState will get back the amount of redis keys with the spesific state.
func (*Redis) DelRedisKey ¶
DelRedisKey will delete a redis key
func (*Redis) GetAllRedisKeys ¶
func (e *Redis) GetAllRedisKeys(pattern string) *goredis.ScanIterator
GetAllRedisKeys get out all redis keys to a patter
func (*Redis) GetRedisKey ¶
GetRedisKey get out the data of a key
func (*Redis) GetTaskFromEvent ¶
func (e *Redis) GetTaskFromEvent(update *mesosproto.Event_Update) *cfg.Command
GetTaskFromEvent get out the key by a mesos event
func (*Redis) GetTaskFromTaskID ¶ added in v1.1.2
GeTaskFromTaskID get out the task by a taskID
func (*Redis) SaveConfig ¶
SaveConfig store the current framework config
func (*Redis) SaveFrameworkRedis ¶
func (e *Redis) SaveFrameworkRedis(framework *cfg.FrameworkConfig)
SaveFrameworkRedis store mesos framework in DB
func (*Redis) SaveTaskRedis ¶
SaveTaskRedis store mesos task in DB
func (*Redis) SetRedisKey ¶
SetRedisKey store data in redis