gospell

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HeaderId      = "X-Gospell-Id"
	FlashCookie   = "gospell-flash"
	SessionCookie = "gospell-session"
	CSRFToken     = "csrf_token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Flash    Flash
	Session  Session
	ViewData map[string]interface{}
	// contains filtered or unexported fields
}

func NewContext

func NewContext(w http.ResponseWriter, r *http.Request, options ContextOptions) *Context

func (*Context) Redirect

func (c *Context) Redirect(url string)

func (*Context) SetFlash

func (c *Context) SetFlash(key string, value string)

type ContextOptions

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

type CookiesOptions

type CookiesOptions struct {
	Path     string
	Domain   string
	SameSite http.SameSite
	Secure   bool
	HttpOnly bool
}

type Engine

type Engine struct {
	Cookies         CookiesOptions
	EnableCSRFToken bool
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine() *Engine

func (*Engine) GetContext

func (hw *Engine) GetContext(r *http.Request) *Context

func (*Engine) Handler

func (hw *Engine) Handler(next http.Handler) http.Handler

type Flash

type Flash map[string]string

func NewFlash

func NewFlash() Flash

func (Flash) Error

func (f Flash) Error(msg string)

func (Flash) Success

func (f Flash) Success(msg string)

type Session

type Session map[string]interface{}

func NewSession

func NewSession() Session

Jump to

Keyboard shortcuts

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