Skip to content

Commit 9413d68

Browse files
Merge pull request #48 from elijahmorg/feature/setToken
Re-add ability to set access token independently
2 parents f71cf28 + fa7d2de commit 9413d68

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

client.go

+9-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
var (
14-
version = "v0.1.0"
14+
version = "v0.1.1"
1515
)
1616

1717
type Client struct {
@@ -82,11 +82,15 @@ func (c *Client) Ping() bool {
8282
return true
8383
}
8484

85-
// TokenAuth sets authorization headers for subsequent requests.
86-
func (c *Client) TokenAuth(token string) *Client {
87-
c.Transport.header.Set("Authorization", "Bearer "+token)
88-
c.Transport.header.Set("apikey", token)
85+
// SetApiKey sets api key header for subsequent requests.
86+
func (c *Client) SetApiKey(apiKey string) *Client {
87+
c.Transport.header.Set("apikey", apiKey)
88+
return c
89+
}
8990

91+
// SetAuthToken sets authorization header for subsequent requests.
92+
func (c *Client) SetAuthToken(authToken string) *Client {
93+
c.Transport.header.Set("Authorization", "Bearer "+authToken)
9094
return c
9195
}
9296

0 commit comments

Comments
 (0)