From 8f2a45d8327699483388834da07821935bca57c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Wed, 31 Jul 2024 18:02:21 +0200 Subject: [PATCH] printer: expose config struct properties (#1545) --- pkg/collector/printer/printer.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/collector/printer/printer.go b/pkg/collector/printer/printer.go index 600e86b00..75f23628a 100644 --- a/pkg/collector/printer/printer.go +++ b/pkg/collector/printer/printer.go @@ -35,13 +35,13 @@ var printerStatusMap = map[uint16]string{ } type Config struct { - printerInclude string `yaml:"printer_include"` - printerExclude string `yaml:"printer_exclude"` + Include string `yaml:"printer_include"` + Exclude string `yaml:"printer_exclude"` } var ConfigDefaults = Config{ - printerInclude: ".+", - printerExclude: "", + Include: ".+", + Exclude: "", } type collector struct { @@ -63,8 +63,8 @@ func New(logger log.Logger, config *Config) types.Collector { config = &ConfigDefaults } c := &collector{ - printerInclude: &config.printerInclude, - printerExclude: &config.printerExclude, + printerInclude: &config.Include, + printerExclude: &config.Exclude, } c.SetLogger(logger) return c @@ -75,11 +75,11 @@ func NewWithFlags(app *kingpin.Application) types.Collector { printerInclude: app.Flag( FlagPrinterInclude, "Regular expression to match printers to collect metrics for", - ).Default(ConfigDefaults.printerInclude).String(), + ).Default(ConfigDefaults.Include).String(), printerExclude: app.Flag( FlagPrinterExclude, "Regular expression to match printers to exclude", - ).Default(ConfigDefaults.printerExclude).String(), + ).Default(ConfigDefaults.Exclude).String(), } return c }