change token variable names
This commit is contained in:
parent
0ccbc0aec6
commit
ad8315668e
@ -24,12 +24,12 @@ var errorMap = map[int]error{
|
||||
523: errors.New("Something went wrong on LIFX's end"),
|
||||
}
|
||||
|
||||
func NewClient(token string) *Client {
|
||||
func NewClient(accessToken string) *Client {
|
||||
tr := &http.Transport{
|
||||
//TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper),
|
||||
}
|
||||
return &Client{
|
||||
token: token,
|
||||
accessToken: accessToken,
|
||||
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 {
|
||||
return
|
||||
}
|
||||
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", s.token))
|
||||
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", s.accessToken))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ type (
|
||||
}
|
||||
|
||||
Client struct {
|
||||
token string
|
||||
accessToken string
|
||||
Client *http.Client
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user