middlewares

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Resolve func(username, password string) bool
}

func (*BasicAuth) Handler

func (auth *BasicAuth) Handler(nextHandler http.Handler) http.Handler

type CSRF

type CSRF struct {
	TokenLength    int    // default: 32
	TokenLookup    string // default: X-CSRF-Token (header/form field)
	AllowForm      bool
	CookieName     string // default: _csrf
	CookieDomain   string
	CookiePath     string // default: /
	CookieMaxAge   int    // default: 86400 (1 day)
	CookieSecure   bool
	CookieSameSite http.SameSite
	CookieHTTPOnly bool
}

func (*CSRF) Handler

func (csrf *CSRF) Handler(next http.Handler) http.Handler

type Cache

type Cache struct {
	MaxAge time.Duration              // 0 - unlimit
	Key    func(*http.Request) string // optional
	// contains filtered or unexported fields
}

Cache middleware for "GET 200"

func (*Cache) Handler

func (cache *Cache) Handler(next http.Handler) http.Handler

func (*Cache) InvalidateAll

func (cache *Cache) InvalidateAll()

InvalidateAll cache

func (*Cache) InvalidateByKey

func (cache *Cache) InvalidateByKey(key string)

InvalidateByKey cache

type Logger

type Logger struct {
	RequestInfo bool
}

func (*Logger) Handler

func (logger *Logger) Handler(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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