change token variable names
This commit is contained in:
parent
0ccbc0aec6
commit
ad8315668e
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Client struct {
|
Client struct {
|
||||||
token string
|
accessToken string
|
||||||
Client *http.Client
|
Client *http.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
Results struct {
|
Results struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user