feat: update comment
This commit is contained in:
@@ -18,10 +18,6 @@ import (
|
||||
type SetServerOptionFunc func(so *serverOption)
|
||||
|
||||
// serverOption 获取server实例的选项
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 17:28 2025/2/18
|
||||
type serverOption struct {
|
||||
swaggerUiTheme string // swagger 主题
|
||||
swaggerBaseUri string // swagger基础path
|
||||
@@ -60,10 +56,6 @@ func WithInitContextData(formatFunc func(ctx *gin.Context) map[string]any) SetSe
|
||||
}
|
||||
|
||||
// WithSwaggerUITheme 设置swaggerUI主题
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 17:29 2025/2/18
|
||||
func WithSwaggerUITheme(uiTheme string) SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
uiTheme = strings.TrimSpace(uiTheme)
|
||||
@@ -75,10 +67,6 @@ func WithSwaggerUITheme(uiTheme string) SetServerOptionFunc {
|
||||
}
|
||||
|
||||
// WithGlobalMiddlewareList 设置全局中间件
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 17:33 2025/2/18
|
||||
func WithGlobalMiddlewareList(middlewareList ...gin.HandlerFunc) SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
so.globalMiddlewareList = middlewareList
|
||||
@@ -86,10 +74,6 @@ func WithGlobalMiddlewareList(middlewareList ...gin.HandlerFunc) SetServerOption
|
||||
}
|
||||
|
||||
// WithSwaggerBaseUri ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 18:05 2025/2/18
|
||||
func WithSwaggerBaseUri(baseUri string) SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
baseUri = strings.TrimSpace(baseUri)
|
||||
@@ -102,10 +86,6 @@ func WithSwaggerBaseUri(baseUri string) SetServerOptionFunc {
|
||||
}
|
||||
|
||||
// WithDisableSwaggerDoc 禁用swagger文档
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 17:35 2025/2/18
|
||||
func WithDisableSwaggerDoc() SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
so.disableSwaggerDoc = true
|
||||
@@ -113,10 +93,6 @@ func WithDisableSwaggerDoc() SetServerOptionFunc {
|
||||
}
|
||||
|
||||
// WithServerInfo 设置serverInfo
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 17:51 2025/2/18
|
||||
func WithServerInfo(serverInfo *apiDocDefine.Info) SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
if nil == serverInfo {
|
||||
@@ -127,10 +103,6 @@ func WithServerInfo(serverInfo *apiDocDefine.Info) SetServerOptionFunc {
|
||||
}
|
||||
|
||||
// WithServerList 设置服务器列表
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 17:52 2025/2/18
|
||||
func WithServerList(serverList []*apiDocDefine.ServerItem) SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
if len(serverList) == 0 {
|
||||
@@ -141,10 +113,6 @@ func WithServerList(serverList []*apiDocDefine.ServerItem) SetServerOptionFunc {
|
||||
}
|
||||
|
||||
// WithPprofEnable 启用pprof
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 15:10 2025/2/21
|
||||
func WithPprofEnable() SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
so.enablePprof = true
|
||||
@@ -152,10 +120,6 @@ func WithPprofEnable() SetServerOptionFunc {
|
||||
}
|
||||
|
||||
// WithEnableCors 启用全局跨域
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 14:56 2025/2/22
|
||||
func WithEnableCors() SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
so.enableCors = true
|
||||
@@ -163,10 +127,6 @@ func WithEnableCors() SetServerOptionFunc {
|
||||
}
|
||||
|
||||
// WithLoggerCfg ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 15:25 2025/2/22
|
||||
func WithLoggerCfg(loggerCfg *middleware.AccessConfig) SetServerOptionFunc {
|
||||
return func(so *serverOption) {
|
||||
if nil != loggerCfg || nil != loggerCfg.Logger {
|
||||
|
||||
Reference in New Issue
Block a user