milvus/internal/util/paramtable/http_param.go
shaoyue 96b97f7f58
RESTful api use same port as metrics & healthcheck (#17732)
Signed-off-by: shaoyue.chen <shaoyue.chen@zilliz.com>
2022-06-24 15:34:14 +08:00

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)
}