rbsess

package module
v0.0.0-...-dbdc49b Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 6 Imported by: 0

README

Backlog

  • COULD add a rb.decoder for the bind package that support decoding the session
  • COULD make sure there is 100% test coverage
  • COULD create a cookiestore that uses the new fs package
  • COULD add a way to decode/bind data from the session into a request/page struct using mitchell mapstructure
  • SHOULD add middleware that make session easily available in controller
  • SHOULD add middleware that automatically saves session before returning response
  • COULD add CSRF functionality
  • SHOULD add flash message utilities
  • COULD add a template helper that allows reading session data directly.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCookieStore

func NewCookieStore(logs *zap.Logger, cfg Conf) (sessions.Store, error)

NewCookieStore inits a cookie store

Types

type Conf

type Conf struct {
	KeyPairs            []string `env:"RB_SESS_KEY_PAIRS" envSeparator:","`
	CookiePath          string   `env:"RB_SESS_COOKIE_PATH" envDefault:"/"`
	CookieMaxAgeSeconds int      `env:"RB_SESS_COOKIE_MAX_AGE_SECONDS" envDefault:"2592000"`
	CookieDomain        string   `env:"RB_SESS_COOKIE_DOMAIN"`
	CookieHTTPOnly      bool     `env:"RB_SESS_COOKIE_HTTP_ONLY"`
	Secure              bool     `env:"RB_SESS_SECURE"`
	CookieSameSite      int      `env:"RB_SESS_COOKIE_SAME_SITE"`
}

Conf configures the session store

func ParseConf

func ParseConf() (cfg Conf, err error)

ParseConf parses the environment into the session configuration

Jump to

Keyboard shortcuts

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