This commit is contained in:
WJQSERVER 2025-02-16 19:48:53 +08:00
parent bd666e08d1
commit 785a74dfeb
14 changed files with 241 additions and 126 deletions

View file

@ -6,6 +6,7 @@ import (
type Config struct {
Server ServerConfig
Httpc HttpcConfig
Pages PagesConfig
Log LogConfig
CORS CORSConfig
@ -24,6 +25,20 @@ type ServerConfig struct {
Debug bool `toml:"debug"`
}
/*
[httpc]
mode = "auto" # "auto" or "advanced"
maxIdleConns = 100 # only for advanced mode
maxIdleConnsPerHost = 60 # only for advanced mode
maxConnsPerHost = 0 # only for advanced mode
*/
type HttpcConfig struct {
Mode string `toml:"mode"`
MaxIdleConns int `toml:"maxIdleConns"`
MaxIdleConnsPerHost int `toml:"maxIdleConnsPerHost"`
MaxConnsPerHost int `toml:"maxConnsPerHost"`
}
type PagesConfig struct {
Enabled bool `toml:"enabled"`
StaticDir string `toml:"staticDir"`