session

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultConfig is the default Session middleware config.
	DefaultConfig = Config{
		Skipper: defaultSkipper,
	}
)

Functions

func Get

func Get(name string, r *http.Request) (*sessions.Session, error)

Get returns a named session.

func Middleware

func Middleware(store sessions.Store) mux.MiddlewareFunc

Middleware returns a Session middleware.

func MiddlewareWithConfig

func MiddlewareWithConfig(config Config) mux.MiddlewareFunc

MiddlewareWithConfig returns a Sessions middleware with config.

Types

type Config

type Config struct {
	// Skipper defines a function to skip middleware.
	Skipper func(r *http.Request) bool

	// Session store.
	// Required.
	Store sessions.Store
}

Config defines the config for Session middleware.

Jump to

Keyboard shortcuts

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