session

package
v0.0.0-...-fed9169 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ContextKey string = "session-context"

Variables

This section is empty.

Functions

func Encode

func Encode(sess *sessions.Session, values *Values) error

func Get

func Get(c echo.Context) (*sessions.Session, error)

func Middleware

func Middleware(next echo.HandlerFunc) echo.HandlerFunc

func NewCookieStore

func NewCookieStore(cfg *Config) (*sessions.CookieStore, error)

Types

type Config

type Config struct {
	SigningKey    string `yaml:"signing_key"`
	EncryptingKey string `yaml:"encrypting_key"`
}

type Values

type Values struct {
	ID        int64  `mapstructure:"id"`
	FirstName string `mapstructure:"first_name"`
	LastName  string `mapstructure:"last_name"`
}

func Decode

func Decode(sess *sessions.Session) (*Values, error)

Jump to

Keyboard shortcuts

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