middleware

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Authorization

func Authorization(authService AuthService) mux.MiddlewareFunc

func ContextKeyValue

func ContextKeyValue(key interface{}, constructor GenericConstructor) mux.MiddlewareFunc

func Cors

func Cors(allowOrigins []string) mux.MiddlewareFunc

func DefaultParamsConstructor

func DefaultParamsConstructor(r *http.Request, w http.ResponseWriter) *composables.Params

func LogRequests

func LogRequests() mux.MiddlewareFunc

func Provide added in v0.0.2

func RequestParams

func RequestParams(constructor ParamsConstructor) mux.MiddlewareFunc

func Transactions

func Transactions(db *gorm.DB) mux.MiddlewareFunc

func WithLocalizer

func WithLocalizer(bundle *i18n.Bundle) mux.MiddlewareFunc

func WithLogger

func WithLogger(logger *log.Logger) mux.MiddlewareFunc

Types

type AuthService

type AuthService interface {
	Authorize(ctx context.Context, token string) (*user.User, *session.Session, error)
}

type GenericConstructor

type GenericConstructor func(r *http.Request, w http.ResponseWriter) interface{}

type ParamsConstructor

type ParamsConstructor func(r *http.Request, w http.ResponseWriter) *composables.Params

Jump to

Keyboard shortcuts

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