gocommon/tracing/exporter/zipkin/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 zipkin
import (
"github.com/asaskevich/govalidator"
"github.com/juju/errors"
)
// ConfigStruct is the configuration for Zipkin Provider.
type ConfigStruct struct {
URL string `yaml:"url"`
}
// IsValid will check that the Zipkin configuration is valid.
func (c *ConfigStruct) IsValid() error {
if c.URL == "" {
return errors.NotValidf("URL is empty in Zipkin configuration")
} else if isValid := govalidator.IsURL(c.URL); !isValid {
return errors.NotValidf("URL is invalid in Zipkin configuration")
}
return nil
}