Documentation
¶
Index ¶
- type InMemoryStore
- func (c *InMemoryStore) Get(_ context.Context, key string) (interface{}, time.Duration, error)
- func (c *InMemoryStore) Increment(_ context.Context, key string) (int64, time.Duration, error)
- func (c *InMemoryStore) Remove(_ context.Context, key string) error
- func (c *InMemoryStore) Set(_ context.Context, key string, value interface{}) error
- type RedisClient
- type RedisStore
- func (c *RedisStore) Get(ctx context.Context, key string) (interface{}, time.Duration, error)
- func (c *RedisStore) Increment(ctx context.Context, key string) (int64, time.Duration, error)
- func (c *RedisStore) Remove(ctx context.Context, key string) error
- func (c *RedisStore) Set(ctx context.Context, key string, value interface{}) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryStore ¶
type InMemoryStore struct {
// contains filtered or unexported fields
}
type RedisClient ¶
type RedisClient interface {
Ping(ctx context.Context) *redis.StatusCmd
Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
Get(ctx context.Context, key string) *redis.StringCmd
TTL(ctx context.Context, key string) *redis.DurationCmd
Del(ctx context.Context, keys ...string) *redis.IntCmd
Incr(ctx context.Context, key string) *redis.IntCmd
Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
}
func NewRedisClient ¶
func NewRedisClient(addr string, clusterMode bool) RedisClient
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
type Store ¶
type Store interface {
Set(ctx context.Context, key string, value interface{}) error
Get(ctx context.Context, key string) (interface{}, time.Duration, error)
Increment(ctx context.Context, key string) (int64, time.Duration, error)
Remove(ctx context.Context, key string) error
}
func NewInMemoryStore ¶
Click to show internal directories.
Click to hide internal directories.