add function handling (basic)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user