mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
fix
This commit is contained in:
parent
5dbf137116
commit
b87a8de3c4
5 changed files with 16 additions and 20 deletions
|
|
@ -1,9 +1,4 @@
|
|||
blacklist:
|
||||
username1:
|
||||
- repo1
|
||||
- repo2
|
||||
username2:
|
||||
- repo3
|
||||
- repo4
|
||||
username3:
|
||||
- repo5
|
||||
- test/test1
|
||||
- example/repo2
|
||||
- another/repo3
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ type Config struct {
|
|||
} `yaml:"blacklist"`
|
||||
}
|
||||
|
||||
type BlacklistMap struct {
|
||||
Blist map[string][]string `yaml:"blacklist"`
|
||||
type Blist struct {
|
||||
Blacklist []string `yaml:"blacklist"`
|
||||
}
|
||||
|
||||
// LoadConfig 从 YAML 配置文件加载配置
|
||||
|
|
@ -47,8 +47,8 @@ func LoadConfig(filePath string) (*Config, error) {
|
|||
}
|
||||
|
||||
// LoadBlacklistConfig 从 YAML 配置文件加载黑名单配置
|
||||
func LoadBlacklistConfig(filePath string) (*BlacklistMap, error) {
|
||||
var blacklist BlacklistMap
|
||||
func LoadBlacklistConfig(filePath string) (*Blist, error) {
|
||||
var blacklist Blist
|
||||
if err := loadYAML(filePath, &blacklist); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue