Documentation ¶
Index ¶
Constants ¶
View Source
const ( JSON ConfigType = "json" YAML ConfigType = "yaml" HCL ConfigType = "hcl" ConsulDefaultConfigAddr = "127.0.0.1:8500" ConsulDefaultConfiGPrefix = "KitexConfig" ConsulDefaultTimeout = 5 * time.Second ConsulDefaultDataCenter = "dc1" ConsulDefaultClientPath = "{{.ClientServiceName}}/{{.ServerServiceName}}/{{.Category}}" ConsulDefaultServerPath = "{{.ServerServiceName}}/{{.Category}}" )
View Source
const WatchByKey = "key"
Variables ¶
This section is empty.
Functions ¶
func AllocateUniqueID ¶
func AllocateUniqueID() int64
Types ¶
type Client ¶
type Client interface { SetParser(configParser ConfigParser) ClientConfigParam(cpc *ConfigParamConfig, cfs ...CustomFunction) (Key, error) ServerConfigParam(cpc *ConfigParamConfig, cfs ...CustomFunction) (Key, error) RegisterConfigCallback(key string, uniqueID int64, callback func(string, ConfigParser)) DeregisterConfig(key string, uniqueID int64) }
type ConfigParamConfig ¶
type ConfigParser ¶
type ConfigParser interface {
Decode(configType ConfigType, data string, config interface{}) error
}
type ConfigType ¶
type ConfigType string
type CustomFunction ¶
type CustomFunction func(*Key)
CustomFunction use for customize the config parameters.
type Key ¶
type Key struct { Type ConfigType Prefix string Path string }
type ListenConfig ¶
Click to show internal directories.
Click to hide internal directories.