Documentation
¶
Index ¶
- Constants
- type CacheClient
- type KeyValueDBClient
- type KeyValueStore
- type RedisClient
- func (r RedisClient) AppendToList(key string, expiration time.Duration, values ...any) error
- func (r RedisClient) Delete(key string) error
- func (r RedisClient) Exists(name string) (bool, error)
- func (r RedisClient) Expire(key string, expiration time.Duration) error
- func (r RedisClient) Get(key string) (string, error)
- func (r RedisClient) GetList(key string) ([]string, error)
- func (r RedisClient) Keys() ([]string, error)
- func (r RedisClient) RemoveFromList(key string, values ...any) error
- func (r RedisClient) Set(key string, value any, expiration time.Duration) error
- type StorageError
Constants ¶
View Source
const DEFAULT_EXPIRATION_TIME = 5 * time.Minute
View Source
const Nil = StorageError("toggles: Flag not found") // nolint:errname
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheClient ¶
type CacheClient interface { KeyValueStore Set(key string, value any, expiration time.Duration) error Expire(key string, expiration time.Duration) error GetList(key string) ([]string, error) AppendToList(key string, expiration time.Duration, values ...any) error RemoveFromList(key string, values ...any) error }
func NewRedisClient ¶
func NewRedisClient(host string, port uint) CacheClient
type KeyValueDBClient ¶
type KeyValueDBClient interface { KeyValueStore Set(key string, value any) error }
type KeyValueStore ¶
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
func (RedisClient) AppendToList ¶
func (RedisClient) Delete ¶
func (r RedisClient) Delete(key string) error
func (RedisClient) Keys ¶
func (r RedisClient) Keys() ([]string, error)
func (RedisClient) RemoveFromList ¶
func (r RedisClient) RemoveFromList(key string, values ...any) error
type StorageError ¶
type StorageError string
////////// Errors //////////
func (StorageError) Error ¶
func (e StorageError) Error() string
Click to show internal directories.
Click to hide internal directories.