redis

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Get(context.Context, string) *redis.StringCmd
	HGetAll(context.Context, string) *redis.StringStringMapCmd
	Set(context.Context, string, interface{}, time.Duration) *redis.StatusCmd
	HSet(context.Context, string, ...interface{}) *redis.IntCmd
	Expire(context.Context, string, time.Duration) *redis.BoolCmd
}

type Store

type Store struct {
	R   Client
	TTL time.Duration
}

Store struct models an FSM sotred on Redis

func NewStore

func NewStore(cfg *config.StoreConfig) (*Store, error)

func (*Store) Exists

func (s *Store) Exists(user string) (e bool)

Exists for Store

func (*Store) Get

func (s *Store) Get(user string) *fsm.FSM

Get method for Store

func (*Store) Set

func (s *Store) Set(user string, m *fsm.FSM)

Set method for Store

Jump to

Keyboard shortcuts

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