Documentation
¶
Index ¶
- Constants
- type ChannelMessage
- type RedisFarm
- type RedisStore
- func (rs *RedisStore) Close()
- func (rs *RedisStore) Connect() error
- func (rs *RedisStore) DB() int
- func (rs *RedisStore) Do(cmd string, args ...string) error
- func (rs *RedisStore) Exists(key string) (bool, error)
- func (rs *RedisStore) Get(key string, val interface{}) error
- func (rs *RedisStore) GetObject(key string, result interface{}) error
- func (rs *RedisStore) HGet(key, field string) (string, error)
- func (rs *RedisStore) Keys(pattern string, result *[]string) error
- func (rs *RedisStore) LLen(key string) (int, error)
- func (rs *RedisStore) ListLen(key string) (int, error)
- func (rs *RedisStore) ListRange(key string, from, to int) ([]string, error)
- func (rs *RedisStore) Lpush(key string, element string) error
- func (rs *RedisStore) Lrem(key, element string, cnt int) error
- func (rs *RedisStore) MGet(keys []string, val *[]string) error
- func (rs *RedisStore) Publish(code string) (bool, error)
- func (rs *RedisStore) PublishEx(channel string, msg string) (bool, error)
- func (rs *RedisStore) Rpush(key string, element string) error
- func (rs *RedisStore) Scan(pattern string, result *[]string) error
- func (rs *RedisStore) Set(key string, val string) error
- func (rs *RedisStore) Subscribe(tag string, dst chan ChannelMessage, channels ...string) error
- type StoreFarmer
- type Storer
Constants ¶
View Source
const RedisPUBSUBPrefix string = "CMND"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelMessage ¶
type ChannelMessage struct {
Tag string
DB int
radix.PubSubMessage
}
type RedisFarm ¶
type RedisFarm struct {
// contains filtered or unexported fields
}
RedisFarm holds collection of RedisStore identified by code.
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore wrapps redis client implementation and provides high-level API to deal with redis storage.
It's important: redis database is used as intraday data storage. Database cleans automatically by another side every next day.
func NewRedisStore ¶
func NewRedisStore(connection string, db int, zl *zerolog.Logger) *RedisStore
NewRedisStore returns instance to RedisStore.
func (*RedisStore) Close ¶
func (rs *RedisStore) Close()
func (*RedisStore) Connect ¶
func (rs *RedisStore) Connect() error
func (*RedisStore) DB ¶
func (rs *RedisStore) DB() int
func (*RedisStore) Exists ¶
func (rs *RedisStore) Exists(key string) (bool, error)
Exists returns true if key exists.
func (*RedisStore) Get ¶
func (rs *RedisStore) Get(key string, val interface{}) error
func (*RedisStore) GetObject ¶
func (rs *RedisStore) GetObject(key string, result interface{}) error
func (*RedisStore) ListRange ¶
func (rs *RedisStore) ListRange(key string, from, to int) ([]string, error)
func (*RedisStore) PublishEx ¶
func (rs *RedisStore) PublishEx(channel string, msg string) (bool, error)
func (*RedisStore) Scan ¶
func (rs *RedisStore) Scan(pattern string, result *[]string) error
Scan returns all instance names startings with "pattern".
func (*RedisStore) Subscribe ¶
func (rs *RedisStore) Subscribe(tag string, dst chan ChannelMessage, channels ...string) error
type StoreFarmer ¶
type Storer ¶
type Storer interface {
Scan(pattern string, result *[]string) error
Keys(pattern string, result *[]string) error
Get(key string, val interface{}) error
MGet(keys []string, result *[]string) error
Set(key string, val string) error
Publish(code string) (bool, error)
PublishEx(chanel string, msg string) (bool, error)
ListLen(key string) (int, error)
LLen(key string) (int, error)
ListRange(key string, from, to int) ([]string, error)
GetObject(key string, result interface{}) error
HGet(key, field string) (string, error)
DB() int
Close()
Subscribe(tag string, dst chan ChannelMessage, channels ...string) error
Lpush(key string, element string) error
Rpush(key string, element string) error
Do(cmd string, args ...string) error
Lrem(key, element string, cnt int) error
Connect() error
Exists(key string) (bool, error)
}
Storer is and interface definition to data persistent storage.
Click to show internal directories.
Click to hide internal directories.