# Functions
Base64URLDecode decodes a base64 string.
Base64URLEncode base64 encodes data.
BaseHeaders are the default headers added by go-web.
BoolValue parses a value as an bool.
CleanPath is the URL version of path.Clean, it returns a canonical URL path for p, eliminating .
CopySingleHeaders copies headers in single value format.
CSVValue just returns the string directly from a value error pair.
CtxRequestOption is a ctx option that wraps a request option.
DurationValue parses a value as an time.Duration.
Float64Value parses a value as an float64.
GetApp gets an app off a context.
GetRequestStarted gets the request started time from a context.
GetSession gets a session off a context.
GZip is a middleware the implements gzip compression for requests that opt into it.
Int64Value parses a value as an int64.
IntValue parses a value as an int.
IsErrBadRequest returns if an error is a bad request triggering error.
IsErrParameterInvalid returns if an error is an ErrParameterInvalid.
IsErrParameterMissing returns if an error is an ErrParameterMissing.
IsErrSessionInvalid returns if an error is a session invalid error.
JSONProviderAsDefault sets the context.DefaultResultProvider() equal to context.JSON().
MergeHeaders merges headers.
Mock sends a mock request to an app.
MockCtx returns a new mock ctx.
MockCtxWithBuffer returns a new mock ctx.
MockGet sends a mock get request to an app.
MockMethod sends a mock request with a given method to an app.
MockPost sends a mock post request to an app.
MockPostJSON sends a mock post request with a json body to an app.
MockSimulateLogin simulates a user login for a given app as mocked request params (i.e.
MustNew creates a new app and panics if there is an error.
MustNewAuthManager returns a new auth manager with a given set of options but panics on error.
MustNewViewCache returns a new view cache and panics on eror.
NestMiddleware reads the middleware variadic args and organizes the calls recursively in the order they appear.
New returns a new web app.
NewAuthManager returns a new auth manager from a given config.
NewCachedStaticFile returns a new cached static file for a given path.
NewCookie returns a new name + value pair cookie.
NewCtx returns a new ctx.
NewJWTManager returns a new jwt manager from a key.
NewLocalAuthManager returns a new locally cached session manager.
NewLocalAuthManagerFromCache returns a new locally cached session manager that saves sessions to the cache provided.
NewLocalSessionCache returns a new session cache.
NewParameterInvalidError returns a new parameter invalid error.
NewParameterMissingError returns a new parameter missing error.
NewSession returns a new session object.
NewSessionID returns a new session id.
NewStaticFileServer returns a new static file cache.
NewViewCache returns a new view cache.
OptAuth sets the auth manager.
OptAuthManagerCookieDefaults sets a field on an auth manager.
OptAuthManagerCookieDomain sets a field on an auth manager.
OptAuthManagerCookieHTTPOnly sets a field on an auth manager.
OptAuthManagerCookieName sets a field on an auth manager.
OptAuthManagerCookiePath sets a field on an auth manager.
OptAuthManagerCookieSameSite sets a field on an auth manager.
OptAuthManagerCookieSecure sets a field on an auth manager.
OptAuthManagerFetchHandler sets a field on an auth manager.
OptAuthManagerFromConfig returns an auth manager from a config.
OptAuthManagerLoginRedirectHandler sets a field on an auth manager.
OptAuthManagerPersistHandler sets a field on an auth manager.
OptAuthManagerRemoveHandler sets a field on an auth manager.
OptAuthManagerSerializeHandler sets a field on an auth manager.
OptAuthManagerSessionTimeoutProvider sets a field on an auth manager.
OptAuthManagerValidateHandler sets a field on an auth manager.
OptBaseContext sets a base context on an `App`; this is a context that is always used via the `BaseContext` function, independent of the listener.
OptBaseContextFunc sets a base context function on an `App`; this context function will propagated from the `App` to `http.Server.BaseContext`.
OptBaseHeaders sets base headers.
OptBaseMiddleware sets default middleware.
OptBaseStateValue sets a base state value.
OptBaseURL sets the config base url.
OptBindAddr sets the config bind address.
OptConfig sets the config.
OptConfigFromEnv sets the config from the environment.
OptCtxApp sets the context app.
OptCtxAuth sets the context auth manager.
OptCtxBodyBytes sets a post body on a context.
OptCtxCookieValue sets a cookie value on a context.
OptCtxDefaultProvider sets the context default result provider.
OptCtxHeaderValue sets a header value on a context.
OptCtxLog sets the context logger.
OptCtxPostedFiles sets posted files on a context.
OptCtxPostFormValue sets a form value on a context.
OptCtxQueryValue sets a query value on a context.
OptCtxRequestStarted sets the context request started timestamp.
OptCtxRoute sets the context route.
OptCtxRouteParams sets the context route params.
OptCtxRouteParamValue sets the context default result provider.
OptCtxSession sets the context session.
OptCtxState sets the context state.
OptCtxTracer sets the context tracer.
OptCtxViews sets the context views cache.
OptDefaultHeader sets a default header.
OptDefaultHeaders sets base headers.
OptDefaultMiddleware sets base middleware.
OptIdleTimeout sets the idle timeout.
OptLog sets the logger.
OptMaxHeaderBytes sets the max header bytes.
OptMethodNotAllowedHandler sets default headers.
OptNotFoundHandler sets default headers.
OptPort sets the config bind address.
OptReadHeaderTimeout sets the read header timeout.
OptReadTimeout sets the read timeout.
OptServer sets the underlying server.
OptServerOptions applies options to the underlying http server.
OptShutdownGracePeriod sets the shutdown grace period.
OptStaticFileServerCacheDisabled sets the static fileserver should read from disk for each request.
OptStaticFileServerHeaders sets the static fileserver default headers..
OptStaticFileServerSearchPaths sets the static fileserver search paths.
OptTLSAppendCACertsFromPaths adds CA certs from file paths to the system CA pool.
OptTLSClientCertPool adds a given set of certs in binary PEM format to the system CA pool.
OptTLSClientCertVerification sets the verification level for client certs.
OptTLSConfig sets the tls config.
OptTracer sets the tracer.
OptUse adds to the default middleware.
OptViewCacheBadRequestTemplateName sets the bad request template name.
OptViewCacheConfig sets options based on a config.
OptViewCacheFunc adds a func to the view func map.
OptViewCacheFuncMap sets the view cache func maps.
OptViewCacheInternalErrorTemplateName sets the internal error template name.
OptViewCacheLiterals sets the view cache literals.
OptViewCacheLiveReload adds a func to the view func map.
OptViewCacheNotAuthorizedTemplateName sets the not authorized template name.
OptViewCacheNotFoundTemplateName sets the not found template name.
OptViewCachePaths sets the view cache paths.
OptViewCacheStatusTemplateName sets the status template name.
OptViews sets the view cache.
OptWriteTimeout sets the write timeout.
PathRedirectHandler returns a handler for AuthManager.RedirectHandler based on a path.
Raw returns a new raw result.
RawWithContentType returns a binary response with a given content type.
ReadSetCookies parses all "Set-Cookie" values from the header h and returns the successfully parsed Cookies.
Redirect returns a redirect result to a given destination.
Redirectf returns a redirect result to a given destination specified by a given format and scan arguments.
RedirectWithMethod returns a redirect result to a destination with a given method.
RedirectWithMethodf returns a redirect result to a destination composed of a format and scan arguments with a given method.
ResultOrDefault returns a result or a default.
ResultWithLoggedError logs an error before it renders the result.
SessionAware is an action that injects the session into the context.
SessionAwareForLogout is an action that injects the session into the context, but does not extend it if there is a session lifetime handler on the auth manager.
SessionMiddleware implements a custom notAuthorized action.
SessionRequired is an action that requires a session to be present or identified in some form on the request.
SessionTimeoutProvider returns a new session timeout provider.
SessionTimeoutProviderAbsolute returns an absolute session timeout.
SessionTimeoutProviderRolling returns a rolling session timeout.
Static returns a static result for an individual file.
StringValue just returns the string directly from a value error pair.
TextProviderAsDefault sets the context.DefaultResultProvider() equal to context.Text().
UUIDValue returns a uuid typed value.
ViewProviderAsDefault sets the context.DefaultResultProvider() equal to context.View().
WithApp adds an app to a context.
WithRequestStarted sets the request started time on a context.
WithSession sets a session on a context.
WithTimeout injects the context for a given action with a timeout context.
WrapHandler wraps an http.Handler as a Handler.
XMLProviderAsDefault sets the context.DefaultResultProvider() equal to context.XML().
# Constants
DefaultBindAddr is the default bind address.
DefaultCookieHTTPOnly returns what the default value for the `HTTPOnly` bit of issued cookies will be.
DefaultCookieName is the default name of the field that contains the session id.
DefaultCookiePath is the default cookie path.
DefaultCookieSameSiteMode is the default cookie same site mode (currently http.SameSiteLaxMode).
DefaultCookieSecure returns what the default value for the `Secure` bit of issued cookies will be.
DefaultHandleMethodNotAllowed is a default.
DefaultHandleOptions is a default.
DefaultHealthzBindAddr is the default healthz bind address.
DefaultHealthzFailureThreshold is the default healthz failure threshold.
DefaultHTTPSUpgradeTargetPort is the default upgrade target port.
DefaultIdleTimeout is a default.
DefaultKeepAlive is the default setting for TCP KeepAlive.
DefaultKeepAlivePeriod is the default time to keep tcp connections open.
DefaultMaxHeaderBytes is a default that is unset.
DefaultMockBindAddr is a bind address used for integration testing.
DefaultReadHeaderTimeout is a default.
DefaultReadTimeout is a default.
DefaultRecoverPanics returns if we should recover panics by default.
DefaultSecureCookieName is the default name of the field that contains the secure session id.
DefaultSessionTimeout is the default absolute timeout for a session (24 hours as a sane default).
DefaultSessionTimeoutIsAbsolute is the default if we should set absolute session expiries.
DefaultShutdownGracePeriod is the default shutdown grace period.
DefaultSkipRedirectTrailingSlash is the default if we should redirect for missing trailing slashes.
DefaultTemplateBadRequest is a basic view.
DefaultTemplateInternalError is a basic view.
DefaultTemplateNameBadRequest is the default template name for bad request view results.
DefaultTemplateNameInternalError is the default template name for internal server error view results.
DefaultTemplateNameNotAuthorized is the default template name for not authorized error view results.
DefaultTemplateNameNotFound is the default template name for not found error view results.
DefaultTemplateNameStatus is the default template name for status view results.
DefaultTemplateNotAuthorized is a basic view.
DefaultTemplateNotFound is a basic view.
DefaultTemplateStatus is a basic view.
DefaultUseSessionCache is the default if we should use the auth manager session cache.
DefaultViewBufferPoolSize is the default buffer pool size.
DefaultWriteTimeout is a default.
ErrJWTNonstandardClaims can be returned by the jwt manager keyfunc.
ErrParameterInvalid is an error on request validation.
ErrParameterMissing is an error on request validation.
ErrSecureSessionIDEmpty is an error that is thrown if a given secure session id is invalid.
ErrSessionIDEmpty is thrown if a session id is empty.
ErrUnsetViewTemplate is an error that is thrown if a given secure session id is invalid.
FieldTagPostForm is a field tag you can use to set a struct from a post body.
LenSessionID is the byte length of a session id.
LenSessionIDBase64 is the length of a session id base64 encoded.
PackageName is the full name of this package.
RegexpAssetCacheFiles is a common regex for parsing css, js, and html file routes.
RouteNodeTypes.
RouteNodeTypes.
RouteNodeTypes.
default.
RouteTokenFilepath is a special route token.
# Variables
Common errors.
JSON is a static singleton json result provider.
NoContent is a static result.
Text is a static singleton text result provider.
XML is a static singleton xml result provider.
# Structs
App is the server for the app.
AuthManager is a manager for sessions.
CachedStaticFile is a memory mapped static file.
Config is an object used to set up a web app.
Ctx is the struct that represents the context for an hc request.
JSONResult is a json result.
JSONResultProvider are context results for api methods.
JWTManager is a manager for JWTs.
LocalSessionCache is a memory cache of sessions.
LoggedErrorResult is a result that returns an error during the prerender phase.
MockResult is a result of a mocked request.
NoContentResult returns a no content response.
PostedFile is a file that has been posted to an hc endpoint.
RawResult is for when you just want to dump bytes.
RedirectResult is a result that should cause the browser to redirect.
RewriteRule is a rule for re-writing incoming static urls.
Route is an entry in the route tree.
RouteNode is a node on the route tree.
RouteTree implements the basic logic of creating a route tree.
Session is an active session.
StaticFileServer is a cache of static files.
StaticResult represents a static output.
StatusViewModel returns the status view model.
SyncState is the collection of state objects on a context.
TextResultProvider is the default response provider if none is specified.
ViewCache is the cached views used in view results.
ViewCacheConfig is a config for the view cache.
ViewModel is a wrapping viewmodel.
ViewResult is a result that renders a view.
ViewStatus is the result view model passed to status pages.
XMLResult is a json result.
XMLResultProvider are context results for api methods.
# Interfaces
Controller is an interface for controller objects.
ResponseWriter is a super-type of http.ResponseWriter that includes the StatusCode and ContentLength for the request.
Result is the result of a controller.
ResultPostRender is a result that has a PostRender step.
ResultPreRender is a result that has a PreRender step.
ResultProvider is the provider interface for results.
State is a provider for a state bag.
TraceFinisher is a finisher for a trace.
Tracer is a type that traces complete requests.
ViewTraceFinisher is a finisher for view traces.
ViewTracer is a type that can listen for view rendering traces.
# Type aliases
Action is the function signature for controller actions.
AuthManagerFetchSessionHandler restores a session based on a session value.
AuthManagerOption is a variadic option for auth managers.
AuthManagerPersistSessionHandler saves the session to a stable store.
AuthManagerRedirectHandler is a redirect handler.
AuthManagerRemoveSessionHandler removes a session based on a session value.
AuthManagerSerializeSessionHandler serializes a session as a string.
AuthManagerSessionTimeoutProvider provides a new timeout for a session.
AuthManagerValidateSessionHandler validates a session.
CtxOption is an option for a context.
Handler is the most basic route handler.
Middleware is a func that implements middleware.
Option is an option for an app.
PanicAction is a receiver for app.PanicHandler.
PanicHandler is a handler for panics that also takes an error.
RewriteAction is an action for a rewrite rule.
RouteNodeType is a type of route node.
RouteParameters are parameters sourced from parsing the request path (route).
StaticFileserverOption are options for static fileservers.
TLSOption is an option for TLS configs.
ViewCacheOption is an option for ViewCache.