Skip to content

Commit 7aabc60

Browse files
committed
Fix go-fmt warnings regarding lowercase
1 parent 97952c3 commit 7aabc60

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

carbon/app.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,16 @@ func (app *App) Start() (err error) {
246246
/* UPLOADER end */
247247

248248
/* RECEIVER start */
249-
if conf.Tcp.Enabled {
249+
if conf.TCP.Enabled {
250250
app.TCP, err = receiver.New(
251-
"tcp://"+conf.Tcp.Listen,
251+
"tcp://"+conf.TCP.Listen,
252252
app.Config.TagDesc,
253253
receiver.ParseThreads(runtime.GOMAXPROCS(-1)*2),
254254
receiver.WriteChan(app.writeChan),
255-
receiver.DropFuture(uint32(conf.Tcp.DropFuture.Value().Seconds())),
256-
receiver.DropPast(uint32(conf.Tcp.DropPast.Value().Seconds())),
257-
receiver.DropLongerThan(conf.Tcp.DropLongerThan),
258-
receiver.ReadTimeout(uint32(conf.Tcp.ReadTimeout.Value().Seconds())),
255+
receiver.DropFuture(uint32(conf.TCP.DropFuture.Value().Seconds())),
256+
receiver.DropPast(uint32(conf.TCP.DropPast.Value().Seconds())),
257+
receiver.DropLongerThan(conf.TCP.DropLongerThan),
258+
receiver.ReadTimeout(uint32(conf.TCP.ReadTimeout.Value().Seconds())),
259259
)
260260

261261
if err != nil {
@@ -265,15 +265,15 @@ func (app *App) Start() (err error) {
265265
http.HandleFunc("/debug/receive/tcp/dropped/", app.TCP.DroppedHandler)
266266
}
267267

268-
if conf.Udp.Enabled {
268+
if conf.UDP.Enabled {
269269
app.UDP, err = receiver.New(
270-
"udp://"+conf.Udp.Listen,
270+
"udp://"+conf.UDP.Listen,
271271
app.Config.TagDesc,
272272
receiver.ParseThreads(runtime.GOMAXPROCS(-1)*2),
273273
receiver.WriteChan(app.writeChan),
274-
receiver.DropFuture(uint32(conf.Udp.DropFuture.Value().Seconds())),
275-
receiver.DropPast(uint32(conf.Udp.DropPast.Value().Seconds())),
276-
receiver.DropLongerThan(conf.Udp.DropLongerThan),
274+
receiver.DropFuture(uint32(conf.UDP.DropFuture.Value().Seconds())),
275+
receiver.DropPast(uint32(conf.UDP.DropPast.Value().Seconds())),
276+
receiver.DropLongerThan(conf.UDP.DropLongerThan),
277277
)
278278

279279
if err != nil {
@@ -335,15 +335,15 @@ func (app *App) Start() (err error) {
335335
http.HandleFunc("/debug/receive/prometheus/dropped/", app.Prometheus.DroppedHandler)
336336
}
337337

338-
if conf.TelegrafHttpJson.Enabled {
338+
if conf.TelegrafHTTPJSON.Enabled {
339339
app.TelegrafHttpJson, err = receiver.New(
340-
"telegraf+http+json://"+conf.TelegrafHttpJson.Listen,
340+
"telegraf+http+json://"+conf.TelegrafHTTPJSON.Listen,
341341
app.Config.TagDesc,
342342
receiver.WriteChan(app.writeChan),
343-
receiver.DropFuture(uint32(conf.TelegrafHttpJson.DropFuture.Value().Seconds())),
344-
receiver.DropPast(uint32(conf.TelegrafHttpJson.DropPast.Value().Seconds())),
345-
receiver.DropLongerThan(conf.TelegrafHttpJson.DropLongerThan),
346-
receiver.ConcatChar(conf.TelegrafHttpJson.Concat),
343+
receiver.DropFuture(uint32(conf.TelegrafHTTPJSON.DropFuture.Value().Seconds())),
344+
receiver.DropPast(uint32(conf.TelegrafHTTPJSON.DropPast.Value().Seconds())),
345+
receiver.DropLongerThan(conf.TelegrafHTTPJSON.DropLongerThan),
346+
receiver.ConcatChar(conf.TelegrafHTTPJSON.Concat),
347347
)
348348

349349
if err != nil {

carbon/config.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type commonConfig struct {
2727
}
2828

2929
type clickhouseConfig struct {
30-
Url string `toml:"url"`
30+
URL string `toml:"url"`
3131
}
3232

3333
type udpConfig struct {
@@ -72,7 +72,7 @@ type promConfig struct {
7272
DropLongerThan uint16 `toml:"drop-longer-than"`
7373
}
7474

75-
type telegrafHttpJsonConfig struct {
75+
type telegrafHTTPJSONConfig struct {
7676
Listen string `toml:"listen"`
7777
Enabled bool `toml:"enabled"`
7878
DropFuture *config.Duration `toml:"drop-future"`
@@ -100,12 +100,12 @@ type Config struct {
100100
Common commonConfig `toml:"common"`
101101
Data dataConfig `toml:"data"`
102102
Upload map[string]*uploader.Config `toml:"upload"`
103-
Udp udpConfig `toml:"udp"`
104-
Tcp tcpConfig `toml:"tcp"`
103+
UDP udpConfig `toml:"udp"`
104+
TCP tcpConfig `toml:"tcp"`
105105
Pickle pickleConfig `toml:"pickle"`
106106
Grpc grpcConfig `toml:"grpc"`
107107
Prometheus promConfig `toml:"prometheus"`
108-
TelegrafHttpJson telegrafHttpJsonConfig `toml:"telegraf_http_json"`
108+
TelegrafHTTPJSON telegrafHTTPJSONConfig `toml:"telegraf_http_json"`
109109
Pprof pprofConfig `toml:"pprof"`
110110
Logging []zapwriter.Config `toml:"logging"`
111111
TagDesc tags.TagConfig `toml:"convert_to_tagged"`
@@ -133,15 +133,15 @@ func NewConfig() *Config {
133133
CompAlgo: &config.Compression{CompAlgo: config.CompAlgoNone},
134134
CompLevel: 0,
135135
},
136-
Udp: udpConfig{
136+
UDP: udpConfig{
137137
Listen: ":2003",
138138
Enabled: true,
139139
LogIncomplete: false,
140140
DropFuture: &config.Duration{},
141141
DropPast: &config.Duration{},
142142
DropLongerThan: 0,
143143
},
144-
Tcp: tcpConfig{
144+
TCP: tcpConfig{
145145
Listen: ":2003",
146146
Enabled: true,
147147
DropFuture: &config.Duration{},
@@ -172,7 +172,7 @@ func NewConfig() *Config {
172172
DropPast: &config.Duration{},
173173
DropLongerThan: 0,
174174
},
175-
TelegrafHttpJson: telegrafHttpJsonConfig{
175+
TelegrafHTTPJSON: telegrafHTTPJSONConfig{
176176
Listen: ":2007",
177177
Enabled: false,
178178
DropFuture: &config.Duration{},
@@ -212,7 +212,7 @@ func PrintDefaultConfig() error {
212212
}
213213

214214
cfg.Upload = map[string]*uploader.Config{
215-
"graphite": &uploader.Config{
215+
"graphite": {
216216
Type: "points",
217217
Timeout: &config.Duration{
218218
Duration: time.Minute,
@@ -221,7 +221,7 @@ func PrintDefaultConfig() error {
221221
TableName: "graphite",
222222
URL: "http://localhost:8123/",
223223
},
224-
"graphite_tree": &uploader.Config{
224+
"graphite_tree": {
225225
Type: "tree",
226226
Timeout: &config.Duration{
227227
Duration: time.Minute,

0 commit comments

Comments
 (0)