middleware

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientIPFromContext added in v0.1.5

func ClientIPFromContext(ctx context.Context) net.IP

func Logger

func Logger(next http.Handler) http.Handler

func Register

func Register(mux http.Handler, middlewares ...func(http.Handler) http.Handler) (handler http.Handler)

Types

type CIDRCheck

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

func NewCIDRCheck

func NewCIDRCheck(config *core.Config) (*CIDRCheck, error)

func (*CIDRCheck) InjectClientIPMiddleware added in v0.1.5

func (c *CIDRCheck) InjectClientIPMiddleware() func(next http.Handler) http.Handler

func (*CIDRCheck) Middleware

func (c *CIDRCheck) Middleware() func(next http.Handler) http.Handler

type ContextKey added in v0.1.5

type ContextKey string
const (
	ClientIPContextKey ContextKey = "ClientIPContextKey"
)

type TokenProvider

type TokenProvider interface {
	GetCatalogToken() (string, error)
	GetToken() (string, error)
}

type UnauthMiddleware

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

func NewUnauthMiddleware

func NewUnauthMiddleware(upstream *url.URL, tokenProvider TokenProvider) *UnauthMiddleware

func (*UnauthMiddleware) Middleware

func (um *UnauthMiddleware) Middleware() func(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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