middleware

package
v0.0.0-...-7f15357 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthenticateUser = middleware.AuthenticateUser

Functions

func AuthnMiddleware

func AuthnMiddleware(constTenant string) mux.MiddlewareFunc

func ContentTypeJSONMiddleware

func ContentTypeJSONMiddleware(next http.Handler) http.Handler

func ErrBadRequest

func ErrBadRequest(err error) error

func ErrNotFound

func ErrNotFound(err error) error

func RequestResponseMiddleware

func RequestResponseMiddleware(logger log.Logger) func(Request) http.HandlerFunc

Types

type Request

type Request func(tenant string, req *http.Request) (interface{}, error)

type ResponseWrapper

type ResponseWrapper struct {
	Status string      `json:"status"`
	Data   interface{} `json:"data,omitempty"`
	Error  string      `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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