Versions in this module Expand all Collapse all v1 v1.0.0 Sep 4, 2026 Changes in this version + var HandleException func(err interface{}) *Response + var ResolveSignatureKey func() string + func CleanValue(val interface{}) interface + func FormatContent(v interface{}) string + func Method(method ...string) []string + func NewStaticHandle(prefixAndRoot ...string) http.Handler + func PrepareResponse(request *Request, rule *Rule, result interface{}) interface + func RunRoute(request *Request, rule *Rule, params ...[]*parameter) interface + type Closure func(req *Request) any + type Compiled struct + Regex string + Regexp *regexp.Regexp + type Config struct + CookieName string + Driver string + Encrypt bool + Files string + Lifetime time.Duration + func DefaultSessionConfig() *Config + type Cookie struct + Config *CookieConfig + func ParseCookieHandler(cfg ...*CookieConfig) *Cookie + func (c *Cookie) Set(name interface{}, params ...interface{}) (*http.Cookie, error) + type CookieConfig struct + Domain string + ExpiresDuration time.Duration + HttpOnly bool + MaxAge int + Path string + Prefix string + Raw string + RawExpires string + Secure bool + Unparsed []string + func DefaultCookieConfig() *CookieConfig + type CookieMiddleware struct + func (m *CookieMiddleware) Process(req *Request, next Closure) any + type CorsConfig struct + AllowCredentials bool + AllowHeaders []string + AllowMethods []string + AllowOrigins []string + ExposeHeaders []string + MaxAge int + func DefaultCorsConfig() CorsConfig + type CorsHandler = CorsMiddleware + type CorsMiddleware struct + func (h *CorsMiddleware) Process(req *Request, next Closure) interface{} + type File struct + FileHeader *multipart.FileHeader + func (f *File) Move(directory string, name ...string) (bool, error) + type Handler interface + Process func(request *Request, next Closure) any + func NewCookieMiddleware(cfg ...*CookieConfig) Handler + func NewCorsHandler(config ...CorsConfig) Handler + func NewCorsMiddleware(config ...CorsConfig) Handler + func NewRecoverHandler(debug bool) Handler + func NewRecoverMiddleware(debug bool) Handler + func NewRouteHandler(r Router) Handler + func NewRouteMiddleware(r Router) Handler + func NewSessionMiddleware(cfg *Config) Handler + func NewTrimStringsHandler(except ...string) Handler + func NewTrimStringsMiddleware(except ...string) Handler + func NewValidateSignatureHandler(r ...Router) Handler + func NewValidateSignatureMiddleware(r ...Router) Handler + type HandlerFunc func(request *Request, next Closure) any + func (f HandlerFunc) Process(request *Request, next Closure) any + type Manager struct + Config *Config + func NewManager(config *Config) *Manager + func (m *Manager) Extend(driver string, handler session.SessionHandler) *Manager + func (m *Manager) SessionSave(res *Response, store *session.Store) + func (m *Manager) SessionStart(req *Request) *session.Store + type Middleware func(request *Request, next Closure) any + type Option func(*Route) + func WithParameterResolver(resolver ParameterResolver) Option + func WithSignatureKey(key string) Option + type Param struct + Key string + Value string + type ParameterResolver interface + ResolveParameter func(paramType reflect.Type, request *Request) (reflect.Value, bool) + type ParameterResolverFunc func(paramType reflect.Type, request *Request) (reflect.Value, bool) + func (f ParameterResolverFunc) ResolveParameter(paramType reflect.Type, request *Request) (reflect.Value, bool) + type ParameterizedMiddleware func(params ...string) Middleware + type Params []Param + func (ps Params) Get(name string) (string, bool) + type Pipeline struct + func NewPipeline() *Pipeline + func (p *Pipeline) Pipe(m Handler) *Pipeline + func (p *Pipeline) Send(req *Request) *Pipeline + func (p *Pipeline) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (p *Pipeline) Then(destination Closure) any + func (p *Pipeline) ThenReturn() any + func (p *Pipeline) Through(hls []Handler) *Pipeline + type RecoverHandler = RecoverMiddleware + type RecoverMiddleware struct + func (h *RecoverMiddleware) Process(req *Request, next Closure) (result interface{}) + type Request struct + CookieHandler *Cookie + Request *http.Request + func NewRequest(req *http.Request) *Request + func (r *Request) All(keys ...string) map[string]string + func (r *Request) AllFiles() (map[string]*File, error) + func (r *Request) BearerToken() string + func (r *Request) Boolean(key string, defaultValue ...bool) bool + func (r *Request) ClientIP() string + func (r *Request) Context() context.Context + func (r *Request) Cookie(key string, value ...string) (string, error) + func (r *Request) Except(keys ...string) map[string]string + func (r *Request) Exists(keys ...string) bool + func (r *Request) ExpectsJson() bool + func (r *Request) File(key string) (*File, error) + func (r *Request) Filled(keys ...string) bool + func (r *Request) Fingerprint() string + func (r *Request) Float(key string, defaultValue ...float64) float64 + func (r *Request) FullUrl() string + func (r *Request) FullUrlWithQuery(query map[string]string) string + func (r *Request) FullUrlWithoutQuery(keys ...string) string + func (r *Request) Get(key string) (value interface{}, exists bool) + func (r *Request) GetContent() ([]byte, error) + func (r *Request) GetHttpRequest() *http.Request + func (r *Request) GetMethod() string + func (r *Request) GetPath() string + func (r *Request) GetRouteParam(key string, defaultValue ...string) string + func (r *Request) Has(keys ...string) bool + func (r *Request) HasAny(keys ...string) bool + func (r *Request) HasFile(key string) bool + func (r *Request) Header(key string) string + func (r *Request) Input(key string, value ...string) (string, error) + func (r *Request) Integer(key string, defaultValue ...int) int + func (r *Request) Is(patterns ...string) bool + func (r *Request) IsAjax() bool + func (r *Request) IsMethod(m string) bool + func (r *Request) Merge(values map[string]string) *Request + func (r *Request) Method() string + func (r *Request) Missing(keys ...string) bool + func (r *Request) Only(keys ...string) map[string]string + func (r *Request) Path() string + func (r *Request) Post(key string, value ...string) (string, error) + func (r *Request) Query(key string, value ...string) (string, error) + func (r *Request) ResponseWriter() http.ResponseWriter + func (r *Request) RouteIs(patterns ...string) bool + func (r *Request) RouteMiddlewares() []interface{} + func (r *Request) RouteParam(key string, defaultValue ...string) (string, error) + func (r *Request) Segment(index int, defaultValue ...string) string + func (r *Request) Segments() []string + func (r *Request) Session() session.Session + func (r *Request) Set(key string, value interface{}) + func (r *Request) SetCookieHandler(handler *Cookie) + func (r *Request) SetResponseWriter(w http.ResponseWriter) *Request + func (r *Request) SetRouteMiddlewares(middlewares []interface{}) + func (r *Request) SetRouteParam(name, value string) + func (r *Request) SetSession(s session.Session) + func (r *Request) Url() string + func (r *Request) UserAgent() string + func (r *Request) WantsJson() bool + func (r *Request) WithContext(ctx context.Context) *Request + type Response struct + CookieHandler *Cookie + Header *http.Header + Request *Request + func Download(filePath string, filename ...string) *Response + func DownloadResponse(filePath string, filename ...string) *Response + func ErrorResponse() *Response + func FileResponse(filepath string) *Response + func HandledResponse() *Response + func Html(s string) *Response + func Json(v interface{}) *Response + func MakeResponse(v interface{}) *Response + func NewResponse() *Response + func NoContent(status ...int) *Response + func NotFoundResponse() *Response + func Redirect(to string, status ...int) *Response + func StreamDownload(streamFunc func(w io.Writer) bool, filename string) *Response + func StreamResponse(streamFunc func(w io.Writer) bool) *Response + func Text(s string) *Response + func (r *Response) Cookie(name interface{}, params ...interface{}) error + func (r *Response) GetCharset() string + func (r *Response) GetCode() int + func (r *Response) GetContent() string + func (r *Response) GetContentType() string + func (r *Response) GetCookies() map[string]*http.Cookie + func (r *Response) IsHandled() bool + func (r *Response) Send(w http.ResponseWriter) + func (r *Response) SetCharset(val string) *Response + func (r *Response) SetCode(val int) *Response + func (r *Response) SetContent(val string) *Response + func (r *Response) SetContentType(val string) *Response + func (r *Response) SetCookieHandler(handler *Cookie) *Response + func (r *Response) SetFile(filepath string) *Response + func (r *Response) SetRequest(req *Request) *Response + func (r *Response) SetStream(streamFunc func(w io.Writer) bool) *Response + type Route struct + func New(opts ...Option) *Route + func (r *Route) Add(method []string, pattern string, handler interface{}) Router + func (r *Route) AddRule(rule *Rule) *Rule + func (r *Route) AliasMiddleware(name string, middleware interface{}) Router + func (r *Route) Any(pattern string, handler interface{}) Router + func (r *Route) CurrentRouteName(req *Request) string + func (r *Route) Delete(pattern string, handler interface{}) Router + func (r *Route) Dispatch(request *Request) interface{} + func (r *Route) Dump() []byte + func (r *Route) Fallback(handler interface{}) + func (r *Route) Get(pattern string, handler interface{}) Router + func (r *Route) GetMiddlewareGroup(name string) []interface{} + func (r *Route) GetRouteMiddleware(name string) interface{} + func (r *Route) Group(callback func(group Router)) + func (r *Route) Has(name string) bool + func (r *Route) HasValidSignature(req *Request) bool + func (r *Route) Head(pattern string, handler interface{}) Router + func (r *Route) Is(req *Request, patterns ...string) bool + func (r *Route) Match(request *Request) (*Rule, []*parameter, error) + func (r *Route) MatchRequest(request *Request) (*Rule, []*parameter, error) + func (r *Route) Middleware(middlewares ...interface{}) Router + func (r *Route) MiddlewareGroup(name string, middlewares ...interface{}) Router + func (r *Route) Name(name string) Router + func (r *Route) Options(pattern string, handler interface{}) Router + func (r *Route) Patch(pattern string, handler interface{}) Router + func (r *Route) Pattern(name string, expression string) + func (r *Route) Post(pattern string, handler interface{}) Router + func (r *Route) Prefix(prefix string) Router + func (r *Route) Put(pattern string, handler interface{}) Router + func (r *Route) Register() + func (r *Route) SignedUrl(name string, expiration time.Duration, params map[string]string) string + func (r *Route) Static(path, root string) + func (r *Route) Statics(statics map[string]string) + func (r *Route) Url(name string, params map[string]string) string + func (r *Route) Where(name string, expression string) Router + func (r *Route) WhereAlpha(names ...string) Router + func (r *Route) WhereIn(name string, allowed []string) Router + func (r *Route) WhereNumber(names ...string) Router + type RouteHandler = RouteMiddleware + type RouteMiddleware struct + Router Router + func (h *RouteMiddleware) Process(request *Request, next Closure) interface{} + type RouteRequest interface + GetMethod func() string + GetPath func() string + type Router interface + Add func(method []string, pattern string, handler interface{}) Router + AliasMiddleware func(name string, middleware interface{}) Router + Any func(pattern string, handler interface{}) Router + CurrentRouteName func(req *Request) string + Delete func(pattern string, handler interface{}) Router + Dispatch func(request *Request) interface{} + Dump func() []byte + Fallback func(handler interface{}) + Get func(pattern string, handler interface{}) Router + GetMiddlewareGroup func(name string) []interface{} + GetRouteMiddleware func(name string) interface{} + Group func(callback func(group Router)) + Has func(name string) bool + HasValidSignature func(req *Request) bool + Is func(req *Request, patterns ...string) bool + Middleware func(middlewares ...interface{}) Router + MiddlewareGroup func(name string, middlewares ...interface{}) Router + Name func(name string) Router + Options func(pattern string, handler interface{}) Router + Patch func(pattern string, handler interface{}) Router + Post func(pattern string, handler interface{}) Router + Prefix func(prefix string) Router + Put func(pattern string, handler interface{}) Router + Register func() + SignedUrl func(name string, expiration time.Duration, params map[string]string) string + Url func(name string, params map[string]string) string + Where func(name string, expression string) Router + WhereAlpha func(names ...string) Router + WhereIn func(name string, allowed []string) Router + WhereNumber func(names ...string) Router + type Rule struct + Compiled *Compiled + func (r *Rule) Bind(req *Request, path string, treeParams ...[]*parameter) []*parameter + func (r *Rule) GatherRouteMiddleware() []interface{} + func (r *Rule) Matches(method, path string) bool + func (r *Rule) Middleware(middlewares ...interface{}) *Rule + func (r *Rule) Run(request *Request, params ...[]*parameter) (result interface{}) + func (r *Rule) ValidateParams(params []*parameter) bool + type SessionMiddleware struct + Manager *Manager + func (h *SessionMiddleware) Process(req *Request, next Closure) interface{} + type Terminable interface + Terminate func(request *Request, response any) + type TrimStringsHandler = TrimStringsMiddleware + type TrimStringsMiddleware struct + func (h *TrimStringsMiddleware) Process(req *Request, next Closure) interface{} + type ValidateSignatureHandler = ValidateSignatureMiddleware + type ValidateSignatureMiddleware struct + func (h *ValidateSignatureMiddleware) Process(req *Request, next Closure) interface{}