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