Versions in this module Expand all Collapse all v0 v0.8.2 Jan 20, 2023 v0.8.1 Jan 17, 2023 v0.8.0 Jan 16, 2023 v0.7.0 Jan 1, 2023 v0.6.0 Dec 29, 2022 v0.5.1 Dec 28, 2022 v0.5.0 Dec 28, 2022 v0.1.2 Mar 10, 2022 v0.1.1 Mar 10, 2022 v0.1.0 Mar 10, 2022 Changes in this version + const BOGUS + const CSS + const GIF + const HTML + const ICON + const JPG + const JS + const JSON + const Key1 + const MALFORMED + const PNG + const RespTimeMax + const SVG + const UNSUPPORTED + const WEBMANIFEST + const WEBP + const WOFF + var RespondFoo = NewResponse(CSP{ ... }) + func Decode(r *http.Request, ptr interface{}) error + func ErrsWrap(err error, new string) error + func GetBoolCMap(c *cmap.ConcurrentMap, key string) *bool + func GetInboundIP(r *http.Request) (string, error) + func GetOutboundAddr() string + func GetOutboundIP() string + func GetStrCMap(c *cmap.ConcurrentMap, key string) *string + func HTMLEntitiesToString(s string) string + func Healthcheck(url string) error + func IfModifiedSince(subject, since string) bool + func IsShutdown(err error) bool + func LastModified(x time.Time) string + func NewCMap() cmap.ConcurrentMap + func NewRequestError(err error, status int) error + func NewShutdownError(message string) error + func Nonce(size int) (string, error) + func Params(r *http.Request) map[string]string + func Redirect(ctx context.Context, w http.ResponseWriter, r *http.Request, url string, ...) error + func Respond(ctx context.Context, w http.ResponseWriter, data interface{}, statusCode int) error + func RespondError(ctx context.Context, w http.ResponseWriter, err error) error + func RuneToHTMLEntity(entity rune) string + func SetCMap(c *cmap.ConcurrentMap, key string, val interface{}) + func StringToHTMLEntities(s string) string + type App struct + func NewApp(shutdown chan os.Signal, mw ...Middleware) *App + func (a *App) Handle(method string, path string, handler Handler, mw ...Middleware) + func (a *App) HandleDebug(method string, path string, handler Handler, mw ...Middleware) + func (a *App) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (a *App) SignalShutdown() + type CSP struct + ConnectSrc []string + DefaultSrc []string + FontSrc []string + FrameSrc []string + ImgSrc []string + ObjectSrc []string + ScriptSrc []string + StyleSrc []string + type Cache cmap.ConcurrentMap + func NewCache() Cache + func (c *Cache) GetResource(key string) *Resource + func (c *Cache) GetStr(key string) *string + func (c *Cache) Set(key string, val interface{}) + type Error struct + Err error + Fields []FieldError + Status int + func (err *Error) Error() string + type ErrorResponse struct + Error string + Fields []FieldError + type FieldError struct + Error string + Field string + type Handler func(ctx context.Context, w http.ResponseWriter, r *http.Request) error + type Middleware func(Handler) Handler + type Resource struct + Code int + Content []byte + Ctime time.Time + Ctype string + Err error + Etag string + Ext string + Gz bool + Key string + Model bool + Mtime time.Time + SRI string + func GetResourceCMap(c *cmap.ConcurrentMap, key string) *Resource + type RespStatus struct + Code int + Text string + func Status(status int) RespStatus + type Response func(context.Context, http.ResponseWriter, interface{}, int) error + func NewResponse(cc CSP) Response + type ResponseError func(context.Context, http.ResponseWriter, error) error + func NewResponseError(csp CSP) ResponseError + type Values struct + Now time.Time + StatusCode int + TraceID string