middleware

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(h http.HandlerFunc, adapters ...Adapter) http.HandlerFunc

Adapt Iterate over adapters and run them one by one

func CreateGUID

func CreateGUID() string

CreateGUID creates a Guid for error tracing

func ResponseWithCustomCode

func ResponseWithCustomCode(w http.ResponseWriter, code int, payload interface{})

ResponseWithJson returns formed JSON

func ResponseWithJson

func ResponseWithJson(w http.ResponseWriter, payload interface{})

ResponseWithJson returns formed JSON

Types

type Adapter

type Adapter func(http.HandlerFunc) http.HandlerFunc

func LogRequestDetails

func LogRequestDetails() Adapter

func SetCorsHeaders

func SetCorsHeaders() Adapter

func ValidateRestMethod

func ValidateRestMethod(method string) Adapter

ValidateRestMethod middleware to validate proper methods

Jump to

Keyboard shortcuts

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