Port most of the HTTP code over to gin

This commit is contained in:
Dane Everitt
2020-04-05 18:00:33 -07:00
parent 223b9e05a1
commit cf2ef1a173
22 changed files with 1233 additions and 968 deletions

12
server/power.go Normal file
View File

@@ -0,0 +1,12 @@
package server
type PowerAction struct {
Action string `json:"action"`
}
func (pr *PowerAction) IsValid() bool {
return pr.Action == "start" ||
pr.Action == "stop" ||
pr.Action == "kill" ||
pr.Action == "restart"
}