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 `river:"url,attr,optional"` ID string `river:"id,attr,optional"` Metadata map[string]string `river:"metadata,attr,optional"` PollFrequency time.Duration `river:"poll_frequency,attr,optional"` HTTPClientConfig *config.HTTPClientConfig `river:",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 river.Defaulter.
type Options ¶
type Options struct { Logger log.Logger // Where to send logs. StoragePath string // Where to cache configuration on-disk. }
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) 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.