add new functionality and improve backend server structure

- Enhance server functionality and optimize backend code
- Add multi-database support (PostgreSQL, MySQL, SQLite)
This commit is contained in:
Tola Leng
2026-03-09 17:36:42 +07:00
parent 4b27b85038
commit f5a985ff1e
526 changed files with 173928 additions and 0 deletions
@@ -0,0 +1,32 @@
package osutils
import (
"os"
"strings"
)
var runDirs = []string{os.TempDir(), cacheDir()}
// IsProbablyGoRun loosely checks if the current program was started with "go run".
func IsProbablyGoRun() bool {
for _, dir := range runDirs {
if dir != "" && strings.HasPrefix(os.Args[0], dir) {
return true
}
}
return false
}
func cacheDir() string {
dir := os.Getenv("GOCACHE")
if dir == "off" {
return ""
}
if dir == "" {
dir, _ = os.UserCacheDir()
}
return dir
}