add function handling (basic)

This commit is contained in:
2025-11-30 15:28:30 +02:00
parent c1e5fc90ee
commit 6aae5f9fb0
10 changed files with 215 additions and 2 deletions

View File

@@ -13,8 +13,13 @@ type ServerConfig struct {
LogPath string `mapstructure:"log_path"`
}
type FuncConfig struct {
FunctionDir string `mapstructure:"func_dir"`
}
type Config struct {
Server ServerConfig `mapstructure:"server"`
Server ServerConfig `mapstructure:"server"`
Functions FuncConfig `mapstructure:"functions"`
}
var configPath atomic.Value // string
@@ -22,6 +27,8 @@ var defaults = map[string]any{
"server.port": 8080,
"server.address": "127.0.0.0",
"server.static_dir": "./static",
"functions.func_dir": "./functions",
}
func read(cfg *Config) error {