package
0.8.2
Repository: https://github.com/sempernow/kit.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

Decode reads the body of an HTTP request (r) looking for a JSON document.
ErrsWrap safely wraps error (err) regardless if nil; ignore new if empty.
GetBoolCMap (`*bool`) per `key`.
GetForwardedHostIP from X-Forwarded-Host request header.
GetHostname returns os.Hostname(); the Docker container ID.
GetInboundIP from request headers; X-REAL-IP > X-FORWARDED-FOR > r.RemoteAddr (Reverse Proxy Servers may set X-REAL-IP and X-FORWARDED-FOR headers.) https://golangbyexample.com/golang-ip-address-http-request/ PROBLEM: @ Docker, service ctnrs have no access to client-IP address! IP is of overlay network LB @ "Containers:".
GetOutboundAddr returns the preferred outbound IP address of this machine.
GetOutboundIP returns the preferred outbound IP address of this machine.
GetResourceCMap (`*Resource`) per `key`.
GetStrCMap (`*string`) per `key`.
Healthcheck to satisfy Docker healthcheck of any service endpoint without requiring any externals; neither (GNU) utilities nor shell.
HTMLEntitiesToString ..
IfModifiedSince is a header-helper function that tests if `subject` is modified `since`.
IsShutdown checks to see if the shutdown error is contained in the specified error value.
LastModified is a header-helper function that returns the properly formatted value to fit the HTTP "Last-Modified: <LastModified>" header: `Thu, 20 Aug 2020 18:26:03 GMT`.
NewApp creates an `App` value to handle a set of routes for the application.
NewCache returns an embedded k-v store (`Cache`).
NewCMap returns an embedded k-v store (`Cache`).
NewRequestError wraps a provided error with an HTTP status code.
NewResponse closes over CSP sources (whitelists), returning a Response function.
NewResponseError closes over CSP sources (whitelists), returning a ResponseError function.
NewShutdownError returns an error that causes the framework to signal a graceful shutdown.
Nonce of size bytes as a URL-encoded string.
Params returns the web call parameters from the request.
Redirect performs as http.Redirect(..), while fitting the context-based signature of this library.
Respond is the nominal Response function; enforces strictest CSP.
RespondError is the nominal RespondError function; enforces strictest CSP.
RuneToHTMLEntity https://gist.github.com/brandonrachal/10605780 '𝓢' //=> &#1d4e2;.
SetCMap any type per `key`.
SRI generates the Sub-Resource Integrity (CSP/SRI) string of a resource per SHA384.
Status returns RespStatus of an HTTP response code.
StringToHTMLEntities ..
ValidateJS requires Node.js and returns error on invalid script, invalid path, or absence of Node.js, which acts as the validator.

# Constants

Content Types (MIME Types).
Content Types (MIME Types).
Content Types (MIME Types).
Content Types (MIME Types).
Content Types (MIME Types).
Content Types (MIME Types).
Content Types (MIME Types).
Content Types (MIME Types).
Key1 is used for protected set/get of Claims VALUEs from a `context.Context`.
No description provided by the author
Content Types (MIME Types).
Content Types (MIME Types).
RespTimeMax is app-wide max response time in milliseconds, measured from time of request arriving at its (first) endpoint handler; first in the middlewares chain.
Content Types (MIME Types).
Content Types (MIME Types).
Content Types (MIME Types).
SVG = "application/xml" //..
Content Types (MIME Types).

# Variables

RespondFoo is a Response function that loosens Content Security Policy (CSP) to allow connections, scripts and such, each from a whitelist of sources.

# Structs

App is the entrypoint into our app and what configures our context object for http handlers.
CSP contains lists of Content Security Policy (CSP) sources.
Error is used to pass an error during the request through the application with web specific context.
ErrorResponse is the form used for API responses from failures in the API.
FieldError is used to indicate an error with a specific request field.
Resource contains all the parameters of a web-server resource.
RespStatus contains code and text of an HTTP response.
Values represent state for each request.

# Type aliases

Cache ...
Handler defines the per-request endpoint-handler type for this app framework.
Middleware is a function designed to run some code before and/or after another Handler.
Response is the per-request HTTP response function.
ResponseError is the per-request HTTP response function for errors.