25 lines
423 B
Go
25 lines
423 B
Go
package nitters
|
|
|
|
import "errors"
|
|
|
|
var (
|
|
ErrMissingNamespace = errors.New("namespace is required")
|
|
ErrMissingRepo = errors.New("repo name is required")
|
|
)
|
|
|
|
type Config struct {
|
|
Namespace string `mapstructure:"namespace"`
|
|
Repo string `mapstructure:"repo"`
|
|
}
|
|
|
|
func (c Config) Validate() error {
|
|
if c.Namespace == "" {
|
|
return ErrMissingNamespace
|
|
}
|
|
|
|
if c.Repo == "" {
|
|
return ErrMissingRepo
|
|
}
|
|
|
|
return nil
|
|
}
|