mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 04:49:08 +08:00
fb0705df1b
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
36 lines
729 B
Go
36 lines
729 B
Go
package paramtable
|
|
|
|
import (
|
|
"github.com/milvus-io/milvus/pkg/config"
|
|
)
|
|
|
|
const hookYamlFile = "hook.yaml"
|
|
|
|
type hookConfig struct {
|
|
hookBase *BaseTable
|
|
|
|
SoPath ParamItem `refreshable:"false"`
|
|
SoConfig ParamGroup `refreshable:"true"`
|
|
}
|
|
|
|
func (h *hookConfig) init(base *BaseTable) {
|
|
h.hookBase = base
|
|
|
|
h.SoPath = ParamItem{
|
|
Key: "soPath",
|
|
Version: "2.0.0",
|
|
DefaultValue: "",
|
|
}
|
|
h.SoPath.Init(base.mgr)
|
|
|
|
h.SoConfig = ParamGroup{
|
|
KeyPrefix: "",
|
|
Version: "2.2.0",
|
|
}
|
|
h.SoConfig.Init(base.mgr)
|
|
}
|
|
|
|
func (h *hookConfig) WatchHookWithPrefix(ident string, keyPrefix string, onEvent func(*config.Event)) {
|
|
h.hookBase.mgr.Dispatcher.RegisterForKeyPrefix(keyPrefix, config.NewHandler(ident, onEvent))
|
|
}
|