more metrics infrastructure (#128)

This commit is contained in:
Michael Quigley
2023-03-03 13:51:10 -05:00
parent f2e887f70b
commit e6dc836cc6
4 changed files with 85 additions and 4 deletions

View File

@@ -1,5 +1,18 @@
package metrics
import (
"github.com/michaelquigley/cf"
"github.com/pkg/errors"
)
type Config struct {
Source interface{}
}
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
}