pkgdash/internal/configcli/config.go
2024-03-31 14:49:40 +03:00

37 lines
1.3 KiB
Go

package configcli
type Config struct {
PullRequestTitle string `json:"pull_request_title" yaml:"pull_request_title"`
PullRequestBody string `json:"pull_request_body" yaml:"pull_request_body"`
Branches []string `json:"branches" yaml:"branches"`
Source *Source `json:"source" yaml:"source"`
UpdateOpt *UpdateOpt `json:"update_opt" yaml:"update_opt"`
}
type Source struct {
TypeGit string `json:"type" yaml:"type" env:"GIT_TYPE"`
Token string `json:"token" yaml:"token" env:"GIT_TOKEN"`
APIURL string `json:"apiurl" yaml:"apiurl" env:"GIT_API"`
Repository string `json:"repository" yaml:"repository" env:"GIT_REPO"`
Owner string `json:"owner" yaml:"owner" env:"GIT_OWNER"`
}
type UpdateOpt struct {
Pre bool `json:"pre" yaml:"pre" default:"false"`
Major bool `json:"major" yaml:"major" default:"false"`
UpMajor bool `json:"up_major" yaml:"up_major" default:"false"`
Cached bool `json:"cached" yaml:"cached" default:"true"`
}
type Cli struct {
Method string `flag:"name=method,desc='choice method(update, close, checkupdaue, list)',default='checkupdate'"`
Path string `flag:"name=path,desc='title of mod',default=''"`
}
func NewConfig() *Config {
return &Config{
Source: &Source{},
UpdateOpt: &UpdateOpt{},
}
}