Documentation ¶
Index ¶
Constants ¶
View Source
const ( RetryConfigName = "retry" RpcTimeoutConfigName = "rpc_timeout" CircuitBreakerConfigName = "circuit_break" LimiterConfigName = "limit" )
View Source
const ( JSON ConfigType = "json" YAML ConfigType = "yaml" ApolloDefaultConfigServerURL = "127.0.0.1:8080" ApolloDefaultAppId = "KitexApp" ApolloDefaultCluster = "default" ApolloNameSpace = "{{.Category}}" ApolloDefaultClientKey = "{{.ClientServiceName}}.{{.ServerServiceName}}" ApolloDefaultServerKey = "{{.ServerServiceName}}" )
Variables ¶
View Source
var Close sync.Once
Functions ¶
func NewCustomApolloLogger ¶
func NewCustomApolloLogger() log.LoggerInterface
Types ¶
type Client ¶
type Client interface { SetParser(ConfigParser) ClientConfigParam(cpc *ConfigParamConfig) (ConfigParam, error) ServerConfigParam(cpc *ConfigParamConfig) (ConfigParam, error) RegisterConfigCallback(ConfigParam, func(string, ConfigParser), int64) DeregisterConfig(ConfigParam, int64) error }
Client the wrapper of apollo client.
type ConfigContent ¶
type ConfigContent string
CustomFunction use for customize the config parameters.
type ConfigParam ¶
type ConfigParam struct { Key string Cluster string Type ConfigType // contains filtered or unexported fields }
type ConfigParamConfig ¶
ConfigParamConfig use for render the dataId or group info by go template, ref: https://pkg.go.dev/text/template The fixed key shows as below.
type ConfigParser ¶
type ConfigParser interface {
Decode(kind ConfigType, data string, config interface{}) error
}
ConfigParser the parser for Apollo config.
type CustomFunction ¶
type CustomFunction func(*ConfigParam)
CustomFunction use for customize the config parameters.
type OptionFunc ¶
type OptionFunc func(option *Options)
func WithApolloOption ¶
func WithApolloOption(apolloOption ...agollo.Option) OptionFunc
Click to show internal directories.
Click to hide internal directories.