24 lines
537 B
Go
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
|
|
}
|