state

package
v0.0.0-...-655ee65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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

func (*MemoryManager) Get

func (m *MemoryManager) Get(context context.Context, key string, destination interface{}) error

Get retrives the data associated with a key

func (*MemoryManager) Set

func (m *MemoryManager) Set(context context.Context, key string, data interface{}, ttl int) error

Set updates the data associated with a key

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

func (*RedisManager) Get

func (m *RedisManager) Get(context context.Context, key string, destination interface{}) error

Get retrives the data associated with a key

func (*RedisManager) Set

func (m *RedisManager) Set(context context.Context, key string, data interface{}, ttl int) error

Set updates the data associated with a key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL