2024-02-22 07:09:31 +00:00
|
|
|
package config
|
|
|
|
|
2024-02-28 14:04:47 +00:00
|
|
|
import "errors"
|
|
|
|
|
|
|
|
var _ Validator = (*SiaConfig)(nil)
|
|
|
|
|
2024-02-22 07:09:31 +00:00
|
|
|
type SiaConfig struct {
|
|
|
|
Key string `mapstructure:"key"`
|
|
|
|
URL string `mapstructure:"url"`
|
|
|
|
}
|
2024-02-28 14:04:47 +00:00
|
|
|
|
|
|
|
func (s SiaConfig) Validate() error {
|
|
|
|
if s.Key == "" {
|
|
|
|
return errors.New("core.storage.sia.key is required")
|
|
|
|
}
|
|
|
|
if s.URL == "" {
|
|
|
|
return errors.New("core.storage.sia.url is required")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|