refactor: reorganize codebase into modular packages

feat(global): add global package for shared variables and types
refactor(handlers): move handlers to dedicated package and update imports
refactor(session): extract session management to separate package
refactor(config): move config handling to dedicated package
refactor(router): update route handlers to use new package structure
refactor(main): simplify main.go by moving logic to packages
This commit is contained in:
2026-04-22 12:57:04 +08:00
parent df8df78bab
commit ddf91299e7
11 changed files with 667 additions and 663 deletions

40
global/global.go Normal file
View File

@@ -0,0 +1,40 @@
package global
import (
"database/sql"
)
type SoftwareInfo struct {
Name string
Version string
Developer string
BuildVer int16
Description string
BuildType string
}
type StatusFlags struct {
Debug bool
Online bool
WatchdogConnected bool
}
var (
ConfigDB *sql.DB
FrpcDB *sql.DB
LogsDB *sql.DB
)
var Software = SoftwareInfo{
Name: "Super-frpc",
Version: "0.0.1",
Developer: "Madobi Nanami",
BuildVer: 1,
BuildType: "debug",
}
var Is = StatusFlags{
Debug: false,
Online: false,
WatchdogConnected: false,
}