summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2026-03-21 16:06:11 +0100
committerxengineering <me@xengineering.eu>2026-03-23 16:55:47 +0100
commit1a953af65ca5b3a83e7a50407a0c480ab22cc924 (patch)
tree689c7bcac63c1fca546211ad1f0ae420952313f3
parent7afbc98e6d715eef8809beb9793ccf5096104e26 (diff)
downloadsia-server-1a953af65ca5b3a83e7a50407a0c480ab22cc924.tar
sia-server-1a953af65ca5b3a83e7a50407a0c480ab22cc924.tar.zst
sia-server-1a953af65ca5b3a83e7a50407a0c480ab22cc924.zip
tools: websocket: Add dummy and build integration
Adding support for Shelly devices requires usage of the Websocket API. To make development easier a debug tool is created. Since it is not relevant for users it is not an artefact included into the deploy file archive. This also avoids later removing it which is by definition of the public API (see README.md) a breaking change.
-rw-r--r--meson.build7
-rw-r--r--tools/meson.build15
-rw-r--r--tools/websocket.go9
3 files changed, 28 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index fb1ec5d..4bc72bd 100644
--- a/meson.build
+++ b/meson.build
@@ -3,12 +3,13 @@ project(
version : '0.1.0-dev',
)
-subdir('configs')
-subdir('systemd')
-
go = find_program('go', required : true)
tar = find_program('tar', required : true)
+subdir('configs')
+subdir('systemd')
+subdir('tools')
+
fs = import('fs')
readme = fs.copyfile(meson.current_source_dir() / 'README.md')
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 0000000..1322ce0
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1,15 @@
+websocket_linux_amd64 = custom_target(
+ input : [
+ meson.current_source_dir() / 'websocket.go',
+ ],
+ output : 'websocket-linux-amd64',
+ env : {'GOOS': 'linux', 'GOARCH': 'amd64'},
+ command : [
+ go,
+ 'build',
+ '-o',
+ '@OUTPUT@',
+ '@INPUT@',
+ ],
+ build_by_default : true,
+)
diff --git a/tools/websocket.go b/tools/websocket.go
new file mode 100644
index 0000000..e429a6d
--- /dev/null
+++ b/tools/websocket.go
@@ -0,0 +1,9 @@
+package main
+
+import (
+ "fmt"
+)
+
+func main() {
+ fmt.Println("Websockets are cool.")
+}