nitter/nitters/config.go

26 lines
423 B
Go
Raw Normal View History

2023-03-08 13:40:04 +00:00
package nitters
2023-03-08 15:13:49 +00:00
import "errors"
var (
ErrMissingNamespace = errors.New("namespace is required")
ErrMissingRepo = errors.New("repo name is required")
)
2023-03-08 13:40:04 +00:00
type Config struct {
Namespace string `mapstructure:"namespace"`
Repo string `mapstructure:"repo"`
}
2023-03-08 15:13:49 +00:00
func (c Config) Validate() error {
if c.Namespace == "" {
return ErrMissingNamespace
}
if c.Repo == "" {
return ErrMissingRepo
}
return nil
}