refactor(global): move config to global package and consolidate handlers
- Move Config struct and related functions to global package - Consolidate handler utilities into utils package - Remove deprecated handlers and instance packages - Add new handlers package with settings and proxy functionality - Update config.json to include watchdog enabled flag
This commit is contained in:
+3
-13
@@ -9,27 +9,17 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"super-frpc/config"
|
||||
"super-frpc/database"
|
||||
"super-frpc/global"
|
||||
"super-frpc/postLog"
|
||||
)
|
||||
|
||||
func GetConfigDir() (string, error) {
|
||||
cfg, err := config.GetConfig()
|
||||
if err != nil {
|
||||
postLog.Error(fmt.Sprintf("[GetConfigDir] Failed to get config: %v", err))
|
||||
return "", err
|
||||
}
|
||||
return cfg.InstancePath, nil
|
||||
return global.CurrentConfig.InstancePath, nil
|
||||
}
|
||||
|
||||
func GetFrpcPath() (string, error) {
|
||||
cfg, err := config.GetConfig()
|
||||
if err != nil {
|
||||
postLog.Error(fmt.Sprintf("[GetFrpcPath] Failed to get config: %v", err))
|
||||
return "", err
|
||||
}
|
||||
return cfg.FrpcPath, nil
|
||||
return global.CurrentConfig.FrpcPath, nil
|
||||
}
|
||||
|
||||
func GetInitSystem() string {
|
||||
|
||||
Reference in New Issue
Block a user