make method naming more consistent

This commit is contained in:
Ryan Cavicchioni 2020-03-07 20:06:22 -06:00
parent 05566f480f
commit 73a666a216
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
2 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ func (c *Client) NewRequest(method, url string, body io.Reader) (req *http.Reque
return
}
func (c *Client) setStateRequest(selector string, state State) (*http.Response, error) {
func (c *Client) setState(selector string, state State) (*http.Response, error) {
var (
err error
j []byte
@ -99,7 +99,7 @@ func (c *Client) setStateRequest(selector string, state State) (*http.Response,
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 (
err error
j []byte
@ -122,7 +122,7 @@ func (c *Client) setStatesRequest(selector string, states States) (*http.Respons
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 (
err error
j []byte

View File

@ -98,7 +98,7 @@ func (c *Client) SetState(selector string, state State) (*Response, error) {
resp *http.Response
)
if resp, err = c.setStateRequest(selector, state); err != nil {
if resp, err = c.setState(selector, state); err != nil {
return nil, err
}
defer resp.Body.Close()
@ -126,7 +126,7 @@ func (c *Client) SetStates(selector string, states States) (*Response, error) {
resp *http.Response
)
if resp, err = c.setStatesRequest(selector, states); err != nil {
if resp, err = c.setStates(selector, states); err != nil {
return nil, err
}
defer resp.Body.Close()
@ -164,7 +164,7 @@ func (c *Client) Toggle(selector string, duration float64) (*Response, error) {
resp *http.Response
)
if resp, err = c.toggleRequest(selector, duration); err != nil {
if resp, err = c.toggle(selector, duration); err != nil {
return nil, err
}
defer resp.Body.Close()