mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
25w31a
This commit is contained in:
parent
f540b2edcd
commit
d94f6c0f5d
7 changed files with 63 additions and 3 deletions
|
|
@ -18,6 +18,7 @@ type Config struct {
|
|||
Whitelist WhitelistConfig
|
||||
RateLimit RateLimitConfig
|
||||
Outbound OutboundConfig
|
||||
Docker DockerConfig
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -143,6 +144,16 @@ type OutboundConfig struct {
|
|||
Url string `toml:"url"`
|
||||
}
|
||||
|
||||
/*
|
||||
[docker]
|
||||
enabled = false
|
||||
target = "ghcr" # ghcr/dockerhub
|
||||
*/
|
||||
type DockerConfig struct {
|
||||
Enabled bool `toml:"enabled"`
|
||||
Target string `toml:"target"`
|
||||
}
|
||||
|
||||
// LoadConfig 从 TOML 配置文件加载配置
|
||||
func LoadConfig(filePath string) (*Config, error) {
|
||||
if !FileExists(filePath) {
|
||||
|
|
@ -244,5 +255,9 @@ func DefaultConfig() *Config {
|
|||
Enabled: false,
|
||||
Url: "socks5://127.0.0.1:1080",
|
||||
},
|
||||
Docker: DockerConfig{
|
||||
Enabled: false,
|
||||
Target: "ghcr",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue