Documentation
¶
Index ¶
- func LogFormat(r *Request, content any) string
- func MiddlewareHandlerCORS(r *Request)
- func MiddlewareHandlerResponse(r *Request)
- type Group
- func (r *Group) ALL(prefix string, object any)
- func (r *Group) Bind(method Method, prefix string, object any)
- func (r *Group) CONNECT(prefix string, object any)
- func (r *Group) DELETE(prefix string, object any)
- func (r *Group) GET(prefix string, object any)
- func (r *Group) HEAD(prefix string, object any)
- func (r *Group) OPTIONS(prefix string, object any)
- func (r *Group) PATCH(prefix string, object any)
- func (r *Group) POST(prefix string, object any)
- func (r *Group) PUT(prefix string, object any)
- func (r *Group) TRACE(prefix string, object any)
- func (r *Group) Use(middleware ...Middleware)
- type HTTPRouter
- func (r *HTTPRouter) AddBind(bindObject ...any)
- func (r *HTTPRouter) AddMiddleware(middleware ...Middleware)
- func (r *HTTPRouter) AddStaticPath(uri, file string)
- func (r *HTTPRouter) Group(prefix string, f func(group *Group))
- func (h *HTTPRouter) Register(s server.Server)
- func (r *HTTPRouter) SetGroupsPrefix(prefix string)
- func (r *HTTPRouter) SetStaticRoot(root string)
- type HTTPServer
- type Meta
- type Method
- type Middleware
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MiddlewareHandlerCORS ¶
func MiddlewareHandlerCORS(r *Request)
MiddlewareHandlerCORS HTTP 中间件 - CORS 处理
func MiddlewareHandlerResponse ¶
func MiddlewareHandlerResponse(r *Request)
MiddlewareHandlerResponse HTTP 中间件 - 响应处理
Types ¶
type HTTPRouter ¶
HTTPRouter HTTP 路由
func (*HTTPRouter) AddMiddleware ¶
func (r *HTTPRouter) AddMiddleware(middleware ...Middleware)
AddMiddleware 添加中间件
func (*HTTPRouter) AddStaticPath ¶
func (r *HTTPRouter) AddStaticPath(uri, file string)
AddStaticPath 添加静态文件路由
func (*HTTPRouter) Group ¶
func (r *HTTPRouter) Group(prefix string, f func(group *Group))
Group 创建路由组
func (*HTTPRouter) SetGroupsPrefix ¶
func (r *HTTPRouter) SetGroupsPrefix(prefix string)
SetGroupsPrefix 设置路由组前缀
func (*HTTPRouter) SetStaticRoot ¶
func (r *HTTPRouter) SetStaticRoot(root string)
SetStaticRoot 设置静态文件根目录
type HTTPServer ¶
HTTPServer HTTP服务
Click to show internal directories.
Click to hide internal directories.