init commit

This commit is contained in:
2026-01-25 17:13:15 -06:00
commit 1bbfc332d8
27 changed files with 2462 additions and 0 deletions

30
pkg/version/version.go Normal file
View File

@@ -0,0 +1,30 @@
package version
import (
"os"
"path/filepath"
"runtime"
"strings"
)
// Version is set at build time or read from file
var Version = "dev"
// Get returns the application version
func Get() string {
if Version != "dev" {
return Version
}
// Try to read from VERSION file at runtime (for development)
_, filename, _, ok := runtime.Caller(0)
if ok {
root := filepath.Join(filepath.Dir(filename), "..", "..")
data, err := os.ReadFile(filepath.Join(root, "VERSION"))
if err == nil {
return strings.TrimSpace(string(data))
}
}
return Version
}