session

package
v0.0.0-...-a11f1b2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 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 Redis

type Redis struct {
	Expire time.Duration
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis(options *redis.Options, expire time.Duration) *Redis

func (*Redis) Get

func (r *Redis) Get(hash string) (Token, error)

func (*Redis) Save

func (r *Redis) Save(token Token) (string, error)

type Session

type Session interface {
	Get(token string) (Token, error)
	Save(token Token) (string, error)
}

type Token

type Token struct {
	User       model.User
	ExpireTime time.Duration
}

func (Token) Hash

func (t Token) Hash() string

func (Token) MarshalBinary

func (t Token) MarshalBinary() ([]byte, error)

Jump to

Keyboard shortcuts

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