diff --git a/pkg/rove/api.go b/pkg/rove/api.go index 308e816..b97713c 100644 --- a/pkg/rove/api.go +++ b/pkg/rove/api.go @@ -11,7 +11,7 @@ import ( // Status queries the status of the server func (s Server) Status() (r StatusResponse, err error) { - s.GET("status", &r) + s.Get("status", &r) return } @@ -29,7 +29,7 @@ type StatusResponse struct { // Register registers a user by name // Responds with a unique ID for that user to be used in future requests func (s Server) Register(d RegisterData) (r RegisterResponse, err error) { - err = s.POST("register", d, &r) + err = s.Post("register", d, &r) return } @@ -52,7 +52,7 @@ type RegisterResponse struct { // Spawn spawns the rover for an account // Responds with the position of said rover func (s Server) Spawn(account string, d SpawnData) (r SpawnResponse, err error) { - err = s.POST(path.Join(account, "spawn"), d, &r) + err = s.Post(path.Join(account, "spawn"), d, &r) return } @@ -75,7 +75,7 @@ type SpawnResponse struct { // Command issues a set of commands from the user func (s Server) Command(account string, d CommandData) (r CommandResponse, err error) { - err = s.POST(path.Join(account, "command"), d, &r) + err = s.Post(path.Join(account, "command"), d, &r) return } @@ -95,7 +95,7 @@ type CommandResponse struct { // Radar queries the current radar for the user func (s Server) Radar(account string) (r RadarResponse, err error) { - err = s.GET(path.Join(account, "radar"), &r) + err = s.Get(path.Join(account, "radar"), &r) return } @@ -114,7 +114,7 @@ type RadarResponse struct { // Rover queries the current state of the rover func (s Server) Rover(account string) (r RoverResponse, err error) { - err = s.GET(path.Join(account, "rover"), &r) + err = s.Get(path.Join(account, "rover"), &r) return } diff --git a/pkg/rove/http.go b/pkg/rove/http.go index 2321bdc..e415762 100644 --- a/pkg/rove/http.go +++ b/pkg/rove/http.go @@ -11,8 +11,8 @@ import ( // Server is a simple wrapper to a server path type Server string -// GET performs a GET request -func (s Server) GET(path string, out interface{}) error { +// Get performs a Get request +func (s Server) Get(path string, out interface{}) error { u := url.URL{ Scheme: "http", Host: string(s), @@ -29,8 +29,8 @@ func (s Server) GET(path string, out interface{}) error { } } -// POST performs a POST request -func (s Server) POST(path string, in, out interface{}) error { +// Post performs a Post request +func (s Server) Post(path string, in, out interface{}) error { u := url.URL{ Scheme: "http", Host: string(s),