1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-08-06 22:13:02 +02:00

Merge branch 'master' of https://github.com/EvgenKostenko/go-jira into EvgenKostenko-master

* 'master' of https://github.com/EvgenKostenko/go-jira:
  refactor project tests + go fmt
  add one more test for project service
  delete uncompleted boards
  add fmt dependency to jira.go
  get Authenticated reports  session from main repository
  Add project and tests
  Implement workload in issue and Project list
  Change Coocke session get from request
This commit is contained in:
Andy Grunwald
2016-06-03 18:20:19 +02:00
7 changed files with 10629 additions and 4 deletions

View File

@ -23,6 +23,7 @@ type Client struct {
// Services used for talking to different parts of the JIRA API.
Authentication *AuthenticationService
Issue *IssueService
Project *ProjectService
}
// NewClient returns a new JIRA API client.
@ -48,6 +49,7 @@ func NewClient(httpClient *http.Client, baseURL string) (*Client, error) {
}
c.Authentication = &AuthenticationService{client: c}
c.Issue = &IssueService{client: c}
c.Project = &ProjectService{client: c}
return c, nil
}
@ -82,7 +84,9 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ
// Set session cookie if there is one
if c.session != nil {
req.Header.Set("Cookie", fmt.Sprintf("%s=%s", c.session.Session.Name, c.session.Session.Value))
for _, cookie := range c.session.SetCoockie {
req.AddCookie(cookie)
}
}
return req, nil