sessions

package
v2.0.0-...-2f32145 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSessionFound = errors.New("no active session in request context")

Functions

func AllowNonTlsConnections

func AllowNonTlsConnections() func(p *ManagerParams)

AllowNonTlsConnections allows non-TLS connections for a session, removing the Secure attribute from session cookies.

Types

type Key

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

func KeyFromBytes

func KeyFromBytes(b []byte) Key

func (Key) Bytes

func (k Key) Bytes() []byte

type Manager

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

func NewManager

func NewManager(sqliteDB *sql.DB, options ...Option) (Manager, error)

func (Manager) CreateSession

func (m Manager) CreateSession(w http.ResponseWriter, ctx context.Context, key Key, session Session) error

func (Manager) EndSession

func (m Manager) EndSession(ctx context.Context, w http.ResponseWriter)

func (Manager) SessionFromContext

func (m Manager) SessionFromContext(ctx context.Context) (Session, error)

func (Manager) WrapRequest

func (m Manager) WrapRequest(next http.Handler) http.Handler

type ManagerParams

type ManagerParams struct {
	RequireTLS bool
}

type Option

type Option func(*ManagerParams)

type Session

type Session []byte

Jump to

Keyboard shortcuts

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