change token variable names

This commit is contained in:
Ryan Cavicchioni 2020-02-29 00:43:32 -06:00
parent 0ccbc0aec6
commit ad8315668e
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
2 changed files with 6 additions and 6 deletions

View File

@ -24,13 +24,13 @@ var errorMap = map[int]error{
523: errors.New("Something went wrong on LIFX's end"), 523: errors.New("Something went wrong on LIFX's end"),
} }
func NewClient(token string) *Client { func NewClient(accessToken string) *Client {
tr := &http.Transport{ tr := &http.Transport{
//TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper), //TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper),
} }
return &Client{ return &Client{
token: token, accessToken: accessToken,
Client: &http.Client{Transport: tr}, Client: &http.Client{Transport: tr},
} }
} }
@ -39,7 +39,7 @@ func (s *Client) NewRequest(method, url string, body io.Reader) (req *http.Reque
if err != nil { if err != nil {
return return
} }
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", s.token)) req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", s.accessToken))
return return
} }

View File

@ -29,8 +29,8 @@ type (
} }
Client struct { Client struct {
token string accessToken string
Client *http.Client Client *http.Client
} }
Results struct { Results struct {