sessions

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoSession = errors.New("no session")

NoSession is an error indicating no session was found

Functions

This section is empty.

Types

type Config

type Config interface {
	Name() string
	MaxAge() int
}

Config must be implemented and provided to New

func NewConfig

func NewConfig(c general.Config) (Config, error)

NewConfig provides a Config based on general.Config

type Sessions

type Sessions interface {
	Start(w http.ResponseWriter) (map[string][]byte, error)
	Get(req *http.Request) (map[string][]byte, error)
	End(w http.ResponseWriter)
	GetOrStart(w http.ResponseWriter, req *http.Request) (map[string][]byte, error)
}

Sessions is an interface to manage sessions for http requests

func NewSessions

func NewSessions(c Config) Sessions

NewSessions provides a Sessions implementation

Jump to

Keyboard shortcuts

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