cache

package
v0.0.0-...-afd1d67 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserSnapshotFieldName = "user_state"
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(addr, password string, DB int) *redis.Client

Types

type TokenStore

type TokenStore interface {
	Create(ctx context.Context, userId, token string, state *model.UserSnapshot, expiry time.Duration) error
	Get(ctx context.Context, userId, token string) (*model.UserSnapshot, error)
	GetByUserID(ctx context.Context, userId string) ([]*model.UserSnapshot, error)
	Update(ctx context.Context, userId, token string, snapshot *model.UserSnapshot) error
	Delete(ctx context.Context, userId, token string) error
	DeleteByUserID(ctx context.Context, userId string) error
}

func NewTokenStore

func NewTokenStore(rds *redis.Client) TokenStore

Jump to

Keyboard shortcuts

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