Documentation
¶
Index ¶
- type Cache
- type CacheMock
- func (c CacheMock) Count(ctx context.Context, key string) (int64, error)
- func (c CacheMock) Del(ctxt context.Context, keys ...string) (int64, error)
- func (c CacheMock) Exists(ctx context.Context, keys ...string) (int64, error)
- func (c CacheMock) Get(ctxt context.Context, key string) (string, error)
- func (c CacheMock) HDel(ctx context.Context, key string, fields ...string) (int64, error)
- func (c CacheMock) HGet(ctx context.Context, key, field string) (string, error)
- func (c CacheMock) HGetAll(ctx context.Context, key string) (map[string]string, error)
- func (c CacheMock) HSet(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (c CacheMock) LPop(ctx context.Context, key string) (string, error)
- func (c CacheMock) Ping(ctxt context.Context) error
- func (c CacheMock) Pop(ctx context.Context, key string) (string, error)
- func (c CacheMock) Push(ctx context.Context, key string, values ...interface{}) error
- func (c CacheMock) RPush(ctx context.Context, key string, fields ...string) (int64, error)
- func (c CacheMock) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)
- type Credential
- type Pool
- type Properties
- type RedisCache
- func (r *RedisCache) Count(ctx context.Context, key string) (int64, error)
- func (r *RedisCache) Del(ctxt context.Context, keys ...string) (int64, error)
- func (r *RedisCache) Exists(ctx context.Context, keys ...string) (int64, error)
- func (r *RedisCache) Get(ctxt context.Context, key string) (string, error)
- func (r *RedisCache) HDel(ctx context.Context, key string, fields ...string) (int64, error)
- func (r *RedisCache) HGet(ctx context.Context, key, field string) (string, error)
- func (r *RedisCache) HGetAll(ctx context.Context, key string) (map[string]string, error)
- func (r *RedisCache) HSet(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (r *RedisCache) InsertHead(ctx context.Context, key string, values ...interface{}) error
- func (r *RedisCache) LPop(ctx context.Context, key string) (string, error)
- func (r *RedisCache) Lock(ctx context.Context, source, owner string, timeout time.Duration) (bool, error)
- func (r *RedisCache) Ping(ctxt context.Context) error
- func (r *RedisCache) Pop(ctx context.Context, key string) (string, error)
- func (r *RedisCache) Push(ctx context.Context, key string, values ...interface{}) error
- func (r *RedisCache) RPush(ctx context.Context, key string, fields ...string) (int64, error)
- func (r *RedisCache) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)
- func (r *RedisCache) Unlock(ctx context.Context, source, owner string) (bool, error)
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Ping(ctxt context.Context) error
Push(ctx context.Context, key string, values ...interface{}) error
Pop(ctx context.Context, key string) (string, error)
Count(ctx context.Context, key string) (int64, error)
Del(ctxt context.Context, keys ...string) (int64, error)
Exists(ctx context.Context, keys ...string) (int64, error)
Get(ctxt context.Context, key string) (string, error)
Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)
HDel(ctx context.Context, key string, fields ...string) (int64, error)
HGet(ctx context.Context, key, field string) (string, error)
HGetAll(ctx context.Context, key string) (map[string]string, error)
HSet(ctx context.Context, key string, values ...interface{}) (int64, error)
LPop(ctx context.Context, key string) (string, error)
RPush(ctx context.Context, key string, fields ...string) (int64, error)
}
type CacheMock ¶
type CacheMock struct {
}
type Credential ¶
type Pool ¶
type Pool struct {
Size int `json:"size" yaml:"size" default:"60"`
MaxRetries int `json:"max_retries" yaml:"max_retries" default:"3"`
MinIdleConnections int `json:"min_idle_connections" yaml:"min_idle_connections" default:"10"`
MaxIdleConnections int `json:"max_idle_connections" yaml:"max_idle_connections" default:"20"`
MaxActiveConnections int `json:"max_active_connections" yaml:"max_active_connections" default:"30"`
MaxConnectionIdleTime time.Duration `json:"max_connection_idle_time" yaml:"max_connection_idle_time" default:"1h"`
MaxConnectionLifeTime time.Duration `json:"max_connection_life_time" yaml:"max_connection_life_time" default:"10h"`
}
type Properties ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedis ¶
func NewRedis(ctxt context.Context, cfg *Properties) (*RedisCache, *national.Message)
func (*RedisCache) InsertHead ¶
func (r *RedisCache) InsertHead(ctx context.Context, key string, values ...interface{}) error
func (*RedisCache) Push ¶
func (r *RedisCache) Push(ctx context.Context, key string, values ...interface{}) error
Click to show internal directories.
Click to hide internal directories.