Documentation ¶
Index ¶
- type ManagerInterface
- type MemoryManager
- func (m *MemoryManager) Close(context context.Context) error
- func (m *MemoryManager) Connect(context context.Context) error
- func (m *MemoryManager) Delete(context context.Context, key string) error
- func (m *MemoryManager) Get(context context.Context, key string, destination interface{}) error
- func (m *MemoryManager) Set(context context.Context, key string, data interface{}, ttl int) error
- type RedisManager
- func (m *RedisManager) Close(context context.Context) error
- func (m *RedisManager) Connect(context context.Context) error
- func (m *RedisManager) Delete(context context.Context, key string) error
- func (m *RedisManager) Get(context context.Context, key string, destination interface{}) error
- func (m *RedisManager) Set(context context.Context, key string, data interface{}, ttl int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManagerInterface ¶
type ManagerInterface interface { Connect(context context.Context) error Close(context context.Context) error Set(context context.Context, key string, req interface{}, ttl int) error Get(context context.Context, key string, destination interface{}) error Delete(context context.Context, key string) error }
ManagerInterface describes a state manager object
type MemoryManager ¶
type MemoryManager struct {
// contains filtered or unexported fields
}
MemoryManager is the Memory state manager
func NewMemoryManager ¶
func NewMemoryManager() *MemoryManager
NewMemoryManager returns a new Memory Manager objecft
func (*MemoryManager) Close ¶
func (m *MemoryManager) Close(context context.Context) error
Close disconnects from the memory
func (*MemoryManager) Connect ¶
func (m *MemoryManager) Connect(context context.Context) error
Connect connects to the memory
func (*MemoryManager) Delete ¶
func (m *MemoryManager) Delete(context context.Context, key string) error
Delete deletes a key and its associated data
type RedisManager ¶
type RedisManager struct {
// contains filtered or unexported fields
}
RedisManager is the Redis state manager
func NewRedisManager ¶
func NewRedisManager(redisAddress, redisPassword string, redisDb int) *RedisManager
NewRedisManager returns a new Redis Manager objecft
func (*RedisManager) Close ¶
func (m *RedisManager) Close(context context.Context) error
Close disconnects from Redis
func (*RedisManager) Connect ¶
func (m *RedisManager) Connect(context context.Context) error
Connect connects to Redis
func (*RedisManager) Delete ¶
func (m *RedisManager) Delete(context context.Context, key string) error
Delete deletes a key and its associated data
Click to show internal directories.
Click to hide internal directories.