支持注册pprof相关路由
This commit is contained in:
@ -27,6 +27,7 @@ type serverOption struct {
|
||||
disableSwaggerDoc bool // 禁用swagger文档, 特定环境不想展示文档, 可通过次方式禁用
|
||||
serverInfo *apiDocDefine.Info // 服务器信息
|
||||
serverList []*apiDocDefine.ServerItem // 服务器环境列表
|
||||
enablePprof bool // 启用pprof
|
||||
}
|
||||
|
||||
// WithSwaggerUITheme 设置swaggerUI主题
|
||||
@ -109,3 +110,14 @@ func WithServerList(serverList []*apiDocDefine.ServerItem) SetServerOptionFunc {
|
||||
so.serverList = serverList
|
||||
}
|
||||
}
|
||||
|
||||
// WithPprofEnable 启用pprof
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 15:10 2025/2/21
|
||||
func WithPprofEnable() SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
so.enablePprof = true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user