middleware

package
v0.0.0-...-14027d0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const RequestParams = "request_params"

Variables

This section is empty.

Functions

func GetTraceId

func GetTraceId(ctx context.Context) string

func MandatoryHeaders

func MandatoryHeaders(next http.Handler) http.Handler

func ParamValidate

func ParamValidate(validator *util.Validator, rulesFunc RulesFunc) func(next http.Handler) http.Handler

func Recoverer

func Recoverer(next http.Handler) http.Handler

func RequestLogger

func RequestLogger(next http.Handler) http.Handler

func SetMandatoryHeaders

func SetMandatoryHeaders(req *http.Request, ctx context.Context)

func TraceId

func TraceId(next http.Handler) http.Handler

Types

type LogRecord

type LogRecord struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*LogRecord) Write

func (r *LogRecord) Write(p []byte) (int, error)

func (*LogRecord) WriteHeader

func (r *LogRecord) WriteHeader(status int)

type RulesFunc

type RulesFunc func(r *http.Request) interface{}

Jump to

Keyboard shortcuts

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