state

package
v0.0.0-...-64046f9 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisStore

type RedisStore struct {
	// contains filtered or unexported fields
}

func NewRedisStore

func NewRedisStore(client redis.UniversalClient, prefix string) *RedisStore

func (*RedisStore) Del

func (rs *RedisStore) Del(ctx context.Context, id core.UserID) error

func (*RedisStore) Get

func (rs *RedisStore) Get(ctx context.Context, id core.UserID) (State, error)

func (*RedisStore) Set

func (rs *RedisStore) Set(ctx context.Context, id core.UserID, state State) error

type State

type State int8
const (
	Empty State = iota
	SettingsChannelsAndChatsConnect
)

func (State) String

func (i State) String() string

type Store

type Store interface {
	Get(ctx context.Context, id core.UserID) (State, error)
	Set(ctx context.Context, id core.UserID, state State) error
	Del(ctx context.Context, id core.UserID) error
}

Jump to

Keyboard shortcuts

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