make method naming more consistent
This commit is contained in:
parent
05566f480f
commit
73a666a216
@ -76,7 +76,7 @@ func (c *Client) NewRequest(method, url string, body io.Reader) (req *http.Reque
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) setStateRequest(selector string, state State) (*http.Response, error) {
|
func (c *Client) setState(selector string, state State) (*http.Response, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
j []byte
|
j []byte
|
||||||
@ -99,7 +99,7 @@ func (c *Client) setStateRequest(selector string, state State) (*http.Response,
|
|||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) setStatesRequest(selector string, states States) (*http.Response, error) {
|
func (c *Client) setStates(selector string, states States) (*http.Response, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
j []byte
|
j []byte
|
||||||
@ -122,7 +122,7 @@ func (c *Client) setStatesRequest(selector string, states States) (*http.Respons
|
|||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) toggleRequest(selector string, duration float64) (*http.Response, error) {
|
func (c *Client) toggle(selector string, duration float64) (*http.Response, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
j []byte
|
j []byte
|
||||||
|
@ -98,7 +98,7 @@ func (c *Client) SetState(selector string, state State) (*Response, error) {
|
|||||||
resp *http.Response
|
resp *http.Response
|
||||||
)
|
)
|
||||||
|
|
||||||
if resp, err = c.setStateRequest(selector, state); err != nil {
|
if resp, err = c.setState(selector, state); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
@ -126,7 +126,7 @@ func (c *Client) SetStates(selector string, states States) (*Response, error) {
|
|||||||
resp *http.Response
|
resp *http.Response
|
||||||
)
|
)
|
||||||
|
|
||||||
if resp, err = c.setStatesRequest(selector, states); err != nil {
|
if resp, err = c.setStates(selector, states); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
@ -164,7 +164,7 @@ func (c *Client) Toggle(selector string, duration float64) (*Response, error) {
|
|||||||
resp *http.Response
|
resp *http.Response
|
||||||
)
|
)
|
||||||
|
|
||||||
if resp, err = c.toggleRequest(selector, duration); err != nil {
|
if resp, err = c.toggle(selector, duration); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user