mid

package
v0.0.0-...-f1dae87 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errors

func Errors(ctx context.Context, log *logger.Logger, handler Handler) error

Errors handles errors coming out of the call chain. It detects normal application errors which are used to respond to the client in a uniform way. Unexpected errors (status >= 500) are logged.

func Logger

func Logger(ctx context.Context, log *logger.Logger, path string, rawQuery string, method string, remoteAddr string, handler Handler) error

Logger writes information about the request to the logs.

func Metrics

func Metrics(ctx context.Context, handler Handler) error

Metrics updates program counters.

func Panics

func Panics(ctx context.Context, handler Handler) (err error)

Panics recovers from panics and converts the panic to an error so it is reported in Metrics and handled in Errors.

Types

type Handler

type Handler func(ctx context.Context) error

Jump to

Keyboard shortcuts

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