Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupStaticFileSupport ¶
func SetupStaticFileSupport(address string, folder string, displayDir ...bool) webapi.Middleware
SetupStaticFileSupport 静态文件支持
Types ¶
type AccessLogger ¶
type AccessLogger struct {
// contains filtered or unexported fields
}
AccessLogger 访问记录器
func SetupAccessLogger ¶
func SetupAccessLogger(logger ...webapi.LogService) (accesslogger *AccessLogger)
SetupAccessLogger 设置访问日志
func (*AccessLogger) Invoke ¶
func (logger *AccessLogger) Invoke(ctx *webapi.Context, next webapi.HTTPHandler)
Invoke 记录访问日志
type Recovery ¶
type Recovery struct {
// contains filtered or unexported fields
}
Recovery panic错误捕获中间件
func SetupRecoveryHandler ¶
SetupRecoveryHandler 设置重启中间件的自定义错误处理函数,handler函数不能再次出现未处理的panic,否则服务将中断退出
type StaticFileHandler ¶
type StaticFileHandler struct {
// contains filtered or unexported fields
}
StaticFileHandler 静态文件
func (*StaticFileHandler) Invoke ¶
func (handler *StaticFileHandler) Invoke(ctx *webapi.Context, next webapi.HTTPHandler)
Invoke 中间件调用约定
Click to show internal directories.
Click to hide internal directories.