mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-01 16:45:36 +08:00
user define the port for high-level restful api by themselves
user can only use the default port same as grcp only while tlsMode == 0
fix need authenticate only while authorizationEnable: true
restful api allow origin: *
support insert a single row and an array whose length is 1 at the same time
http response code: 401-incorrect username & password; 403-user has no permission
create collection with default index: vector_idx
while field.DataType == varchar, show it's max_length
check the required parameter
Signed-off-by: PowderLi <min.li@zilliz.com>
42 lines
659 B
Go
42 lines
659 B
Go
package paramtable
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
type HTTPConfig struct {
|
|
BaseTable
|
|
|
|
once sync.Once
|
|
Enabled bool
|
|
DebugMode bool
|
|
Port int
|
|
}
|
|
|
|
// InitOnce initialize HTTPConfig
|
|
func (p *HTTPConfig) InitOnce() {
|
|
p.once.Do(func() {
|
|
p.init()
|
|
})
|
|
}
|
|
|
|
func (p *HTTPConfig) init() {
|
|
p.BaseTable.Init()
|
|
|
|
p.initHTTPEnabled()
|
|
p.initHTTPDebugMode()
|
|
p.initPort()
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
func (p *HTTPConfig) initPort() {
|
|
p.Port = p.ParseIntWithDefault("proxy.http.port", -1)
|
|
}
|