echosessions

package
v0.0.0-...-6fab97a Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Destroy

func Destroy(name string, c echo.Context) error

Destroy destroy existing session

func Get

func Get(name string, c echo.Context) (*sessions.Session[string], error)

Get returns a named session.

func Middleware

func Middleware(store sessions.Store[string]) echo.MiddlewareFunc

Middleware returns a Session middleware.

func MiddlewareWithConfig

func MiddlewareWithConfig(config Config) echo.MiddlewareFunc

MiddlewareWithConfig returns a Sessions middleware with config. See `Middleware()`.

func New

func New(name string, c echo.Context) (*sessions.Session[string], error)

New returns a new session

Types

type Config

type Config struct {
	// Skipper defines a function to skip middleware.
	Skipper middleware.Skipper

	// Session store.
	// Required.
	Store sessions.Store[string]
}

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