aboutsummaryrefslogtreecommitdiff
path: root/proxy.go
diff options
context:
space:
mode:
Diffstat (limited to 'proxy.go')
-rw-r--r--proxy.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/proxy.go b/proxy.go
index 71c5f83..6628aec 100644
--- a/proxy.go
+++ b/proxy.go
@@ -9,6 +9,7 @@ import (
"os"
"path/filepath"
"regexp"
+ "runtime/debug"
"strings"
"sync"
)
@@ -40,3 +41,19 @@ func Path(path ...string) string {
return proxyDir + "/" + strings.Join(path, "")
}
+
+// Version returns the version string of the running instance.
+func Version() (version string, ok bool) {
+ info, ok := debug.ReadBuildInfo()
+ if !ok {
+ return
+ }
+
+ for _, dep := range info.Deps {
+ if dep.Path == "github.com/HimbeerserverDE/mt-multiserver-proxy" {
+ return dep.Version, true
+ }
+ }
+
+ return
+}