From 45afd867a913614f4691a8bdd11c0473b0b5cbd1 Mon Sep 17 00:00:00 2001 From: Dolph Mathews Date: Thu, 23 Feb 2023 08:34:59 -0600 Subject: [PATCH] capitalize statsd config options --- config.go | 18 +++++++++--------- statsd.go | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config.go b/config.go index ae88bac..471c08e 100644 --- a/config.go +++ b/config.go @@ -8,9 +8,9 @@ import ( ) type Config struct { - statsdHost string `yaml:"statsd_host"` - statsdPort int `yaml:"statsd_port"` - statsdProtocol string `yaml:"statsd_protocol"` + StatsdHost string `yaml:"statsd_host"` + StatsdPort int `yaml:"statsd_port"` + StatsdProtocol string `yaml:"statsd_protocol"` URLs []string `yaml:"urls"` } @@ -52,14 +52,14 @@ func LoadConfig(path string) *Config { } // Apply some default values - if cfg.statsdHost == "" { - cfg.statsdHost = "127.0.0.1" + if cfg.StatsdHost == "" { + cfg.StatsdHost = "127.0.0.1" } - if cfg.statsdPort == 0 { - cfg.statsdPort = 8125 + if cfg.StatsdPort == 0 { + cfg.StatsdPort = 8125 } - if cfg.statsdProtocol == "" { - cfg.statsdProtocol = "udp" + if cfg.StatsdProtocol == "" { + cfg.StatsdProtocol = "udp" } return &cfg diff --git a/statsd.go b/statsd.go index ec57ab9..45e0cc9 100644 --- a/statsd.go +++ b/statsd.go @@ -32,8 +32,8 @@ func formatTags(tags []string) string { func StatsdSender(config *Config) { for s := range queue { - statsdHostPort := fmt.Sprintf("%s:%d", config.statsdHost, config.statsdPort) - if conn, err := net.Dial(config.statsdProtocol, statsdHostPort); err == nil { + statsdHostPort := fmt.Sprintf("%s:%d", config.StatsdHost, config.StatsdPort) + if conn, err := net.Dial(config.StatsdProtocol, statsdHostPort); err == nil { io.WriteString(conn, s) conn.Close() }