cloud/bmaas/server: init
This adds the BMaaS server alongside its first functionality: serving an
Agent heartbeat API.
This allows (untrusted) Agents to communicate with the rest of the
system by submitting heartbeats which may include a hardware report.
The BMaaS server will likely grow to implement further functionality as
described in its README.
Change-Id: I1ede02121b3700079cbb11295525f4c167ee1e7d
Reviewed-on: https://review.monogon.dev/c/monogon/+/988
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/bmaas/server/cmd/main.go b/cloud/bmaas/server/cmd/main.go
new file mode 100644
index 0000000..59f6ca6
--- /dev/null
+++ b/cloud/bmaas/server/cmd/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "context"
+ "flag"
+
+ "source.monogon.dev/cloud/bmaas/server"
+)
+
+func main() {
+ s := &server.Server{}
+ s.Config.RegisterFlags()
+ flag.Parse()
+
+ ctx, ctxC := context.WithCancel(context.Background())
+ // TODO: context cancel on interrupt.
+ _ = ctxC
+
+ s.Start(ctx)
+ select {}
+}