Add the `JiraClient` type

main
Jasper Bok 2023-07-14 16:09:58 +02:00
parent 7be17e6c88
commit fb0e4a8557
2 changed files with 33 additions and 0 deletions

24
client.go 100644
View File

@ -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
}

9
client_test.go 100644
View File

@ -0,0 +1,9 @@
package jiraclient
import (
"testing"
)
func TestJiraClientInstantiation(t *testing.T) {
_ = NewJiraClient("test", "test", "test")
}