Refactor configuration structures and improve comments for clarity

This commit is contained in:
alex
2025-07-05 12:51:42 +03:00
parent 43b130acdb
commit 06e8ab5658
2 changed files with 37 additions and 24 deletions

View File

@@ -1,12 +1,19 @@
package config
var UUIDLength int = 4
// UUIDLength is uuids length for sessions. By default it is 16 bytes.
var UUIDLength byte = 4
// ApiRoute setting for go-chi for main route for api requests
var ApiRoute string = "/api/{ver}"
// ComDirRoute setting for go-chi for main route for commands
var ComDirRoute string = "/com"
// NodeVersion is the version of the node. It can be set by the build system or manually.
// If not set, it will return "version0.0.0-none" by default
var NodeVersion string
var ActualFileNanme string = "actual.txt"
// ActualFileName is a feature of the GoSally update system.
// In the repository, the file specified in the variable contains the current information about updates
var ActualFileName string = "actual.txt"
type _internalConsts struct{}
type _serverConsts struct{}
@@ -19,10 +26,10 @@ func (_ _updateConsts) GetNodeVersion() string {
}
return NodeVersion
}
func (_ _updateConsts) GetActualFileName() string { return ActualFileNanme }
func (_ _updateConsts) GetActualFileName() string { return ActualFileName }
func GetInternalConsts() _internalConsts { return _internalConsts{} }
func (_ _internalConsts) GetUUIDLength() int { return UUIDLength }
func (_ _internalConsts) GetUUIDLength() byte { return UUIDLength }
func GetServerConsts() _serverConsts { return _serverConsts{} }
func (_ _serverConsts) GetApiRoute() string { return ApiRoute }