2024-03-24 20:52:32 +03:00
|
|
|
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 {
|
2024-04-02 22:54:15 +03:00
|
|
|
TypeGit string `json:"type" yaml:"type" env:"GIT_TYPE"`
|
2024-12-07 02:35:30 +03:00
|
|
|
Username string `json:"username" yaml:"username" env:"GIT_USERNAME"`
|
|
|
|
Password string `json:"password" yaml:"password" env:"GIT_PASSWORD,GIT_TOKEN"`
|
2024-04-02 22:54:15 +03:00
|
|
|
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"`
|
2024-03-24 20:52:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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"`
|
|
|
|
}
|
|
|
|
|
2024-04-02 22:54:15 +03:00
|
|
|
type Cli struct {
|
|
|
|
Command string `flag:"name=command,desc='choice command(update, close, checkupdaue, list)',default=''"`
|
|
|
|
Path string `flag:"name=path,desc='title of mod',default=''"`
|
|
|
|
}
|
|
|
|
|
2024-03-24 20:52:32 +03:00
|
|
|
func NewConfig() *Config {
|
|
|
|
return &Config{
|
2024-04-02 22:54:15 +03:00
|
|
|
Source: &Source{},
|
|
|
|
UpdateOpt: &UpdateOpt{},
|
2024-03-24 20:52:32 +03:00
|
|
|
}
|
|
|
|
}
|