Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
moqsien committed Feb 1, 2025
1 parent ff7cd34 commit 8d5a23a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/cnf/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,9 @@ func GetFetcher(dUrl string) (fetcher *request.Fetcher) {
}
return
}

func GetGithubToken() string {
cnf := NewVMRConf()
cnf.Load()
return cnf.GithubToken
}
10 changes: 10 additions & 0 deletions internal/cnf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ type VMRConf struct {
ThreadNum int `json,toml:"download_thread_num"`
UseCustomedMirrors bool `json,toml:"use_customed_mirrors"`
AllowNestedSessions bool `json,toml:"allow_nested_sessions"`
GithubToken string `json,toml:"github_token"`
}

func NewVMRConf() (v *VMRConf) {
Expand Down Expand Up @@ -216,3 +217,12 @@ func (v *VMRConf) ToggleAllowNestedSessions() bool {
v.Save()
return v.AllowNestedSessions
}

func (v *VMRConf) SetGithubToken(token string) {
v.Load()
if token == "" {
return
}
v.GithubToken = token
v.Save()
}

0 comments on commit 8d5a23a

Please sign in to comment.