gocommon/tracing/exporter/jaeger/config.go

24 lines
537 B
Go
Raw Permalink Normal View History

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
}