Skip to content

Commit

Permalink
Fix golint warnings regarding lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Jul 1, 2021
1 parent 97952c3 commit 92e7c2b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
34 changes: 17 additions & 17 deletions carbon/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
20 changes: 10 additions & 10 deletions carbon/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type commonConfig struct {
}

type clickhouseConfig struct {
Url string `toml:"url"`
URL string `toml:"url"`
}

type udpConfig struct {
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -133,15 +133,15 @@ func NewConfig() *Config {
CompAlgo: &config.Compression{CompAlgo: config.CompAlgoNone},
CompLevel: 0,
},
Udp: udpConfig{
UDP: udpConfig{
Listen: ":2003",
Enabled: true,
LogIncomplete: false,
DropFuture: &config.Duration{},
DropPast: &config.Duration{},
DropLongerThan: 0,
},
Tcp: tcpConfig{
TCP: tcpConfig{
Listen: ":2003",
Enabled: true,
DropFuture: &config.Duration{},
Expand Down Expand Up @@ -172,7 +172,7 @@ func NewConfig() *Config {
DropPast: &config.Duration{},
DropLongerThan: 0,
},
TelegrafHttpJson: telegrafHttpJsonConfig{
TelegrafHTTPJSON: telegrafHTTPJSONConfig{
Listen: ":2007",
Enabled: false,
DropFuture: &config.Duration{},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 92e7c2b

Please sign in to comment.