#8 delete cobra, add parsing .netrc

This commit is contained in:
Gorbunov Kirill Andreevich
2024-03-31 14:49:40 +03:00
parent 8a85fce0a9
commit 55c0bdb49a
13 changed files with 221 additions and 92 deletions

View File

@@ -9,11 +9,11 @@ type Config struct {
}
type Source struct {
TypeGit string `json:"type" yaml:"type"`
Token string `json:"token" yaml:"token"`
APIURL string `json:"apiurl" yaml:"apiurl"`
Repository string `json:"repository" yaml:"repository"`
Owner string `json:"owner" yaml:"owner"`
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 {
@@ -23,8 +23,14 @@ type UpdateOpt struct {
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{},
Source: &Source{},
UpdateOpt: &UpdateOpt{},
}
}