Documentation ¶
Index ¶
Constants ¶
const ServiceName = "remotecfg"
ServiceName defines the name used for the remotecfg service.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arguments ¶
type Arguments struct { URL string `alloy:"url,attr,optional"` ID string `alloy:"id,attr,optional"` Name string `alloy:"name,attr,optional"` Attributes map[string]string `alloy:"attributes,attr,optional"` PollFrequency time.Duration `alloy:"poll_frequency,attr,optional"` HTTPClientConfig *config.HTTPClientConfig `alloy:",squash"` }
Arguments holds runtime settings for the remotecfg service.
func GetDefaultArguments ¶
func GetDefaultArguments() Arguments
GetDefaultArguments populates the default values for the Arguments struct.
func (*Arguments) SetToDefault ¶
func (a *Arguments) SetToDefault()
SetToDefault implements syntax.Defaulter.
type Data ¶ added in v1.4.0
type Data struct { // Host exposes the Host of the isolated controller that is created by the // remotecfg service. Host service.Host }
Data includes information associated with the HTTP service.
type Options ¶
type Options struct { Logger log.Logger // Where to send logs. StoragePath string // Where to cache configuration on-disk. ConfigPath string // Where the root config file is. Metrics prometheus.Registerer // Where to send metrics to. }
Options are used to configure the remotecfg service. Options are constant for the lifetime of the remotecfg service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements a service for remote configuration. The default value of ch is nil; this means it will block forever if the remotecfg service is not configured. In addition, we're keeping track of the ticker so we can avoid leaking goroutines. The datapath field is where the service looks for the local cache location. It is defined as a hash of the Arguments field.
func (*Service) Data ¶
Data returns an instance of Data. Calls to Data are cachable by the caller. Data must only be called after Run.
func (*Service) Definition ¶
func (s *Service) Definition() service.Definition
Definition returns the definition of the remotecfg service.
func (*Service) Run ¶
Run implements service.Service and starts the remotecfg service. It will run until the provided context is canceled or there is a fatal error.