Documentation ¶
Index ¶
- type Application
- type Context
- type ICache
- type IHttpErrorHandler
- type IMiddleware
- type IRouter
- type Kernel
- type Pipeline
- type Request
- func (c *Request) Bind(t any)
- func (c *Request) FileVar() *param.Helper[*param.RequestParamItems[*param.File]]
- func (c *Request) IsAjax() bool
- func (c *Request) IsDelete() bool
- func (c *Request) IsGet() bool
- func (c *Request) IsOption() bool
- func (c *Request) IsPost() bool
- func (c *Request) IsPut() bool
- func (c *Request) JsonBind(t any)
- func (c *Request) ParamVar() *param.Helper[*param.RequestParamItems[string]]
- func (c *Request) PostVar() *param.Helper[*param.RequestParamItems[string]]
- func (c *Request) Raw() *http.Request
- type Response
- func (c *Response) Code(code int)
- func (c *Response) Download(file *param.File, basename string) error
- func (c *Response) GetCode() int
- func (c *Response) Header(key, value string) *Response
- func (c *Response) Html(s string, code ...int)
- func (c *Response) Json(o any, code ...int)
- func (c *Response) Raw() http.ResponseWriter
- func (c *Response) Redirect(uri string, code ...int)
- func (c *Response) Text(s string, code ...int)
- type Router
- func (r *Router) ANY(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- func (r *Router) CONNECT(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- func (r *Router) DELETE(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- func (r *Router) GET(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- func (r *Router) Group(path string, fn func(r *Router), middleware ...IMiddleware)
- func (r *Router) HEAD(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- func (r *Router) Miss(f func(*Context)) *Router
- func (r *Router) OPTION(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- func (r *Router) PATCH(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- func (r *Router) POST(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- func (r *Router) PUT(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- func (r *Router) RequestPathId(path string, method constant.RequestMethod) string
- func (r *Router) Route(path string, requestMethod constant.RequestMethod) (func(*Context), *param.RequestParamPairs[*param.RequestParamItems[string]], ...)
- func (r *Router) TRACE(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
- type RouterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func New ¶
func New() *Application
func (*Application) Pprof ¶
func (a *Application) Pprof() *Application
func (*Application) PrintMeta ¶
func (a *Application) PrintMeta()
func (*Application) Router ¶
func (a *Application) Router(router IRouter) *Application
func (*Application) Run ¶
func (a *Application) Run(port ...int)
func (*Application) Use ¶
func (a *Application) Use(m ...IMiddleware) *Application
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext() *Context
type IHttpErrorHandler ¶
type IMiddleware ¶
type IRouter ¶
type IRouter interface {
Route(path string, method constant.RequestMethod) (func(*Context), *param.RequestParamPairs[*param.RequestParamItems[string]], []IMiddleware)
}
type Kernel ¶
type Kernel struct {
// contains filtered or unexported fields
}
func (*Kernel) Through ¶
func (k *Kernel) Through(middleware []IMiddleware) *Kernel
type Pipeline ¶
type Pipeline[T any] struct { // contains filtered or unexported fields }
func NewPipeline ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest( req *http.Request, routerParams *param.RequestParamPairs[*param.RequestParamItems[string]], ) *Request
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse(w http.ResponseWriter, request *http.Request) *Response
func (*Response) Raw ¶
func (c *Response) Raw() http.ResponseWriter
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) ANY ¶
func (r *Router) ANY(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
func (*Router) CONNECT ¶
func (r *Router) CONNECT(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
func (*Router) DELETE ¶
func (r *Router) DELETE(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
func (*Router) GET ¶
func (r *Router) GET(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
func (*Router) Group ¶
func (r *Router) Group(path string, fn func(r *Router), middleware ...IMiddleware)
func (*Router) HEAD ¶
func (r *Router) HEAD(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
func (*Router) OPTION ¶
func (r *Router) OPTION(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
func (*Router) PATCH ¶
func (r *Router) PATCH(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
func (*Router) POST ¶
func (r *Router) POST(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
func (*Router) PUT ¶
func (r *Router) PUT(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
func (*Router) RequestPathId ¶
func (r *Router) RequestPathId(path string, method constant.RequestMethod) string
func (*Router) Route ¶
func (r *Router) Route( path string, requestMethod constant.RequestMethod, ) (func(*Context), *param.RequestParamPairs[*param.RequestParamItems[string]], []IMiddleware)
func (*Router) TRACE ¶
func (r *Router) TRACE(path string, f func(*Context), middleware ...IMiddleware) *RouterConfig
type RouterConfig ¶
type RouterConfig struct {
// contains filtered or unexported fields
}
func (*RouterConfig) Name ¶
func (a *RouterConfig) Name(name string) *RouterConfig
Source Files ¶
Click to show internal directories.
Click to hide internal directories.