sessionStore

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnkownType = errors.New("Unknown type")
View Source
var Sessions sync.Map

Functions

This section is empty.

Types

type InMemory

type InMemory struct{}

func NewInMemory

func NewInMemory() *InMemory

func (InMemory) Add

func (im InMemory) Add(s *Session) (SessionToken, error)

func (InMemory) Exists

func (im InMemory) Exists(st SessionToken) bool

func (InMemory) Get

func (im InMemory) Get(st SessionToken) (*Session, error)

func (InMemory) Remove

func (im InMemory) Remove(st SessionToken)

type Session

type Session struct {
	Username auth.Username
	Expiry   time.Time
}

func (Session) IsExpired

func (s Session) IsExpired() bool

func (*Session) Refresh

func (s *Session) Refresh(t time.Time)

type SessionStore

type SessionStore interface {
	Add(*Session) (SessionToken, error)
	Get(SessionToken) (*Session, error)
	Exists(SessionToken) bool
	Remove(SessionToken)
}

type SessionToken

type SessionToken string

Jump to

Keyboard shortcuts

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