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(directorRootOverride string) func(opts *Options)
- func WithPollInterval(duration time.Duration) func(opts *Options)
- func WithProducts(products ...string) func(opts *Options)
- func WithUpdater(tags ...string) 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 NewUnverifiedHAGRPCClient(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) SetAgentName(agentName string)
- func (c *Client) SetCWSWorkloads(workloads []string)
- func (c *Client) Start()
- func (c *Client) Subscribe(product string, fn func(update map[string]state.RawConfig, ...))
- func (c *Client) UpdateApplyStatus(cfgPath string, status state.ApplyStatus)
- type ConfigFetcher
- 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
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 NewUnverifiedHAGRPCClient ¶ added in v0.52.0
func NewUnverifiedHAGRPCClient(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher, opts ...func(o *Options)) (*Client, error)
NewUnverifiedHAGRPCClient 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) 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) 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, fn func(update map[string]state.RawConfig, applyStateCallback func(string, state.ApplyStatus)))
Subscribe subscribes to config updates of a product.
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 NewHAAgentGRPCConfigFetcher ¶ added in v0.52.0
func NewHAAgentGRPCConfigFetcher(ipcAddress string, cmdPort string, authTokenFetcher TokenFetcher) (ConfigFetcher, error)
NewHAAgentGRPCConfigFetcher returns a gRPC config fetcher using the secure agent HA client
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