middleware

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowedHeaders = "Content-Type,Authorization,Origin"
View Source
var AllowedMethods = "GET,HEAD,POST,PUT,DELETE,OPTIONS,PATCH"

Functions

func AuthMiddleware

func AuthMiddleware(cfg configlib.Configer, parser authlib.TokenParser, excludedRoutes []string) mux.MiddlewareFunc

func CheckContentType

func CheckContentType()

func CorsMiddleware

func CorsMiddleware(origins []string) mux.MiddlewareFunc

func RecoverPanicMiddleWare

func RecoverPanicMiddleWare() mux.MiddlewareFunc

func RoleMiddleware

func RoleMiddleware(roles []EndpointRole) mux.MiddlewareFunc

func TimeoutMiddleware

func TimeoutMiddleware(timeoutDuration time.Duration) mux.MiddlewareFunc

Types

type EndpointRole

type EndpointRole struct {
	Endpoint string
	Role     string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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