Documentation ¶
Overview ¶
Package client is a client usable in the agent or an agent sub-process to receive configs from the core remoteconfig service.
Index ¶
- func WithAgent(name, version string) func(opts *Options)
- func WithCluster(name, id string) func(opts *Options)
- func WithDirectorRootOverride(site string, directorRootOverride string) func(opts *Options)
- func WithPollInterval(duration time.Duration) func(opts *Options)
- func WithProducts(products ...string) func(opts *Options)
- func WithUpdater() func(opts *Options)
- func WithoutTufVerification() func(opts *Options)
- type Client
- func NewClient(updater ConfigFetcher, opts ...func(o *Options)) (*Client, error)
- func NewGRPCClient(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher, ...) (*Client, error)
- func NewUnverifiedGRPCClient(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher, ...) (*Client, error)
- func NewUnverifiedMRFGRPCClient(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher, ...) (*Client, error)
- func (c *Client) Close()
- func (c *Client) GetConfigs(product string) map[string]state.RawConfig
- func (c *Client) GetInstallerState() *pbgo.ClientUpdater
- func (c *Client) SetAgentName(agentName string)
- func (c *Client) SetCWSWorkloads(workloads []string)
- func (c *Client) SetInstallerState(state *pbgo.ClientUpdater)
- func (c *Client) Start()
- func (c *Client) Subscribe(product string, cb func(update map[string]state.RawConfig, ...))
- func (c *Client) SubscribeAll(product string, listener Listener)
- func (c *Client) UpdateApplyStatus(cfgPath string, status state.ApplyStatus)
- type ConfigFetcher
- type Listener
- type Options
- type TokenFetcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCluster ¶
WithCluster specifies the cluster name and id
func WithDirectorRootOverride ¶
WithDirectorRootOverride specifies the director root to
func WithPollInterval ¶
WithPollInterval specifies the polling interval
func WithProducts ¶
WithProducts specifies the product lists
func WithUpdater ¶ added in v0.52.0
func WithUpdater() func(opts *Options)
WithUpdater specifies that this client is an updater
func WithoutTufVerification ¶
func WithoutTufVerification() func(opts *Options)
WithoutTufVerification disables TUF verification of configs
Types ¶
type Client ¶
Client is a remote-configuration client to obtain configurations from the local API
func NewClient ¶
func NewClient(updater ConfigFetcher, opts ...func(o *Options)) (*Client, error)
NewClient creates a new client
func NewGRPCClient ¶
func NewGRPCClient(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher, opts ...func(o *Options)) (*Client, error)
NewGRPCClient creates a new client that retrieves updates over the datadog-agent's secure GRPC client
func NewUnverifiedGRPCClient ¶
func NewUnverifiedGRPCClient(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher, opts ...func(o *Options)) (*Client, error)
NewUnverifiedGRPCClient creates a new client that does not perform any TUF verification
func NewUnverifiedMRFGRPCClient ¶ added in v0.54.0
func NewUnverifiedMRFGRPCClient(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher, opts ...func(o *Options)) (*Client, error)
NewUnverifiedMRFGRPCClient creates a new client that does not perform any TUF verification and gets failover configs via gRPC
func (*Client) Close ¶
func (c *Client) Close()
Close terminates the client's poll loop.
A client that has been closed cannot be restarted
func (*Client) GetConfigs ¶
GetConfigs returns the current configs applied of a product.
func (*Client) GetInstallerState ¶ added in v0.58.0
func (c *Client) GetInstallerState() *pbgo.ClientUpdater
GetInstallerState gets the installer state
func (*Client) SetAgentName ¶
SetAgentName updates the agent name of the RC client should only be used by the fx component
func (*Client) SetCWSWorkloads ¶
SetCWSWorkloads updates the list of workloads that needs cws profiles
func (*Client) SetInstallerState ¶ added in v0.58.0
func (c *Client) SetInstallerState(state *pbgo.ClientUpdater)
SetInstallerState sets the installer state
func (*Client) Start ¶
func (c *Client) Start()
Start starts the client's poll loop.
If the client is already started, this is a no-op. At this time, a client that has been stopped cannot be restarted.
func (*Client) Subscribe ¶
func (c *Client) Subscribe(product string, cb func(update map[string]state.RawConfig, applyStateCallback func(string, state.ApplyStatus)))
Subscribe subscribes to config updates of a product.
func (*Client) SubscribeAll ¶ added in v0.58.0
SubscribeAll subscribes to all events (config updates, state changed, ...)
func (*Client) UpdateApplyStatus ¶
func (c *Client) UpdateApplyStatus(cfgPath string, status state.ApplyStatus)
UpdateApplyStatus updates the config's metadata to reflect its applied status
type ConfigFetcher ¶ added in v0.52.0
type ConfigFetcher interface {
ClientGetConfigs(context.Context, *pbgo.ClientGetConfigsRequest) (*pbgo.ClientGetConfigsResponse, error)
}
ConfigFetcher defines the interface that an agent client uses to get config updates
func NewAgentGRPCConfigFetcher ¶
func NewAgentGRPCConfigFetcher(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher) (ConfigFetcher, error)
NewAgentGRPCConfigFetcher returns a gRPC config fetcher using the secure agent client
func NewMRFAgentGRPCConfigFetcher ¶ added in v0.54.0
func NewMRFAgentGRPCConfigFetcher(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher) (ConfigFetcher, error)
NewMRFAgentGRPCConfigFetcher returns a gRPC config fetcher using the secure agent MRF client
type Listener ¶ added in v0.58.0
type Listener interface { OnUpdate(map[string]state.RawConfig, func(cfgPath string, status state.ApplyStatus)) OnStateChange(bool) }
Listener defines the interface of a remote config listener
func NewListener ¶ added in v0.58.0
func NewListener(onUpdate func(updates map[string]state.RawConfig, applyStateCallback func(string, state.ApplyStatus)), onStateChange func(bool)) Listener
NewListener creates a remote config listener from a couple of update and state change callbacks
func NewUpdateListener ¶ added in v0.58.0
func NewUpdateListener(onUpdate func(updates map[string]state.RawConfig, applyStateCallback func(string, state.ApplyStatus))) Listener
NewUpdateListener creates a remote config listener from a update callback
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options describes the client options
type TokenFetcher ¶
TokenFetcher defines the callback used to fetch a token