qschi

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCustomLogs

func AddCustomLogs(logger *zap.Logger, router *chi.Mux) *chi.Mux

Add global logging middlewares to the router

func CustomLogMiddleware

func CustomLogMiddleware(logger *zap.Logger) func(next http.Handler) http.Handler

This middleware adds a logger to the router that logs every requests

func CustomRecoverer

func CustomRecoverer() func(next http.Handler) http.Handler

This middleware adds a panic recoverer to the router.

If a logger lives inside the context, do a panic log, or else it just ignores the panic

func ProvideEmptyRouter

func ProvideEmptyRouter() fx.Option

Create a new HTTP server that is routed using a Chi router. Will add zap.Logger as custom log for the engine.

 var Module = fx.Options(
		qshttp.ProvideHttpConfigs(&qshttp.EnvConfigType{}),
		qschi.ProvideEmptyRouter(),
 )

Types

This section is empty.

Jump to

Keyboard shortcuts

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