scouting: Add a debug CLI for the webserver
This CLI should let us debug the webserver easily. It simulates calls
that the web page can make. Create a JSON version of the flatbuffer
message you want to send and pass it as a file to the correct option
on the `cli` binary. There's nothing really implemented yet because
the webserver doesn't have a whole lot implemented either.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: If396dd8dc3b1e24515cb2d5765b3d5f233066cda
diff --git a/scouting/webserver/requests/debug/cli/BUILD b/scouting/webserver/requests/debug/cli/BUILD
new file mode 100644
index 0000000..aba9177
--- /dev/null
+++ b/scouting/webserver/requests/debug/cli/BUILD
@@ -0,0 +1,32 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+ name = "cli_lib",
+ srcs = ["main.go"],
+ data = [
+ "//scouting/webserver/requests/messages:fbs_files",
+ "@com_github_google_flatbuffers//:flatc",
+ ],
+ importpath = "github.com/frc971/971-Robot-Code/scouting/webserver/requests/debug/cli",
+ target_compatible_with = ["@platforms//cpu:x86_64"],
+ visibility = ["//visibility:private"],
+ deps = ["//scouting/webserver/requests/debug"],
+)
+
+go_binary(
+ name = "cli",
+ embed = [":cli_lib"],
+ target_compatible_with = ["@platforms//cpu:x86_64"],
+ visibility = ["//visibility:public"],
+)
+
+py_test(
+ name = "cli_test",
+ srcs = [
+ "cli_test.py",
+ ],
+ data = [
+ ":cli",
+ "//scouting/webserver",
+ ],
+)