This commit is contained in:
WJQSERVER 2024-10-06 01:03:38 +08:00
parent 5dbf137116
commit b87a8de3c4
5 changed files with 16 additions and 20 deletions

View file

@ -1,9 +1,4 @@
blacklist:
username1:
- repo1
- repo2
username2:
- repo3
- repo4
username3:
- repo5
- test/test1
- example/repo2
- another/repo3

View file

@ -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
}