From 922e7290c37e46046b1a4e68818c77c44a192b2e Mon Sep 17 00:00:00 2001 From: Collin Guarino Date: Sat, 13 Feb 2016 11:25:45 -0500 Subject: Added documentation for Bridge.Delete, Bridge.Put, Light.Delete. --- bridge.go | 3 +++ light.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/bridge.go b/bridge.go index bf50f2d..62cd252 100644 --- a/bridge.go +++ b/bridge.go @@ -80,6 +80,8 @@ func (self *Bridge) Post(path string, params interface{}) ([]byte, io.Reader, er return handleResponse(resp) } +// Bridge.Put will send an http PUT to the bridge with +// a body formatted with parameters (in a generic interface) func (self *Bridge) Put(path string, params interface{}) ([]byte, io.Reader, error) { uri := fmt.Sprintf("http://" + self.IPAddress + path) client := &http.Client{} @@ -99,6 +101,7 @@ func (self *Bridge) Put(path string, params interface{}) ([]byte, io.Reader, err return handleResponse(resp) } +// Bridge.Delete will send an http DELETE to the bridge func (self *Bridge) Delete(path string) error { uri := fmt.Sprintf("http://" + self.IPAddress + path) client := &http.Client{} diff --git a/light.go b/light.go index 3d3b68c..aab344b 100644 --- a/light.go +++ b/light.go @@ -90,6 +90,8 @@ func (self *Light) Toggle() error { return nil } +// Light.Delete will remove the light from the list of +// lights available on the bridge. func (self *Light) Delete() error { uri := fmt.Sprintf("/api/%s/lights/%d", self.Bridge.Username, self.Index) err := self.Bridge.Delete(uri) -- cgit v1.2.3