From fb0e4a85573e6a038e28b59a37e8ecd876c9d8ea Mon Sep 17 00:00:00 2001 From: Jasper Bok Date: Fri, 14 Jul 2023 16:09:58 +0200 Subject: [PATCH] Add the `JiraClient` type --- client.go | 24 ++++++++++++++++++++++++ client_test.go | 9 +++++++++ 2 files changed, 33 insertions(+) create mode 100644 client.go create mode 100644 client_test.go diff --git a/client.go b/client.go new file mode 100644 index 0000000..c5784ac --- /dev/null +++ b/client.go @@ -0,0 +1,24 @@ +package jiraclient + +import ( + "net/http" +) + +func NewJiraClient(username, token, domain string) *JiraClient { + client := &http.Client{} + + return &JiraClient{ + Username: username, + Token: token, + Domain: domain, + Client: client, + } +} + +// JiraClient manages communication with Jira Cloud's V2 REST API. +type JiraClient struct { + Username string + Token string + Domain string + Client *http.Client +} diff --git a/client_test.go b/client_test.go new file mode 100644 index 0000000..dce4e1c --- /dev/null +++ b/client_test.go @@ -0,0 +1,9 @@ +package jiraclient + +import ( + "testing" +) + +func TestJiraClientInstantiation(t *testing.T) { + _ = NewJiraClient("test", "test", "test") +}