Versions in this module Expand all Collapse all v1 v1.0.3 May 2, 2022 Changes in this version + func RegisterDecoder(contentType string, inFunc InputFunc) + func RegisterEncoder(contentType string, outFunc OutputFunc) + func RegisterRoute(module platform.Module) error + func UnregisterRoute(name string) + func UnregisterRoutes() + func UseMiddleware(middleware ...Middleware) + type BruteForceConfig struct + Capacity int64 + Enabled bool + Rate float64 + type CacheConfig struct + Enabled bool + TTL time.Duration + type Config struct + Address string + Cache *CacheConfig + EnableTracing bool + HTTPS HTTPSConfig + Host string + IdleTimeout time.Duration + Name string + Port int + PostMaxSize int + ReadTimeout time.Duration + Security *SecurityConfig + Session *session.Config + StaticPath string + TraceHeader string + TraceRequired bool + UseCompression bool + WriteTimeout time.Duration + func (cfg *Config) Validate() error + type Context struct + Consent bool + DNT bool + Data map[string]interface{} + Request *http.Request + Response *Response + Server *Server + Session *session.Session + func (c *Context) AccountID() *string + func (c *Context) Authenticated() bool + func (c *Context) BadRequest(err interface{}) + func (c *Context) Can(permission platform.Permission) bool + func (c *Context) CanAll(permissions ...platform.Permission) bool + func (c *Context) CanAny(permissions ...platform.Permission) bool + func (c *Context) ErrorBadRequest(e interface{}) (status int, err error) + func (c *Context) ErrorForbidden(err error) (int, error) + func (c *Context) ErrorServerError(err error) (int, error) + func (c *Context) ErrorUnauthorized(err error) (int, error) + func (c *Context) Forbidden(err interface{}) + func (c *Context) FormFile(name string) (file multipart.File, header *multipart.FileHeader, err error) + func (c *Context) FormValue(name string) (string, error) + func (c *Context) Get(key string, val interface{}) error + func (c *Context) OK() (int, error) + func (c *Context) RemoteAddr() string + func (c *Context) ServerError(err error) + func (c *Context) Set(key string, val interface{}) + func (c *Context) Unauthorized(err interface{}) + func (c *Context) UserAgent() string + type HTTPSConfig struct + Auto bool + Cert string + CertType string + Enabled bool + Key string + Port int + type HandlerFunc func(*Context) error + type InputFunc func(ctx *Context, h *handler) ([]interface{}, error) + type Manager interface + GetCertificate func(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) + GetCertificateFiles func() (string, string) + TLSConfig func() *tls.Config + type Middleware func(HandlerFunc) HandlerFunc + type OutputFunc func(ctx *Context, params ...interface{}) ([]byte, error) + type Response struct + Committed bool + Size int64 + Status int + Writer http.ResponseWriter + func (r *Response) Compressor(wr io.Writer) + func (r *Response) Flush() + func (r *Response) Header() http.Header + func (r *Response) Write(b []byte) (n int, err error) + func (r *Response) WriteHeader(code int) + type SecurityConfig struct + BanDuration time.Duration + Blacklist string + BruteForce *BruteForceConfig + CORSExposeHeaders string + CORSHeaders string + CORSMethods string + CORSOrigin string + CORSRequest string + CSP string + CSRFTokenRequired bool + ContentTypeOptions bool + DNT bool + HSTS bool + HSTSDirectives string + PreventIFraming bool + URLScanner bool + Whitelist string + XSSProtection bool + type Server struct + Config *Config + func New(config *Config) (*Server, error) + func (s *Server) Restart() error + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) Start() error + func (s *Server) Stop() error v1.0.2 May 2, 2022 v1.0.1 Apr 24, 2022 v1.0.0 Apr 24, 2022