state

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented error = fmt.Errorf("not Implemented")

Functions

func AddStateStore added in v0.4.2

func AddStateStore(name string, stateStore StateStore)

func StateStores added in v0.4.2

func StateStores() map[string]StateStore

Types

type BigCacheStateStore

type BigCacheStateStore struct {
	StateStore
	// contains filtered or unexported fields
}

func (*BigCacheStateStore) Delete

func (b *BigCacheStateStore) Delete(ctx context.Context, key string) error

func (*BigCacheStateStore) Get

func (b *BigCacheStateStore) Get(ctx context.Context, key string) ([]byte, error)

func (*BigCacheStateStore) Keys

func (b *BigCacheStateStore) Keys(ctx context.Context, limit int) ([]string, error)

func (*BigCacheStateStore) Put

func (b *BigCacheStateStore) Put(ctx context.Context, key string, val []byte) error

func (*BigCacheStateStore) PutWithExpireTime

func (b *BigCacheStateStore) PutWithExpireTime(ctx context.Context, key string, val []byte, expireSeconds int) error

type FreeCacheStateStore

type FreeCacheStateStore struct {
	StateStore
	// contains filtered or unexported fields
}

func (*FreeCacheStateStore) Delete

func (f *FreeCacheStateStore) Delete(ctx context.Context, key string) error

func (*FreeCacheStateStore) Get

func (f *FreeCacheStateStore) Get(ctx context.Context, key string) ([]byte, error)

func (*FreeCacheStateStore) Keys

func (f *FreeCacheStateStore) Keys(ctx context.Context, limit int) ([]string, error)

func (*FreeCacheStateStore) Put

func (f *FreeCacheStateStore) Put(ctx context.Context, key string, val []byte) error

func (*FreeCacheStateStore) PutWithExpireTime

func (f *FreeCacheStateStore) PutWithExpireTime(ctx context.Context, key string, val []byte, expireSeconds int) error

type MemcachedStateStore added in v0.4.4

type MemcachedStateStore struct {
	StateStore
	// contains filtered or unexported fields
}

func (*MemcachedStateStore) Delete added in v0.4.4

func (m *MemcachedStateStore) Delete(ctx context.Context, key string) error

func (*MemcachedStateStore) Get added in v0.4.4

func (m *MemcachedStateStore) Get(ctx context.Context, key string) ([]byte, error)

func (*MemcachedStateStore) Keys added in v0.4.4

func (m *MemcachedStateStore) Keys(ctx context.Context, limit int) ([]string, error)

func (*MemcachedStateStore) Put added in v0.4.4

func (m *MemcachedStateStore) Put(ctx context.Context, key string, val []byte) error

func (*MemcachedStateStore) PutWithExpireTime added in v0.4.4

func (m *MemcachedStateStore) PutWithExpireTime(ctx context.Context, key string, val []byte, expireSeconds int) error

type RedisStateStore

type RedisStateStore struct {
	StateStore
	// contains filtered or unexported fields
}

func (*RedisStateStore) Delete

func (r *RedisStateStore) Delete(ctx context.Context, key string) error

func (*RedisStateStore) Get

func (r *RedisStateStore) Get(ctx context.Context, key string) ([]byte, error)

func (*RedisStateStore) Keys

func (r *RedisStateStore) Keys(ctx context.Context, limit int) ([]string, error)

func (*RedisStateStore) Put

func (r *RedisStateStore) Put(ctx context.Context, key string, val []byte) error

func (*RedisStateStore) PutWithExpireTime

func (r *RedisStateStore) PutWithExpireTime(ctx context.Context, key string, val []byte, expireSeconds int) error

type StateStore

type StateStore interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Put(ctx context.Context, key string, val []byte) error
	PutWithExpireTime(ctx context.Context, key string, val []byte, expireSeconds int) error
	Delete(ctx context.Context, key string) error
	Keys(ctx context.Context, limit int) ([]string, error)
}

func NewBigCacheStateStore

func NewBigCacheStateStore() (StateStore, error)

func NewFreeCacheStateStore

func NewFreeCacheStateStore() (StateStore, error)

func NewMemcachedStateStore added in v0.4.4

func NewMemcachedStateStore(name string) (StateStore, error)

func NewRedisStateStore

func NewRedisStateStore(name string) (StateStore, error)

type StateStoreWrapper added in v0.5.21

type StateStoreWrapper struct {
	StateStore
	// contains filtered or unexported fields
}

func NewStateStoreWrapper added in v0.5.21

func NewStateStoreWrapper(s StateStore, metricsClient *utils.MetricsClient) *StateStoreWrapper

func (*StateStoreWrapper) Delete added in v0.5.21

func (w *StateStoreWrapper) Delete(ctx context.Context, key string) error

func (*StateStoreWrapper) Get added in v0.5.21

func (w *StateStoreWrapper) Get(ctx context.Context, key string) ([]byte, error)

func (*StateStoreWrapper) Keys added in v0.5.21

func (w *StateStoreWrapper) Keys(ctx context.Context, limit int) ([]string, error)

func (*StateStoreWrapper) Put added in v0.5.21

func (w *StateStoreWrapper) Put(ctx context.Context, key string, val []byte) error

func (*StateStoreWrapper) PutWithExpireTime added in v0.5.21

func (w *StateStoreWrapper) PutWithExpireTime(ctx context.Context, key string, val []byte, expireSeconds int) error

Jump to

Keyboard shortcuts

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