middlewares

package
v4.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 21 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Validator ValidateUsernameAndPassword
}

func (*BasicAuth) Attach

func (b *BasicAuth) Attach(request *http.Request, response http.ResponseWriter) bool

func (*BasicAuth) Priority

func (b *BasicAuth) Priority() int

type Cors

type Cors struct {
	Options cors.Options
}

func (*Cors) Attach

func (c *Cors) Attach(request *http.Request, response http.ResponseWriter) bool

func (*Cors) Priority

func (c *Cors) Priority() int

type Factory

type Factory struct {
	Debug bool
	// contains filtered or unexported fields
}

func (*Factory) Add

func (m *Factory) Add(middlware Middleware)

func (*Factory) Attach

func (m *Factory) Attach(handler http.Handler) http.Handler

func (*Factory) Register

func (m *Factory) Register(middlewares []Middleware)

func (*Factory) Sort

func (m *Factory) Sort()
type Header struct {
}

func (*Header) Attach

func (h *Header) Attach(_ *http.Request, response http.ResponseWriter) bool

func (*Header) Priority

func (h *Header) Priority() int

type Helmet

type Helmet struct {
}

func (*Helmet) Attach

func (h *Helmet) Attach(_ *http.Request, response http.ResponseWriter) bool

func (*Helmet) Priority

func (h *Helmet) Priority() int

type Jwt

type Jwt struct {
	Debug         bool
	Secret        string
	SigningMethod string
	Whitelist     string
	Env           *configs.Env
}

func (*Jwt) Attach

func (j *Jwt) Attach(request *http.Request, response http.ResponseWriter) bool

func (*Jwt) Priority

func (j *Jwt) Priority() int

type Middleware

type Middleware interface {
	Attach(request *http.Request, response http.ResponseWriter) bool
	Priority() int
}

type RequestID

type RequestID struct {
	RequestIDHeader string
}

func (*RequestID) Attach

func (r *RequestID) Attach(request *http.Request, response http.ResponseWriter) bool

func (*RequestID) Priority

func (r *RequestID) Priority() int

type ValidateUsernameAndPassword

type ValidateUsernameAndPassword func(username string, password string) bool

Jump to

Keyboard shortcuts

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