httpmiddleware

package
v0.0.0-...-b5a46b0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MIT Imports: 6 Imported by: 0

README

orc-httpmiddleware: an Orc module allowing other Orc modules to register gorillamux-compatible HTTP middleware

Documentation

Index

Constants

View Source
const (
	RequestReceived = Stage(1000)
	CorsCheck       = Stage(1500)
	Auth            = Stage(2000)
	RequestAccepted = Stage(3000)
)

Variables

This section is empty.

Functions

func SetHeader

func SetHeader(key, value string) mux.MiddlewareFunc

Types

type Middleware

type Middleware struct {
	Name  string
	Stage Stage
	Func  mux.MiddlewareFunc
}

type Module

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

func NewModule

func NewModule(name string) *Module

func (*Module) AddMiddleware

func (m *Module) AddMiddleware(wares ...*Middleware)

func (*Module) ModuleName

func (m *Module) ModuleName() string

func (*Module) OnRegister

func (m *Module) OnRegister(hooks orc.ModuleHooks)

func (*Module) Wrap

func (m *Module) Wrap(h http.Handler) http.Handler

type Stage

type Stage int

func (Stage) Do

func (s Stage) Do(name string, f mux.MiddlewareFunc) *Middleware

Jump to

Keyboard shortcuts

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