middlewares

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLogging

func AddLogging(next http.HandlerFunc) http.HandlerFunc

Logging log time, method and path of an HTTP-Request

func GetParams

func GetParams(optionalGet params.R, requiredGet params.R) func(next http.HandlerFunc) http.HandlerFunc

func ParseModel

func ParseModel(postModel interface{}, getModel interface{}, deleteModel interface{}) func(next http.HandlerFunc) http.HandlerFunc

ParseModel parses and adds a model from a requestbody if wanted

func PreProcess

func PreProcess(preProcess func(ctx context.Context) error) func(next http.HandlerFunc) http.HandlerFunc

func SetCors

func SetCors(CORSString *string) func(next http.HandlerFunc) http.HandlerFunc

SetCors set response headers

func SetJSONResponse

func SetJSONResponse(next http.HandlerFunc) http.HandlerFunc

SetJSONResponse set response headers

func WithContext

func WithContext(key string, value interface{}) func(next http.HandlerFunc) http.HandlerFunc

WithContext attaches any object to the context

Types

This section is empty.

Jump to

Keyboard shortcuts

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