Documentation ¶
Index ¶
Constants ¶
View Source
const ( EtcdDefaultNode = "http://127.0.0.1:2379" EtcdDefaultConfigPrefix = "/KitexConfig" EtcdDefaultTimeout = 5 * time.Second EtcdDefaultClientPath = "{{.ClientServiceName}}/{{.ServerServiceName}}/{{.Category}}" EtcdDefaultServerPath = "{{.ServerServiceName}}/{{.Category}}" )
Variables ¶
This section is empty.
Functions ¶
func AllocateUniqueID ¶
func AllocateUniqueID() int64
Types ¶
type Client ¶
type Client interface { SetParser(ConfigParser) ClientConfigParam(cpc *ConfigParamConfig, cfs ...CustomFunction) (Key, error) ServerConfigParam(cpc *ConfigParamConfig, cfs ...CustomFunction) (Key, error) RegisterConfigCallback(ctx context.Context, key string, clientId int64, callback func(restoreDefault bool, data string, parser ConfigParser)) DeregisterConfig(key string, uniqueId int64) }
type ConfigParamConfig ¶
ConfigParamConfig use for render the path or prefix info by go template, ref: https://pkg.go.dev/text/template The fixed key shows as below.
type ConfigParser ¶
ConfigParser the parser for etcd config.
type CustomFunction ¶
type CustomFunction func(*Key)
CustomFunction use for customize the config parameters.
Click to show internal directories.
Click to hide internal directories.