mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
metrics/config: simple
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
71905df402
commit
459d46b26a
1 changed files with 7 additions and 8 deletions
|
|
@ -40,15 +40,14 @@ type Config struct {
|
|||
}
|
||||
|
||||
func (c *Config) Validate() error {
|
||||
if c.EnableInfluxDB || c.EnableInfluxDBV2 {
|
||||
v1FlagIsSet := c.InfluxDBUsername != "" || c.InfluxDBPassword != ""
|
||||
v2FlagIsSet := c.InfluxDBToken != "" || c.InfluxDBOrganization != "" || c.InfluxDBBucket != ""
|
||||
|
||||
if c.EnableInfluxDB && v2FlagIsSet {
|
||||
return errors.New("Flags --influxdb.metrics.organization, --influxdb.metrics.token, --influxdb.metrics.bucket are only available for influxdb-v2")
|
||||
} else if c.EnableInfluxDBV2 && v1FlagIsSet {
|
||||
return errors.New("Flags --influxdb.metrics.username, --influxdb.metrics.password are only available for influxdb-v1")
|
||||
}
|
||||
if c.EnableInfluxDBV2 && v1FlagIsSet {
|
||||
return errors.New("Flags --influxdb.metrics.username, --influxdb.metrics.password are only available for influxdb-v1")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue