update go-github dependency

closes #42
This commit is contained in:
Chris Hendrix
2017-05-23 17:21:04 -07:00
parent ebe605054f
commit 28d6890c8c
81 changed files with 12126 additions and 1633 deletions

View File

@@ -6,6 +6,7 @@
package github
import (
"context"
"fmt"
"time"
)
@@ -18,7 +19,7 @@ type IssueEvent struct {
// The User that generated this event.
Actor *User `json:"actor,omitempty"`
// Event identifies the actual type of Event that occurred. Possible
// Event identifies the actual type of Event that occurred. Possible
// values are:
//
// closed
@@ -43,7 +44,7 @@ type IssueEvent struct {
// Someone unspecified @mentioned the Actor [sic] in an issue comment body.
//
// assigned, unassigned
// The Actor assigned the issue to or removed the assignment from the Assignee.
// The Assigner assigned the issue to or removed the assignment from the Assignee.
//
// labeled, unlabeled
// The Actor added or removed the Label from the issue.
@@ -64,6 +65,7 @@ type IssueEvent struct {
// Only present on certain events; see above.
Assignee *User `json:"assignee,omitempty"`
Assigner *User `json:"assigner,omitempty"`
CommitID *string `json:"commit_id,omitempty"`
Milestone *Milestone `json:"milestone,omitempty"`
Label *Label `json:"label,omitempty"`
@@ -73,7 +75,7 @@ type IssueEvent struct {
// ListIssueEvents lists events for the specified issue.
//
// GitHub API docs: https://developer.github.com/v3/issues/events/#list-events-for-an-issue
func (s *IssuesService) ListIssueEvents(owner, repo string, number int, opt *ListOptions) ([]*IssueEvent, *Response, error) {
func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opt *ListOptions) ([]*IssueEvent, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues/%v/events", owner, repo, number)
u, err := addOptions(u, opt)
if err != nil {
@@ -86,18 +88,18 @@ func (s *IssuesService) ListIssueEvents(owner, repo string, number int, opt *Lis
}
var events []*IssueEvent
resp, err := s.client.Do(req, &events)
resp, err := s.client.Do(ctx, req, &events)
if err != nil {
return nil, resp, err
}
return events, resp, err
return events, resp, nil
}
// ListRepositoryEvents lists events for the specified repository.
//
// GitHub API docs: https://developer.github.com/v3/issues/events/#list-events-for-a-repository
func (s *IssuesService) ListRepositoryEvents(owner, repo string, opt *ListOptions) ([]*IssueEvent, *Response, error) {
func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opt *ListOptions) ([]*IssueEvent, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo)
u, err := addOptions(u, opt)
if err != nil {
@@ -110,18 +112,18 @@ func (s *IssuesService) ListRepositoryEvents(owner, repo string, opt *ListOption
}
var events []*IssueEvent
resp, err := s.client.Do(req, &events)
resp, err := s.client.Do(ctx, req, &events)
if err != nil {
return nil, resp, err
}
return events, resp, err
return events, resp, nil
}
// GetEvent returns the specified issue event.
//
// GitHub API docs: https://developer.github.com/v3/issues/events/#get-a-single-event
func (s *IssuesService) GetEvent(owner, repo string, id int) (*IssueEvent, *Response, error) {
func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int) (*IssueEvent, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/issues/events/%v", owner, repo, id)
req, err := s.client.NewRequest("GET", u, nil)
@@ -130,12 +132,12 @@ func (s *IssuesService) GetEvent(owner, repo string, id int) (*IssueEvent, *Resp
}
event := new(IssueEvent)
resp, err := s.client.Do(req, event)
resp, err := s.client.Do(ctx, req, event)
if err != nil {
return nil, resp, err
}
return event, resp, err
return event, resp, nil
}
// Rename contains details for 'renamed' events.