http

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package http includes handlers and utilties

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthMiddleware added in v0.3.0

func BasicAuthMiddleware(next http.Handler, username, password, realm string) http.HandlerFunc

BasicAuthMiddleware is a simple HTTP plain authentication middleware.

func ReadAllAndReplaceBody

func ReadAllAndReplaceBody(r *http.Request) ([]byte, error)

ReadAllAndReplaceBody reads all of r.Body and replaces it with a new byte buffer.

func TraceLoggingMiddleware added in v0.3.0

func TraceLoggingMiddleware(next http.Handler, logger log.Logger, newTrace func() string) http.HandlerFunc

TraceLoggingMiddleware sets up a trace ID in the request context and logs HTTP requests.

func VersionHandler added in v0.3.0

func VersionHandler(version string) http.HandlerFunc

VersionHandler returns a simple JSON response from a version string.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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