session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSession = errors.New("no session was found")

Functions

func NewSessionMiddleware

func NewSessionMiddleware(config *MiddlewareConfig) echo.MiddlewareFunc

Types

type AuthInfo

type AuthInfo struct {
	Authenticated bool
	UserId        int64
}

func GetAuthInfo

func GetAuthInfo(ctx echo.Context) *AuthInfo

type MiddlewareConfig

type MiddlewareConfig struct {
	SessionStore Store
}

type Store

type Store interface {
	Get(token string) (*AuthInfo, error)
	New(userId int64) (string, error)
}

func NewStore

func NewStore(key string) Store

Jump to

Keyboard shortcuts

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