middlewares

package
v3.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Env    *configs.Env
	Logger *loggers.Logger
}

func (*Auth) Attach

func (a *Auth) Attach(request *http.Request, response http.ResponseWriter) bool

func (*Auth) Priority

func (a *Auth) Priority() int

type Factory

type Factory struct {
	Debug       bool
	Middlewares []Middleware
	Logger      *loggers.Logger
}

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 (a *Header) Attach(_ *http.Request, response http.ResponseWriter) bool

func (*Header) Priority

func (a *Header) Priority() int

type Middleware

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

type RequestID

type RequestID struct {
	Logger          *loggers.Logger
	RequestIDHeader string
}

func (*RequestID) Attach

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

func (*RequestID) Priority

func (r *RequestID) Priority() int

Jump to

Keyboard shortcuts

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