package
0.0.0-20250310215609-16c172e8e603
Repository: https://github.com/geonet/kit.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
AssetHandler serves assets from the local directory `assets/assets`.
CheckQuery inspects r and makes sure that the method is allowed, that all required query parameters
are present, and that no more than the required and optional parameters are present.
CheckQueryValid calls CheckQuery and then validates the query parameters using f.
CreateImportMap generates an import map script tag which maps JS module asset filenames to their respectful hash-prefixed path name.
CreateSubResourcePreload generates a tag that preloads a JavaScript module file.
CreateSubResourceTag generates a tag for a resource with the hashed path and SRI hash.
DataDog initialises sending metrics to DataDog.
EnableLogPostBody makes logger to log post body.
EnableLogRequest makes logger to log all requests.
HTMLError writes error pages to b for non nil error.
MakeDirectHandler executes rh.
MakeHandler with default CSP policy.
MakeHandler with specified CSP policy MakeHandler returns an http.Handler that executes RequestHandler and collects timing information and metrics.
MakeHandler with specified CSP policy and RequestHandlerWithNonce which accept a nonce string to be used in page template (which need nonce for scripts) returns an http.Handler that executes RequestHandler and collects timing information and metrics.
* MakeHandler with default CSP policy and RequestHandlerWithNonce
* a randomly generated nonce is passed to RequestHandlerWithNonce
*/.
NoMatch returns a 404 for GET requests.
ReturnDefaultCSP returns the default Content Security Policy used by handlers.
* These are recommended by Mozilla as part of the Observatory scan.
SetLogger sets the logger used for logging.
Soh returns a 200 and simple page for GET requests.
Status returns the HTTP status code appropriate for err.
TextError writes text errors to b for non nil error.
Up returns a 200 and simple page for GET requests.
UseError sets Headers are set for intermediate caches.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
StatusError is for errors with HTTP status codes.
# Type aliases
DirectRequestHandler allows writing to the http.ResponseWriter directly.
ErrorHandler should write the error for err into b and adjust h as required.
QueryValidator returns an error for any invalid query parameter values.
*
* RequestHandler should write the response for r into b and adjust h as required
*/.
*
* RequestHandlerWithNonce for pages with strict scripts csp
* @param nonce: string to be passed to page template as attribute of scripts
* refer https://csp.withgoogle.com/docs/strict-csp.html
*/.