Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrWaitStartupLoadedTimeout = errors.New("wait startup loaded timeout")
)
Functions ¶
func GetConfigurationKey ¶
func GetConfigurationKey(r configapi.RequestedConfigurationKey) string
func GetConfigurationKeyFromCfg ¶
func GetConfigurationKeyFromCfg(c configapi.Configuration) string
func GetConfigurationSync ¶
func GetConfigurationSync()
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(serverList []string, opt ClientOptions) *Client
func (*Client) AddConfigurationRequirement ¶
func (c *Client) AddConfigurationRequirement(req RequiredConfig)
func (*Client) StartClient ¶
func (*Client) StopClient ¶
type ClientAdv ¶
type ClientAdv struct {
// contains filtered or unexported fields
}
func NewClientAdv ¶
func (*ClientAdv) Register ¶
func (c *ClientAdv) Register(group, key string, unmarshaler Unmarshaler, container any) (*atomic.Value, error)
Register will register auto updated configure container with the same type as the container provided Note that any further update has to be accessed via responded container rather than the container provided in the parameter
type ClientOptions ¶
type ClientOptions struct { SelectorEnvironment string SelectorDatacenter string SelectorNamespace string SelectorApp string SelectorCluster string SelectorHostName string SelectorBeta string OverrideSelectors *configapi.Selectors // used for overriding detail selector config OverrideOptionalSelectors *configapi.Selectors // used for overriding detail selector config Auth string LocalFallbackDataPath string AllowedLocalFallbackDataTTL int64 // In seconds. Compare to last retrieved time rather than configuration timestamp. AcquireFullConfigurationsInterval int64 // Effective > 0 (in seconds). Used for 1. refresh data, 2. keep fallback data fresh }
func (*ClientOptions) ToOptSelectors ¶
func (c *ClientOptions) ToOptSelectors() configapi.Selectors
func (*ClientOptions) ToSelectors ¶
func (c *ClientOptions) ToSelectors() configapi.Selectors
type ConfigContainer ¶ added in v0.10.10
type ConfigContainer[T any] struct { // OnChange is called when any update on the configuration OnChange func(cfg configapi.Configuration, container T) // contains filtered or unexported fields }
ConfigContainer contains the configuration retrieved from the server with auto refresh support
func (*ConfigContainer[T]) Get ¶ added in v0.10.10
func (cc *ConfigContainer[T]) Get() T
func (*ConfigContainer[T]) Register ¶ added in v0.10.10
func (cc *ConfigContainer[T]) Register(c *ClientAdv, group, key string, unmarshaler Unmarshaler) error
Register will register auto updated configure container with the same type as the container provided Note that any further update has to be accessed via responded container rather than the container provided in the parameter
func (*ConfigContainer[T]) RegisterJsonContainer ¶ added in v0.10.10
func (cc *ConfigContainer[T]) RegisterJsonContainer(c *ClientAdv, group, key string) error
RegisterJsonContainer will register auto updated configure container with json configure support Note: the behavior is the same as Register method
type RequiredConfig ¶
type RequiredConfig struct { Required configapi.RequestedConfigurationKey Callback func(cfg configapi.Configuration) }