session

package
v0.0.0-...-48663ca Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ZeroToken = Token{}

Functions

This section is empty.

Types

type Info

type Info struct {
	User kb.User

	Creation   time.Time
	LastAccess time.Time
	// contains filtered or unexported fields
}

type Store

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

func NewStore

func NewStore(maxage time.Duration) *Store

func (*Store) Delete

func (store *Store) Delete(token Token)

func (*Store) GetPageToShowAfterLogin

func (store *Store) GetPageToShowAfterLogin(token Token) (pages []kb.Slug)

func (*Store) Load

func (store *Store) Load(token Token) (user kb.User, ok bool)

func (*Store) New

func (store *Store) New(user kb.User) (Token, error)

func (*Store) PurgeOld

func (store *Store) PurgeOld()

func (*Store) SetPageToShowAfterLogin

func (store *Store) SetPageToShowAfterLogin(token Token, pages []kb.Slug)

could be generic in the future (set any session value by Key)

type Token

type Token [64]byte

func GenerateToken

func GenerateToken() (Token, error)

func TokenFromString

func TokenFromString(s string) (Token, error)

func (*Token) String

func (token *Token) String() string

Jump to

Keyboard shortcuts

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