代码拉取完成,页面将自动刷新
package cServer
const ServerConfigName = "ServerConf"
type ServerConf struct {
ServerName string `json:"server_name"`
HttpServer ServerConf_HttpServer `json:"http_server"`
GrpcServer ServerConf_GrpcServer `json:"grpc_server"`
}
type ServerConf_HttpServer struct {
Enable bool `json:"enable"` // 是否启用 http 服务
Debug bool `json:"debug"` // 是否启用 pprof 工具
Port int `json:"port"` // http 端口号
ReadTimeout int `json:"read_timeout"` // 请求内容读取超时时间
WriteTimeout int `json:"write_timeout"` // 返回内容写入超时时间
IdleTimeout int `json:"idle_timeout"` // 在启用 keep-alive 的情况下,等待下一个请求的最大空闲时间。如果为零,则使用 ReadTimeout 的值
MaxHeaderBytes int `json:"max_header_bytes"` // 请求头大小
BasicAuthEnable bool `json:"basic_auth_enable"` // 是佛开启基础权限校验
BasicAuthUsers map[string]string `json:"basic_auth_users"` // 基础权限账号密码
Cross ServerConf_HttpServer_Cross `json:"cross"` // 跨域设置
}
type ServerConf_HttpServer_Cross struct {
Enable bool `json:"enable"`
AllowOrigins []string `json:"allow_origins"`
AllowMethods []string `json:"allow_methods"`
AllowHeaders []string `json:"allow_headers"`
AllowCredentials bool `json:"allow_credentials"`
AllowWebSockets bool `json:"allow_websockets"`
MaxAge int64 `json:"max_age"`
}
type ServerConf_GrpcServer struct {
Enable bool `json:"enable"` // 是否启用 grpc 服务
Port int `json:"port"` // grpc 服务端 端口
}
func (i *ServerConf) ConfigName() string {
return ServerConfigName
}
var server_config *ServerConf
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。