httptools

package
v0.0.0-...-68baa91 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestLogger

func RequestLogger(label string, h http.Handler) http.Handler

RequestLogger creates an http.Handler function with a default info logger

func RespondWithBody

func RespondWithBody(w http.ResponseWriter, events subscribed.Events, httpCode int)

RespondWithBody sends http response with json body

func RespondWithErrorAndLog

func RespondWithErrorAndLog(e error, w http.ResponseWriter)

RespondWithErrorAndLog logs error and sends http response with error json body

Types

This section is empty.

Jump to

Keyboard shortcuts

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