mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 20:52:25 +00:00
Refactor configuration and update handling:
- Modify .luarc.json to include global Lua scripts. - Update Makefile to include LDFLAGS for versioning. - Enhance node.go to implement version checking and update handling. - Refactor Lua global variables in _globals.lua and echo.lua to use new structures. - Remove deprecated http.lua and update config.yaml for TLS and update settings. - Introduce new update.go for version management and update checking. - Add tests for version comparison in update_test.go. - Improve error handling in various server methods.
This commit is contained in:
29
core/config/consts.go
Normal file
29
core/config/consts.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package config
|
||||
|
||||
var UUIDLength int = 4
|
||||
|
||||
var ApiRoute string = "/api/{ver}"
|
||||
var ComDirRoute string = "/com"
|
||||
|
||||
var NodeVersion string
|
||||
var ActualFileNanme string = "actual.txt"
|
||||
|
||||
type _internalConsts struct{}
|
||||
type _serverConsts struct{}
|
||||
type _updateConsts struct{}
|
||||
|
||||
func GetUpdateConsts() _updateConsts { return _updateConsts{} }
|
||||
func (_ _updateConsts) GetNodeVersion() string {
|
||||
if NodeVersion == "" {
|
||||
return "version0.0.0-none"
|
||||
}
|
||||
return NodeVersion
|
||||
}
|
||||
func (_ _updateConsts) GetActualFileName() string { return ActualFileNanme }
|
||||
|
||||
func GetInternalConsts() _internalConsts { return _internalConsts{} }
|
||||
func (_ _internalConsts) GetUUIDLength() int { return UUIDLength }
|
||||
|
||||
func GetServerConsts() _serverConsts { return _serverConsts{} }
|
||||
func (_ _serverConsts) GetApiRoute() string { return ApiRoute }
|
||||
func (_ _serverConsts) GetComDirRoute() string { return ComDirRoute }
|
||||
Reference in New Issue
Block a user