package
0.1.1
Repository: https://github.com/djcass44/go-utils.git
Documentation: pkg.go.dev

# Functions

HeadersAsFlatMap converts a http.Header into a map, flattening duplicate values e.g.
HeadersAsMap converts a http.Header into a map.
IsHTTPError returns true if a status code is 4xx or 5xx.
RemoveHeaders removes all matching headers from a http.Header.
ReturnJSON converts a given interface into JSON and writes it into a http.ResponseWriter.
ReturnProtoJSON converts a given proto.Message into JSON and writes it into an HTTP response.
WithBody reads an HTTP JSON request body and marshals it into a given struct Param v must be a pointer.
WithProtoBody reads an HTTP JSON request body and marshals it into a given proto.Message.

# Constants

collection of http headers.
collection of http headers.
collection of http headers.
collection of common content-type values.
collection of common content-type values.
collection of http headers.
collection of common content-type values.

# Variables

IsHTTPClientError returns true if a status code is of the 4xx range (400 - 499).
IsHTTPInformation returns true if a status code is of the 1xx range (100 - 199).
IsHTTPRedirect returns true if a status code is of the 3xx range (300 - 399).
IsHTTPServerError returns true if a status code is of the 5xx range (500 - 599).
IsHTTPSuccess returns true if a status code is of the 2xx range (200 - 299).