Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultName = "default"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Addr string `json:"addr"` // Addr 本地监听地址 Https Https `json:"https" mapstructure:"https"` // Https Https配置 Mode string `json:"mode"` // Mode 运行模式 Agent string `json:"agent"` // Agent 服务agent RootPath string `json:"rootPath"` // RootPath 网站根目录 Static Static `json:"static" mapstructure:"static"` // Static 静态资源 DumpRouter bool `json:"dumpRouter"` // DumpRouter 是否打印路由 KeepAlive bool `json:"keepAlive"` // KeepAlive 是否开启Keep-Alive功能 ReadTimeout time.Duration `json:"readTimeout"` // ReadTimeout 请求读取超时时间 WriteTimeout time.Duration `json:"writeTimeout"` // WriteTimeout 数据返回写入超时时间 IdleTimeout time.Duration `json:"idleTimeout"` // IdleTimeout 仅当Keep-Alive开启时有效,请求闲置时间 MaxHeaderBytes int `json:"maxHeaderBytes"` // MaxHeaderBytes 请求Header大小限制(Byte) ClientMaxBodySize int64 `json:"clientMaxBodySize"` // ClientMaxBodySize 客户端最大Body上传限制大小,影响文件上传大小(Byte) FormParsingMemory int64 `json:"formParsingMemory"` // FormParsingMemory 解析表单时的缓冲区大小(Byte) Cors middleware.CorsOption `json:"cors" mapstructure:"cors"` // Cors 跨域配置 Access xlog.Config `json:"access" mapstructure:"access"` // Access 请求访问日志 Error xlog.Config `json:"error" mapstructure:"error"` // Error 错误日志 }
Config 配置
type Https ¶
type Https struct { Addr string `json:"addr" yaml:"addr"` // Addr https地址 KeyPath string `json:"keyPath" yaml:"keyPath"` // KeyPath https证书key路径 CertPath string `json:"certPath" yaml:"certPath"` // CertPath https证书路径 AutoRedirect bool `json:"autoRedirect" yaml:"autoRedirect"` // AutoRedirect http自动跳转到https }
Https https配置
Click to show internal directories.
Click to hide internal directories.