mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 20:39:36 +08:00
96b97f7f58
Signed-off-by: shaoyue.chen <shaoyue.chen@zilliz.com>
36 lines
538 B
Go
36 lines
538 B
Go
package paramtable
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
type HTTPConfig struct {
|
|
BaseTable
|
|
|
|
once sync.Once
|
|
Enabled bool
|
|
DebugMode bool
|
|
}
|
|
|
|
// InitOnce initialize HTTPConfig
|
|
func (p *HTTPConfig) InitOnce() {
|
|
p.once.Do(func() {
|
|
p.init()
|
|
})
|
|
}
|
|
|
|
func (p *HTTPConfig) init() {
|
|
p.BaseTable.Init()
|
|
|
|
p.initHTTPEnabled()
|
|
p.initHTTPDebugMode()
|
|
}
|
|
|
|
func (p *HTTPConfig) initHTTPEnabled() {
|
|
p.Enabled = p.ParseBool("proxy.http.enabled", true)
|
|
}
|
|
|
|
func (p *HTTPConfig) initHTTPDebugMode() {
|
|
p.DebugMode = p.ParseBool("proxy.http.debug_mode", false)
|
|
}
|