@@ -121,7 +121,7 @@ func Close() {
121
121
//SourceConfig can't hot update
122
122
type sourceConfig struct {
123
123
Rpc *RpcConfig $json:"rpc"$
124
- Http *HttpConfig $json:"http "$
124
+ Web *WebConfig $json:"web "$
125
125
DB map[string]*DBConfig $json:"db"$ //key xx_db
126
126
Redis map[string]*RedisConfig $json:"redis"$ //key xx_redis
127
127
KafkaPub map[string]*KafkaPubConfig $json:"kafka_pub"$ //key topic name
@@ -138,20 +138,20 @@ type RpcConfig struct {
138
138
RpcHeartProbe ctime.Duration $json:"rpc_heart_probe"$ //default 1.5s
139
139
}
140
140
141
- //HttpConfig -
142
- type HttpConfig struct {
141
+ //WebConfig -
142
+ type WebConfig struct {
143
143
//server
144
- HttpPort uint $json:"http_port "$
145
- HttpTimeout ctime.Duration $json:"http_timeout "$ //default 500ms
146
- HttpStaticFile string $json:"http_staticfile "$
147
- HttpCertFile string $json:"http_certfile "$
148
- HttpKeyFile string $json:"http_keyfile "$
144
+ WebPort uint $json:"web_port "$
145
+ WebTimeout ctime.Duration $json:"web_timeout "$ //default 500ms
146
+ WebStaticFile string $json:"web_staticfile "$
147
+ WebCertFile string $json:"web_certfile "$
148
+ WebKeyFile string $json:"web_keyfile "$
149
149
//cors
150
- HttpCors *HttpCorsConfig $json:"http_cors "$
150
+ WebCors *WebCorsConfig $json:"web_cors "$
151
151
}
152
152
153
- //HttpCorsConfig -
154
- type HttpCorsConfig struct {
153
+ //WebCorsConfig -
154
+ type WebCorsConfig struct {
155
155
CorsOrigin []string $json:"cors_origin"$
156
156
CorsHeader []string $json:"cors_header"$
157
157
CorsExpose []string $json:"cors_expose"$
@@ -230,11 +230,11 @@ func (c *sourceConfig) validate() {
230
230
if c.Rpc.RpcHeartProbe == 0 {
231
231
c.Rpc.RpcHeartProbe = ctime.Duration(1500 * time.Millisecond)
232
232
}
233
- if c.Http.HttpPort == 0 {
234
- c.Http.HttpPort = 8000
233
+ if c.Web.WebPort == 0 {
234
+ c.Web.WebPort = 8000
235
235
}
236
- if c.Http.HttpTimeout == 0 {
237
- c.Http.HttpTimeout = ctime.Duration(time.Millisecond * 500)
236
+ if c.Web.WebTimeout == 0 {
237
+ c.Web.WebTimeout = ctime.Duration(time.Millisecond * 500)
238
238
}
239
239
for _, dbc := range c.DB {
240
240
if dbc.Username == "" {
@@ -406,9 +406,9 @@ func GetRpcConfig() *RpcConfig {
406
406
return sc.Rpc
407
407
}
408
408
409
- //GetHttpConfig get the http net config
410
- func GetHttpConfig () *HttpConfig {
411
- return sc.Http
409
+ //GetWebConfig get the web net config
410
+ func GetWebConfig () *WebConfig {
411
+ return sc.Web
412
412
}
413
413
414
414
//GetDB get a db client by db's logic name
0 commit comments