Versions in this module Expand all Collapse all v1 v1.0.2 Nov 26, 2023 Changes in this version + var AlreadySentError = errors.New("the response was already sent") + var ContextKey = chainContextKey + func Crypto() *cryptoShortcuts + func HashCrc32(content []byte) string + func HashMD5(text string) string + func NewKeyring(salt string, iterations int, length int, digest string) *crypto.Keyring + func NewUID() (uid string) + func NodeName() string + func SecretKeyBase() string + func SecretKeySync(sync SecretKeySyncFunc) (cancel func()) + func SecretKeys() []string + func SetNodeName(name string) + func SetSecretKeyBase(secret string) error + type Context struct + Crypto *cryptoShortcuts + MatchedRoutePath string + Request *http.Request + Writer http.ResponseWriter + func GetContext(ctx context.Context) *Context + func (ctx *Context) AddHeader(key, value string) + func (ctx *Context) AfterSend(callback func()) error + func (ctx *Context) BeforeSend(callback func()) error + func (ctx *Context) DeleteCookie(name string) + func (ctx *Context) Error(error string, code int) + func (ctx *Context) Get(key any) any + func (ctx *Context) GetCookie(name string) *http.Cookie + func (ctx *Context) GetHeader(key string) string + func (ctx *Context) GetParam(name string) string + func (ctx *Context) GetParamByIndex(index int) string + func (ctx *Context) Header() http.Header + func (ctx *Context) NewUID() (uid string) + func (ctx *Context) NotFound() + func (ctx *Context) Redirect(url string, code int) + func (ctx *Context) Router() *Router + func (ctx *Context) Set(key any, value any) + func (ctx *Context) SetCookie(cookie *http.Cookie) + func (ctx *Context) SetHeader(key, value string) + func (ctx *Context) WithParams(names []string, values []string) *Context + func (ctx *Context) Write(data []byte) (int, error) + func (ctx *Context) WriteHeader(statusCode int) + type Group interface + Configure func(route string, configurator RouteConfigurator) + DELETE func(route string, handle any) + GET func(route string, handle any) + Group func(route string) Group + HEAD func(route string, handle any) + Handle func(method string, route string, handle any) + OPTIONS func(route string, handle any) + PATCH func(route string, handle any) + POST func(route string, handle any) + PUT func(route string, handle any) + Use func(args ...any) Group + type Handle func(*Context) error + type JsonSerializer struct + func (s *JsonSerializer) Decode(data []byte, v any) (any, error) + func (s *JsonSerializer) Encode(v any) ([]byte, error) + type Middleware struct + Handle func(ctx *Context, next func() error) error + Path *PathDetails + type MiddlewareHandler interface + Handle func(ctx *Context, next func() error) error + type MiddlewareWithInitHandler interface + Handle func(ctx *Context, next func() error) error + Init func(method string, path string, router *Router) + type PathDetails struct + func ParsePathDetails(pathOrig string) *PathDetails + func (d PathDetails) FastMatch(ctx *Context) bool + func (d PathDetails) Match(ctx *Context) (match bool, paramNames []string, paramValues []string) + func (d PathDetails) MaybeMatches(o *PathDetails) bool + func (d PathDetails) ReplacePath(ctx *Context) string + func (d PathDetails) String() string + type Registry struct + type ResponseWriterSpy struct + func (w *ResponseWriterSpy) Write(b []byte) (int, error) + func (w *ResponseWriterSpy) WriteHeader(status int) + type Route struct + Handle Handle + Middlewares []*Middleware + Path *PathDetails + func (r *Route) Dispatch(ctx *Context) error + type RouteConfigurator interface + Configure func(router *Router, path string) + type RouteStorage struct + type Router struct + Crypto cryptoShortcuts + ErrorHandler func(*Context, error) + GlobalOPTIONSHandler http.Handler + HandleMethodNotAllowed bool + HandleOPTIONS bool + MethodNotAllowedHandler http.Handler + NotFoundHandler http.Handler + PanicHandler func(http.ResponseWriter, *http.Request, any) + RedirectFixedPath bool + RedirectTrailingSlash bool + func New() *Router + func (r *Router) Configure(route string, configurator RouteConfigurator) + func (r *Router) DELETE(route string, handle any) + func (r *Router) GET(route string, handle any) + func (r *Router) GetContext(req *http.Request, w http.ResponseWriter, path string) *Context + func (r *Router) Group(route string) Group + func (r *Router) HEAD(route string, handle any) + func (r *Router) Handle(method string, route string, handle any) + func (r *Router) Lookup(method string, path string) (*Route, *Context) + func (r *Router) OPTIONS(route string, handle any) + func (r *Router) PATCH(route string, handle any) + func (r *Router) POST(route string, handle any) + func (r *Router) PUT(route string, handle any) + func (r *Router) PutContext(ctx *Context) + func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (r *Router) Use(args ...any) Group + type RouterGroup struct + func (r *RouterGroup) Configure(route string, configurator RouteConfigurator) + func (r *RouterGroup) DELETE(route string, handle any) + func (r *RouterGroup) GET(route string, handle any) + func (r *RouterGroup) Group(route string) Group + func (r *RouterGroup) HEAD(route string, handle any) + func (r *RouterGroup) Handle(method string, route string, handle any) + func (r *RouterGroup) OPTIONS(route string, handle any) + func (r *RouterGroup) PATCH(route string, handle any) + func (r *RouterGroup) POST(route string, handle any) + func (r *RouterGroup) PUT(route string, handle any) + func (r *RouterGroup) Use(args ...any) Group + type SecretKeySyncFunc func(key string) + type Serializer interface + Decode func(data []byte, v any) (any, error) + Encode func(v any) ([]byte, error)