Documentation ¶
Overview ¶
Package service represents the agent's core remoteconfig service
The `Service` type provides a communication layer for downstream clients to request configuration, as well as the ability to track clients for requesting complete update payloads from the remote config backend.
Index ¶
- func WithAPIKey(apiKey string) func(s *options)
- func WithClientCacheBypassLimit(limit int, cfgPath string) func(s *options)
- func WithClientTTL(interval time.Duration, cfgPath string) func(s *options)
- func WithConfigRootOverride(site string, override string) func(s *options)
- func WithDatabaseFileName(fileName string) func(s *options)
- func WithDirectorRootOverride(site string, override string) func(s *options)
- func WithMaxBackoffInterval(interval time.Duration, cfgPath string) func(s *options)
- func WithRcKey(rcKey string) func(s *options)
- func WithRefreshInterval(interval time.Duration, cfgPath string) func(s *options)
- func WithTraceAgentEnv(env string) func(s *options)
- type AgentMetadata
- type ConfigFileMetaCustom
- type Option
- type RcTelemetryReporter
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAPIKey ¶ added in v0.53.0
func WithAPIKey(apiKey string) func(s *options)
WithAPIKey sets the service API key
func WithClientCacheBypassLimit ¶ added in v0.53.0
WithClientCacheBypassLimit validates and sets the service client cache bypass limit
func WithClientTTL ¶ added in v0.53.0
WithClientTTL validates and sets the service client TTL
func WithConfigRootOverride ¶ added in v0.53.0
WithConfigRootOverride sets the service config root override
func WithDatabaseFileName ¶ added in v0.52.0
func WithDatabaseFileName(fileName string) func(s *options)
WithDatabaseFileName sets the service database file name
func WithDirectorRootOverride ¶ added in v0.53.0
WithDirectorRootOverride sets the service director root override
func WithMaxBackoffInterval ¶ added in v0.53.0
WithMaxBackoffInterval validates sets the service maximum retry backoff time
func WithRcKey ¶ added in v0.53.0
func WithRcKey(rcKey string) func(s *options)
WithRcKey sets the service remote configuration key
func WithRefreshInterval ¶ added in v0.53.0
WithRefreshInterval validates and sets the service refresh interval
func WithTraceAgentEnv ¶
func WithTraceAgentEnv(env string) func(s *options)
WithTraceAgentEnv sets the service trace-agent environment variable
Types ¶
type AgentMetadata ¶
type AgentMetadata struct { Version string `json:"version"` APIKeyHash string `json:"api-key-hash"` CreationTime time.Time `json:"creation-time"` }
AgentMetadata is data stored in bolt DB to determine whether or not the agent has changed and the RC cache should be cleared
type ConfigFileMetaCustom ¶
type ConfigFileMetaCustom struct { Predicates *pbgo.TracerPredicates `json:"tracer-predicates,omitempty"` Expires int64 `json:"expires"` }
ConfigFileMetaCustom is the custom metadata of a config
type RcTelemetryReporter ¶
type RcTelemetryReporter interface { // IncRateLimit is invoked when a cache bypass request is prevented due to rate limiting IncRateLimit() // IncTimeout is invoked when a cache bypass request is cancelled due to timeout or a previous cache bypass request is still pending IncTimeout() }
RcTelemetryReporter should be implemented by the agent to publish metrics on exceptional cache bypass request events
type Service ¶
Service defines the remote config management service responsible for fetching, storing and dispatching the configurations
func NewService ¶
func NewService(cfg model.Reader, rcType, baseRawURL, hostname string, tags []string, telemetryReporter RcTelemetryReporter, agentVersion string, opts ...Option) (*Service, error)
NewService instantiates a new remote configuration management service
func (*Service) ClientGetConfigs ¶
func (s *Service) ClientGetConfigs(_ context.Context, request *pbgo.ClientGetConfigsRequest) (*pbgo.ClientGetConfigsResponse, error)
ClientGetConfigs is the polling API called by tracers and agents to get the latest configurations
func (*Service) ConfigGetState ¶
func (s *Service) ConfigGetState() (*pbgo.GetStateConfigResponse, error)
ConfigGetState returns the state of the configuration and the director repos in the local store