session

package
v0.0.0-...-7de2586 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID   int64
	Name string
	Type string
}

func GetAccountFromCtx

func GetAccountFromCtx(ctx context.Context) (Account, error)

type AccountContextKey

type AccountContextKey struct{}

type Session

type Session interface {
	Set(ctx context.Context, key string, acc Account, ttl time.Duration) error
	Delete(ctx context.Context, key string) error
	Get(ctx context.Context, key string) (Account, error)
}

func NewRedisSessionStore

func NewRedisSessionStore(l *logrus.Logger, r redis.UniversalClient) Session

Jump to

Keyboard shortcuts

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