config: use config.Config instead of config.Options everywhere

This commit is contained in:
Caleb Doxsey 2022-08-26 15:39:50 -06:00
parent 5f51510e91
commit 1b80e8a6c2
40 changed files with 484 additions and 412 deletions

View file

@ -31,6 +31,16 @@ type Config struct {
MetricsScrapeEndpoints []MetricsScrapeEndpoint
}
// New creates a new Config.
func New(options *Options) *Config {
if options == nil {
options = NewDefaultOptions()
}
return &Config{
Options: options,
}
}
// Clone creates a clone of the config.
func (cfg *Config) Clone() *Config {
newOptions := new(Options)