@@ -42,31 +42,33 @@ type Http struct {
4242 ioc.ObjectImpl
4343
4444 // 是否开启HTTP Server, 默认会根据是否有注册得有API对象来自动开启
45- Enable * bool `json:"enable" yaml:"enable" toml:"enable" env:"ENABLE "`
45+ Enable * bool `json:"enable" yaml:"enable" toml:"enable" env:"HTTP_ENABLE "`
4646 // HTTP服务Host
47- Host string `json:"host" yaml:"host" toml:"host" env:"HOST "`
47+ Host string `json:"host" yaml:"host" toml:"host" env:"HTTP_HOST "`
4848 // HTTP服务端口
49- Port int `json:"port" yaml:"port" toml:"port" env:"PORT "`
49+ Port int `json:"port" yaml:"port" toml:"port" env:"HTTP_PORT "`
5050 // API接口前缀
51- PathPrefix string `json:"path_prefix" yaml:"path_prefix" toml:"path_prefix" env:"PATH_PREFIX "`
51+ PathPrefix string `json:"path_prefix" yaml:"path_prefix" toml:"path_prefix" env:"HTTP_PATH_PREFIX "`
5252
5353 // 使用的http框架, 默认会根据当前注册的API对象,自动选择合适的框架
54- WEB_FRAMEWORK WEB_FRAMEWORK `json:"web_framework" yaml:"web_framework" toml:"web_framework" env:"WEB_FRAMEWORK "`
54+ WEB_FRAMEWORK WEB_FRAMEWORK `json:"web_framework" yaml:"web_framework" toml:"web_framework" env:"HTTP_WEB_FRAMEWORK "`
5555
5656 // HTTP服务器参数
5757 // HTTP Header读取超时时间
58- ReadHeaderTimeoutSecond int `json:"read_header_timeout" yaml:"read_header_timeout" toml:"read_header_timeout" env:"READ_HEADER_TIMEOUT "`
58+ ReadHeaderTimeoutSecond int `json:"read_header_timeout" yaml:"read_header_timeout" toml:"read_header_timeout" env:"HTTP_READ_HEADER_TIMEOUT "`
5959 // 读取HTTP整个请求时的参数
60- ReadTimeoutSecond int `json:"read_timeout" yaml:"read_timeout" toml:"read_timeout" env:"READ_TIMEOUT "`
60+ ReadTimeoutSecond int `json:"read_timeout" yaml:"read_timeout" toml:"read_timeout" env:"HTTP_READ_TIMEOUT "`
6161 // 响应超时时间
62- WriteTimeoutSecond int `json:"write_timeout" yaml:"write_timeout" toml:"write_timeout" env:"WRITE_TIMEOUT "`
62+ WriteTimeoutSecond int `json:"write_timeout" yaml:"write_timeout" toml:"write_timeout" env:"HTTP_WRITE_TIMEOUT "`
6363 // 启用了KeepAlive时 复用TCP链接的超时时间
64- IdleTimeoutSecond int `json:"idle_timeout" yaml:"idle_timeout" toml:"idle_timeout" env:"IDLE_TIMEOUT "`
64+ IdleTimeoutSecond int `json:"idle_timeout" yaml:"idle_timeout" toml:"idle_timeout" env:"HTTP_IDLE_TIMEOUT "`
6565 // header最大大小
66- MaxHeaderSize string `json:"max_header_size" yaml:"max_header_size" toml:"max_header_size" env:"MAX_HEADER_SIZE "`
66+ MaxHeaderSize string `json:"max_header_size" yaml:"max_header_size" toml:"max_header_size" env:"HTTP_MAX_HEADER_SIZE "`
6767
6868 // 开启Trace
69- EnableTrace bool `toml:"enable_trace" json:"enable_trace" yaml:"enable_trace" env:"ENABLE_TRACE"`
69+ EnableTrace bool `toml:"enable_trace" json:"enable_trace" yaml:"enable_trace" env:"HTTP_ENABLE_TRACE"`
70+ // 开启Trace
71+ Debug bool `toml:"debug" json:"debug" yaml:"debug" env:"HTTP_DEBUG"`
7072
7173 // 解析后的数据
7274 maxHeaderBytes uint64
0 commit comments