redis

package
v0.0.0-...-75e85f9 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 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 Session

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

func (*Session) Get

func (s *Session) Get(ctx context.Context, key string) (any, error)

func (*Session) ID

func (s *Session) ID() string

func (*Session) Set

func (s *Session) Set(ctx context.Context, key string, val any) error

type Store

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

Store hset

sess id     key    value

map[string]map[string]string

func NewStore

func NewStore(client redis.Cmdable, opts ...StoreOption) *Store

func (*Store) Generate

func (s *Store) Generate(ctx context.Context, id string) (session.Session, error)

func (*Store) Get

func (s *Store) Get(ctx context.Context, id string) (session.Session, error)

func (*Store) Refresh

func (s *Store) Refresh(ctx context.Context, id string) error

func (*Store) Remove

func (s *Store) Remove(ctx context.Context, id string) error

type StoreOption

type StoreOption func(store *Store)

Store option 模式

func StoreWithPrefix

func StoreWithPrefix(prefix string) StoreOption

Jump to

Keyboard shortcuts

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