http

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainMiddlewares

func ChainMiddlewares(base http.Handler, links ...HandlerBuilder) http.Handler

func HttpErr

func HttpErr(w http.ResponseWriter, errId int, message string, code int)

Return an error over an http connection. The error will have the given return code `code` and a json encoded body with the field "id" set to `errId` and a field "message" set to the `message`

func LoggingMiddleware

func LoggingMiddleware(handler http.Handler) http.Handler

Types

type HandlerBuilder

type HandlerBuilder func(http.Handler) http.Handler

func ContextValsMiddleware

func ContextValsMiddleware(pairs map[any]any) HandlerBuilder

Jump to

Keyboard shortcuts

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