mirror of
https://github.com/openziti/zrok.git
synced 2024-11-26 10:04:16 +01:00
29 lines
548 B
Go
29 lines
548 B
Go
package metrics
|
|
|
|
import (
|
|
"github.com/michaelquigley/cf"
|
|
"github.com/openziti/zrok/controller/store"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
type Config struct {
|
|
Source interface{}
|
|
Influx *InfluxConfig
|
|
Store *store.Config
|
|
}
|
|
|
|
type InfluxConfig struct {
|
|
Url string
|
|
Bucket string
|
|
Org string
|
|
Token string `cf:"+secret"`
|
|
}
|
|
|
|
func LoadConfig(path string) (*Config, error) {
|
|
cfg := &Config{}
|
|
if err := cf.BindYaml(cfg, path, GetCfOptions()); err != nil {
|
|
return nil, errors.Wrapf(err, "error loading config from '%v'", path)
|
|
}
|
|
return cfg, nil
|
|
}
|