redis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host        string
	Port        string
	Username    string
	Password    string
	DB          int
	ConnTimeout time.Duration
}

type Session

type Session struct {
	UserID      string `redis:"user_id"`
	Fingerprint string `redis:"fingerprint"`
	IP          string `redis:"ip"`
	ExpiresAt   int64  `redis:"expires_at"`
	CreatedAt   int64  `redis:"created_at"`
}

type Storage

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

func NewStorage

func NewStorage(conf Config) (*Storage, error)

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) DeleteAllByUserID

func (s *Storage) DeleteAllByUserID(ctx context.Context, id string) error

func (*Storage) GetWithDelete

func (s *Storage) GetWithDelete(ctx context.Context, refreshToken string) (core.Session, error)

func (*Storage) Set

func (s *Storage) Set(ctx context.Context, sess core.Session) error

Jump to

Keyboard shortcuts

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