mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
24w21a
This commit is contained in:
parent
2a5570a447
commit
6f67f6f5b4
9 changed files with 72 additions and 5 deletions
|
|
@ -12,6 +12,7 @@ type Config struct {
|
|||
Auth AuthConfig
|
||||
Blacklist BlacklistConfig
|
||||
Whitelist WhitelistConfig
|
||||
RateLimit RateLimitConfig
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
|
|
@ -49,6 +50,12 @@ type WhitelistConfig struct {
|
|||
WhitelistFile string `toml:"whitelistFile"`
|
||||
}
|
||||
|
||||
type RateLimitConfig struct {
|
||||
Enabled bool `toml:"enabled"`
|
||||
RatePerMinute int `toml:"ratePerMinute"`
|
||||
Burst int `toml:"burst"`
|
||||
}
|
||||
|
||||
// LoadConfig 从 TOML 配置文件加载配置
|
||||
func LoadConfig(filePath string) (*Config, error) {
|
||||
var config Config
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue