add poweroff and reboot functions

This commit is contained in:
2025-07-27 07:54:18 -04:00
parent 5d35d19543
commit 31296f5b0f
4 changed files with 76 additions and 4 deletions

View File

@@ -5,14 +5,17 @@ import (
"git.dubyatp.xyz/orphanage/client/facts"
"git.dubyatp.xyz/orphanage/client/httputil"
"git.dubyatp.xyz/orphanage/client/power"
"git.dubyatp.xyz/orphanage/client/testfunc"
)
func AddRoutes(
mux *http.ServeMux,
) {
mux.Handle("/", http.NotFoundHandler())
mux.Handle("/helloworld", httputil.HelloWorld(nil))
mux.Handle("/testjson", testfunc.HelloWorldJSON(nil))
mux.Handle("/facts", facts.GetFacts(nil))
mux.Handle("GET /", http.NotFoundHandler())
mux.Handle("GET /helloworld", httputil.HelloWorld(nil))
mux.Handle("GET /testjson", testfunc.HelloWorldJSON(nil))
mux.Handle("GET /facts", facts.GetFacts(nil))
mux.Handle("POST /power/reboot", power.Reboot(nil))
mux.Handle("POST /power/poweroff", power.PowerOff(nil))
}