gocommon/tracing/exporter/jaeger/config.go
Matthieu 'JP' DERASSE 06f0722cdb
All checks were successful
continuous-integration/drone/push Build is passing
feat(tracing): Start to implement tracing system
2022-12-14 17:09:05 +00:00

24 lines
537 B
Go

package jaeger
import (
"github.com/asaskevich/govalidator"
"github.com/juju/errors"
)
// ConfigStruct is the configuration for Jaeger Provider.
type ConfigStruct struct {
URL string `yaml:"url"`
}
// IsValid will check that the Jaeger configuration is valid.
func (c *ConfigStruct) IsValid() error {
if c.URL == "" {
return errors.NotValidf("URL is empty in Jaeger configuration")
} else if isValid := govalidator.IsURL(c.URL); !isValid {
return errors.NotValidf("URL is invalid in Jaeger configuration")
}
return nil
}