Versions in this module Expand all Collapse all v1 v1.0.0 Aug 15, 2017 Changes in this version + const CONNECT + const DELETE + const GET + const HEAD + const HeaderAllow + const MethodDELETE + const MethodGET + const MethodHEAD + const MethodOPTIONS + const MethodPATCH + const MethodPOST + const MethodPUT + const OPTIONS + const PATCH + const POST + const PUT + const PathAny + const PathSlash + const PathSlashAny + const Slash + const Version + var DefaultContentType = []byte("text/plain; charset=utf-8") + var ErrArgNotFound = errors.New("undefined argument") + var ErrEmptyMiddleware = errors.New("can't use nil middleware") + var ErrTLSNoEmails = errors.New("auto tls: no emails provided") + var ErrUnsupportedMiddlewareType = errors.New("unsupported middleware type") + var Logger = &log.Logger + var QuestionMark = []byte("?") + var SlashByte = byte('/') + func CleanPath(p string) string + func Errorf(msg string, v ...interface{}) + func Nanotime() int64 + func UnJSONBytes(b []byte, v ...interface{}) (interface{}, error) + type App struct + EnableFirewall bool + Flags *Flags + HandleUnknownDomains bool + Logger log.Interface + Settings Settings + TLSEmails []string + func New() *App + func (app *App) AddFlag(f Flag) + func (app *App) CORSMiddleware() func(*Context) + func (app *App) DELETE(route string, handler interface{}) *App + func (app *App) Domain(domain string) *Router + func (app *App) Forbidden(ctx *Context) + func (app *App) GET(route string, handler interface{}) *App + func (app *App) HEAD(route string, handler interface{}) *App + func (app *App) HTTP() *Router + func (app *App) HTTPS() *Router + func (app *App) Handle(method, route string, handler interface{}) *App + func (app *App) HandleMethodNotAllowed(newValue bool) (oldValue bool) + func (app *App) HandleOPTIONS(newValue bool) (oldValue bool) + func (app *App) Health() + func (app *App) HealthHandler(ctx *Context) + func (app *App) JSON(route string, handler interface{}) *App + func (app *App) ListenAndServe(addr ...string) error + func (app *App) ListenAndServeAll(httpAddr ...string) + func (app *App) ListenAndServeAllDev(httpAddr ...string) + func (app *App) ListenAndServeAutoTLS(addr string, cachePath ...string) error + func (app *App) ListenAndServeAutoTLSDev(addr string, cachePath ...string) error + func (app *App) MethodNotAllowed(c func(ctx *Context)) *App + func (app *App) NotFound(notFoundHandler func(*Context)) *App + func (app *App) OPTIONS(route string, handler interface{}) *App + func (app *App) PATCH(route string, handler interface{}) *App + func (app *App) POST(route string, handler interface{}) *App + func (app *App) PUT(route string, handler interface{}) *App + func (app *App) PanicHandler(panicHandler func(*Context, interface{})) *App + func (app *App) Redir(url string) func(*Context) + func (app *App) RegFlags() + func (app *App) SPAIndex(path string) *Router + func (app *App) Serve(ln net.Listener) error + func (app *App) ServeDir(path string) func(*Context) + func (app *App) ServeDirCustom(path string, stripSlashes int, compress bool, generateIndexPages bool, ...) func(*Context) + func (app *App) ServeDirNoCache(path string) func(*Context) + func (app *App) ServeDirNoCacheCustom(path string, stripSlashes int, compress bool, generateIndexPages bool, ...) func(*Context) + func (app *App) ServeFile(route, file string) *Router + func (app *App) ServeInfrastructure(i *infrastructure.Infrastructure) + func (app *App) Sub(path string) *SubRouter + func (app *App) ToTLSHandler() func(*Context) + func (app *App) Use(middleware interface{}) error + func (app *App) UseAfterRequest(middleware interface{}) error + func (app *App) UsePre(middleware interface{}) error + type Context struct + App *App + Cookies Cookies + Logger log.Interface + func (c *Context) CORS() *Context + func (c *Context) Err500(message ...interface{}) *Context + func (c *Context) Forbidden() + func (c *Context) GETKeys() []string + func (c *Context) GETKeysBytes() [][]byte + func (c *Context) GETParam(argName string) []string + func (c *Context) GETParams() map[string][]string + func (c *Context) HTML() *Context + func (c *Context) JSON(v interface{}) error + func (c *Context) JSONError(v interface{}) error + func (c *Context) RouteArg(argName string) string + func (c *Context) RouteArgErr(argName string) (string, error) + func (c *Context) ToJSON(v interface{}) ([]byte, error) + func (c *Context) ToTLS() + func (c *Context) UnJSON(v interface{}) error + func (c *Context) UnJSONBytes(b []byte, v ...interface{}) (interface{}, error) + func (c *Context) Writef(format string, a ...interface{}) + func (c *Context) Writeln(a ...interface{}) + func (ctx *Context) LogHeaders() + func (ctx *Context) Proxy(url string) error + type Cookies struct + Mu sync.RWMutex + Storage map[string]string + func (c *Cookies) Exists(key string) bool + func (c *Cookies) Get(key string) (string, bool) + func (c *Cookies) Set(key, value string) + type FirewallSettings struct + BlockTimeout int64 + MaxReqPerMin int64 + type Flag struct + Default string + Description string + Name string + Value *string + type Flags struct + type RequestHandler func(*Context) + func NewGrameHandler(h http.Handler) RequestHandler + func NewGrameHandlerFunc(h http.HandlerFunc) RequestHandler + type RequestHandlerErr func(*Context) error + type Router struct + func (r *Router) Allowed(path, reqMethod string) (allow string) + func (r *Router) DELETE(route string, handler interface{}) *Router + func (r *Router) Forbidden(ctx *Context) + func (r *Router) GET(route string, handler interface{}) *Router + func (r *Router) HEAD(route string, handler interface{}) *Router + func (r *Router) HTTP() *Router + func (r *Router) HTTPS() *Router + func (r *Router) Handle(method, route string, handler interface{}) *Router + func (r *Router) HandleMethodNotAllowed(newValue bool) (oldValue bool) + func (r *Router) HandleOPTIONS(newValue bool) (oldValue bool) + func (r *Router) Handler() func(*Context) + func (r *Router) JSON(route string, handler interface{}) *Router + func (r *Router) Lookup(method, path string, ctx *Context) (RequestHandler, bool) + func (r *Router) MethodNotAllowed(c func(ctx *Context)) + func (r *Router) NotFound(notFoundHandler func(*Context)) + func (r *Router) OPTIONS(route string, handler interface{}) *Router + func (r *Router) PATCH(route string, handler interface{}) *Router + func (r *Router) POST(route string, handler interface{}) *Router + func (r *Router) PUT(route string, handler interface{}) *Router + func (r *Router) PanicHandler(panicHandler func(*Context, interface{})) + func (r *Router) Redir(route, url string) + func (r *Router) SPAIndex(path string) *Router + func (r *Router) ServeFile(route, file string) *Router + func (r *Router) ServeFiles(path string, rootPath string) + func (r *Router) Sub(path string) *SubRouter + type Settings struct + Firewall FirewallSettings + type SubRouter struct + func (r *SubRouter) DELETE(route string, handler interface{}) *SubRouter + func (r *SubRouter) Forbidden(ctx *Context) + func (r *SubRouter) GET(route string, handler interface{}) *SubRouter + func (r *SubRouter) HEAD(route string, handler interface{}) *SubRouter + func (r *SubRouter) HTTP() *SubRouter + func (r *SubRouter) HTTPS() *SubRouter + func (r *SubRouter) JSON(route string, handler interface{}) *SubRouter + func (r *SubRouter) OPTIONS(route string, handler interface{}) *SubRouter + func (r *SubRouter) PATCH(route string, handler interface{}) *SubRouter + func (r *SubRouter) POST(route string, handler interface{}) *SubRouter + func (r *SubRouter) PUT(route string, handler interface{}) *SubRouter + func (r *SubRouter) Redir(route, url string) + func (r *SubRouter) ServeFile(route, file string) *SubRouter + func (r *SubRouter) Sub(path string) *SubRouter + func (r *SubRouter) ToTLSHandler() func(*Context)