From 7aabc60fb6fb8f7f311ccefd1627f0bdfa25fcec Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Thu, 1 Jul 2021 23:39:07 +0200 Subject: [PATCH] Fix go-fmt warnings regarding lowercase --- carbon/app.go | 34 +++++++++++++++++----------------- carbon/config.go | 20 ++++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/carbon/app.go b/carbon/app.go index 341345d6..e40d0604 100644 --- a/carbon/app.go +++ b/carbon/app.go @@ -246,16 +246,16 @@ func (app *App) Start() (err error) { /* UPLOADER end */ /* RECEIVER start */ - if conf.Tcp.Enabled { + if conf.TCP.Enabled { app.TCP, err = receiver.New( - "tcp://"+conf.Tcp.Listen, + "tcp://"+conf.TCP.Listen, app.Config.TagDesc, receiver.ParseThreads(runtime.GOMAXPROCS(-1)*2), receiver.WriteChan(app.writeChan), - receiver.DropFuture(uint32(conf.Tcp.DropFuture.Value().Seconds())), - receiver.DropPast(uint32(conf.Tcp.DropPast.Value().Seconds())), - receiver.DropLongerThan(conf.Tcp.DropLongerThan), - receiver.ReadTimeout(uint32(conf.Tcp.ReadTimeout.Value().Seconds())), + receiver.DropFuture(uint32(conf.TCP.DropFuture.Value().Seconds())), + receiver.DropPast(uint32(conf.TCP.DropPast.Value().Seconds())), + receiver.DropLongerThan(conf.TCP.DropLongerThan), + receiver.ReadTimeout(uint32(conf.TCP.ReadTimeout.Value().Seconds())), ) if err != nil { @@ -265,15 +265,15 @@ func (app *App) Start() (err error) { http.HandleFunc("/debug/receive/tcp/dropped/", app.TCP.DroppedHandler) } - if conf.Udp.Enabled { + if conf.UDP.Enabled { app.UDP, err = receiver.New( - "udp://"+conf.Udp.Listen, + "udp://"+conf.UDP.Listen, app.Config.TagDesc, receiver.ParseThreads(runtime.GOMAXPROCS(-1)*2), receiver.WriteChan(app.writeChan), - receiver.DropFuture(uint32(conf.Udp.DropFuture.Value().Seconds())), - receiver.DropPast(uint32(conf.Udp.DropPast.Value().Seconds())), - receiver.DropLongerThan(conf.Udp.DropLongerThan), + receiver.DropFuture(uint32(conf.UDP.DropFuture.Value().Seconds())), + receiver.DropPast(uint32(conf.UDP.DropPast.Value().Seconds())), + receiver.DropLongerThan(conf.UDP.DropLongerThan), ) if err != nil { @@ -335,15 +335,15 @@ func (app *App) Start() (err error) { http.HandleFunc("/debug/receive/prometheus/dropped/", app.Prometheus.DroppedHandler) } - if conf.TelegrafHttpJson.Enabled { + if conf.TelegrafHTTPJSON.Enabled { app.TelegrafHttpJson, err = receiver.New( - "telegraf+http+json://"+conf.TelegrafHttpJson.Listen, + "telegraf+http+json://"+conf.TelegrafHTTPJSON.Listen, app.Config.TagDesc, receiver.WriteChan(app.writeChan), - receiver.DropFuture(uint32(conf.TelegrafHttpJson.DropFuture.Value().Seconds())), - receiver.DropPast(uint32(conf.TelegrafHttpJson.DropPast.Value().Seconds())), - receiver.DropLongerThan(conf.TelegrafHttpJson.DropLongerThan), - receiver.ConcatChar(conf.TelegrafHttpJson.Concat), + receiver.DropFuture(uint32(conf.TelegrafHTTPJSON.DropFuture.Value().Seconds())), + receiver.DropPast(uint32(conf.TelegrafHTTPJSON.DropPast.Value().Seconds())), + receiver.DropLongerThan(conf.TelegrafHTTPJSON.DropLongerThan), + receiver.ConcatChar(conf.TelegrafHTTPJSON.Concat), ) if err != nil { diff --git a/carbon/config.go b/carbon/config.go index d56156c4..eccfd9a0 100644 --- a/carbon/config.go +++ b/carbon/config.go @@ -27,7 +27,7 @@ type commonConfig struct { } type clickhouseConfig struct { - Url string `toml:"url"` + URL string `toml:"url"` } type udpConfig struct { @@ -72,7 +72,7 @@ type promConfig struct { DropLongerThan uint16 `toml:"drop-longer-than"` } -type telegrafHttpJsonConfig struct { +type telegrafHTTPJSONConfig struct { Listen string `toml:"listen"` Enabled bool `toml:"enabled"` DropFuture *config.Duration `toml:"drop-future"` @@ -100,12 +100,12 @@ type Config struct { Common commonConfig `toml:"common"` Data dataConfig `toml:"data"` Upload map[string]*uploader.Config `toml:"upload"` - Udp udpConfig `toml:"udp"` - Tcp tcpConfig `toml:"tcp"` + UDP udpConfig `toml:"udp"` + TCP tcpConfig `toml:"tcp"` Pickle pickleConfig `toml:"pickle"` Grpc grpcConfig `toml:"grpc"` Prometheus promConfig `toml:"prometheus"` - TelegrafHttpJson telegrafHttpJsonConfig `toml:"telegraf_http_json"` + TelegrafHTTPJSON telegrafHTTPJSONConfig `toml:"telegraf_http_json"` Pprof pprofConfig `toml:"pprof"` Logging []zapwriter.Config `toml:"logging"` TagDesc tags.TagConfig `toml:"convert_to_tagged"` @@ -133,7 +133,7 @@ func NewConfig() *Config { CompAlgo: &config.Compression{CompAlgo: config.CompAlgoNone}, CompLevel: 0, }, - Udp: udpConfig{ + UDP: udpConfig{ Listen: ":2003", Enabled: true, LogIncomplete: false, @@ -141,7 +141,7 @@ func NewConfig() *Config { DropPast: &config.Duration{}, DropLongerThan: 0, }, - Tcp: tcpConfig{ + TCP: tcpConfig{ Listen: ":2003", Enabled: true, DropFuture: &config.Duration{}, @@ -172,7 +172,7 @@ func NewConfig() *Config { DropPast: &config.Duration{}, DropLongerThan: 0, }, - TelegrafHttpJson: telegrafHttpJsonConfig{ + TelegrafHTTPJSON: telegrafHTTPJSONConfig{ Listen: ":2007", Enabled: false, DropFuture: &config.Duration{}, @@ -212,7 +212,7 @@ func PrintDefaultConfig() error { } cfg.Upload = map[string]*uploader.Config{ - "graphite": &uploader.Config{ + "graphite": { Type: "points", Timeout: &config.Duration{ Duration: time.Minute, @@ -221,7 +221,7 @@ func PrintDefaultConfig() error { TableName: "graphite", URL: "http://localhost:8123/", }, - "graphite_tree": &uploader.Config{ + "graphite_tree": { Type: "tree", Timeout: &config.Duration{ Duration: time.Minute,