This commit is contained in:
WJQSERVER 2024-11-01 03:58:47 +08:00
parent 2a5570a447
commit 6f67f6f5b4
9 changed files with 72 additions and 5 deletions

View file

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