From e99ad147d35ccb274d54381d620e55207b616d52 Mon Sep 17 00:00:00 2001 From: Carlo Nyte <8445082+whoiscarlo@users.noreply.github.com> Date: Tue, 12 Dec 2023 10:04:27 -0800 Subject: [PATCH 1/3] added functions for setting ApiKey and Authorization Headers I removed the function TokenAuth, with SetApiKey and SetAuthToken, so that users can change the apiKey and authorization headers separately. --- client.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 2cc0496..9a581b6 100644 --- a/client.go +++ b/client.go @@ -81,10 +81,16 @@ func (c *Client) Ping() bool { return true } -// TokenAuth sets authorization headers for subsequent requests. -func (c *Client) TokenAuth(token string) *Client { - c.clientTransport.header.Set("Authorization", "Bearer "+token) - c.clientTransport.header.Set("apikey", token) +// SetApiKey sets api key header for subsequent requests. +func (c *Client) SetApiKey(apiKey string) *Client { + c.clientTransport.header.Set("apikey", apiKey) + return c +} + + +// SetAuthToken sets authorization header for subsequent requests. +func (c *Client) SetAuthToken(authToken string) *Client { + c.clientTransport.header.Set("Authorization", "Bearer "+authToken) return c } From 924ad139dda5fa880cacf00d891d972760a84e83 Mon Sep 17 00:00:00 2001 From: Carlo Nyte <8445082+whoiscarlo@users.noreply.github.com> Date: Tue, 12 Dec 2023 10:22:28 -0800 Subject: [PATCH 2/3] update version --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 9a581b6..499a7f9 100644 --- a/client.go +++ b/client.go @@ -11,7 +11,7 @@ import ( ) var ( - version = "v0.0.6" + version = "v0.0.7" ) type Client struct { From 157b31e4ce06d47606f219d06a2a241fcbb33749 Mon Sep 17 00:00:00 2001 From: Carlo Nyte <8445082+whoiscarlo@users.noreply.github.com> Date: Sat, 16 Dec 2023 17:36:00 -0500 Subject: [PATCH 3/3] Update version --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 499a7f9..09ca508 100644 --- a/client.go +++ b/client.go @@ -11,7 +11,7 @@ import ( ) var ( - version = "v0.0.7" + version = "v0.1.0" ) type Client struct {