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:
40
global/global.go
Normal file
40
global/global.go
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user