middleware

package
v0.0.0-...-ebd03d0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(next func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)

Authenticate request only if authorization header is set

func Authorized

func Authorized(next func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)

func Logging

func Logging(next http.Handler) http.Handler

func PanicRecoverer

func PanicRecoverer(next http.Handler) http.Handler

Types

type ContextAuthKey

type ContextAuthKey struct{}

type LogResponseWriter

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

func NewLogResponseWriter

func NewLogResponseWriter(w http.ResponseWriter) *LogResponseWriter

func (*LogResponseWriter) Write

func (w *LogResponseWriter) Write(body []byte) (int, error)

func (*LogResponseWriter) WriteHeader

func (w *LogResponseWriter) WriteHeader(code int)

Jump to

Keyboard shortcuts

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