aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/version/useragent.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-01 11:14:12 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-01 11:14:12 +0200
commitcff4e77bfe62606c19c205e02fd63b3777855392 (patch)
treeec8573073bf68253267ed741b60bf23b8e4554a3 /version/useragent.go
parentui: support clipboard copying for log items (diff)
downloadwireguard-windows-cff4e77bfe62606c19c205e02fd63b3777855392.tar.xz
wireguard-windows-cff4e77bfe62606c19c205e02fd63b3777855392.zip
version: dynamically get file version
Diffstat (limited to 'version/useragent.go')
-rw-r--r--version/useragent.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/version/useragent.go b/version/useragent.go
new file mode 100644
index 00000000..321bc0a6
--- /dev/null
+++ b/version/useragent.go
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
+ */
+
+package version
+
+import (
+ "fmt"
+ "golang.zx2c4.com/wireguard/device"
+ "runtime"
+)
+
+func UserAgent() string {
+ return fmt.Sprintf("WireGuard/%s (wireguard-go %s; %s; %s; %s)", RunningVersion(), device.WireGuardGoVersion, OsName(), runtime.Version(), runtime.GOARCH)
+}