Merge v1.2.1-master
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
a590155b0b
commit
aeb17182b4
396 changed files with 27271 additions and 9969 deletions
37
vendor/github.com/google/go-github/github/repos_statuses.go
generated
vendored
37
vendor/github.com/google/go-github/github/repos_statuses.go
generated
vendored
|
@ -6,6 +6,7 @@
|
|||
package github
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
@ -15,11 +16,11 @@ type RepoStatus struct {
|
|||
ID *int `json:"id,omitempty"`
|
||||
URL *string `json:"url,omitempty"`
|
||||
|
||||
// State is the current state of the repository. Possible values are:
|
||||
// State is the current state of the repository. Possible values are:
|
||||
// pending, success, error, or failure.
|
||||
State *string `json:"state,omitempty"`
|
||||
|
||||
// TargetURL is the URL of the page representing this status. It will be
|
||||
// TargetURL is the URL of the page representing this status. It will be
|
||||
// linked from the GitHub UI to allow users to see the source of the status.
|
||||
TargetURL *string `json:"target_url,omitempty"`
|
||||
|
||||
|
@ -39,10 +40,10 @@ func (r RepoStatus) String() string {
|
|||
}
|
||||
|
||||
// ListStatuses lists the statuses of a repository at the specified
|
||||
// reference. ref can be a SHA, a branch name, or a tag name.
|
||||
// reference. ref can be a SHA, a branch name, or a tag name.
|
||||
//
|
||||
// GitHub API docs: http://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
|
||||
func (s *RepositoriesService) ListStatuses(owner, repo, ref string, opt *ListOptions) ([]*RepoStatus, *Response, error) {
|
||||
// GitHub API docs: https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
|
||||
func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opt *ListOptions) ([]*RepoStatus, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, ref)
|
||||
u, err := addOptions(u, opt)
|
||||
if err != nil {
|
||||
|
@ -54,20 +55,20 @@ func (s *RepositoriesService) ListStatuses(owner, repo, ref string, opt *ListOpt
|
|||
return nil, nil, err
|
||||
}
|
||||
|
||||
statuses := new([]*RepoStatus)
|
||||
resp, err := s.client.Do(req, statuses)
|
||||
var statuses []*RepoStatus
|
||||
resp, err := s.client.Do(ctx, req, &statuses)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return *statuses, resp, err
|
||||
return statuses, resp, nil
|
||||
}
|
||||
|
||||
// CreateStatus creates a new status for a repository at the specified
|
||||
// reference. Ref can be a SHA, a branch name, or a tag name.
|
||||
// reference. Ref can be a SHA, a branch name, or a tag name.
|
||||
//
|
||||
// GitHub API docs: http://developer.github.com/v3/repos/statuses/#create-a-status
|
||||
func (s *RepositoriesService) CreateStatus(owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) {
|
||||
// GitHub API docs: https://developer.github.com/v3/repos/statuses/#create-a-status
|
||||
func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, ref)
|
||||
req, err := s.client.NewRequest("POST", u, status)
|
||||
if err != nil {
|
||||
|
@ -75,17 +76,17 @@ func (s *RepositoriesService) CreateStatus(owner, repo, ref string, status *Repo
|
|||
}
|
||||
|
||||
repoStatus := new(RepoStatus)
|
||||
resp, err := s.client.Do(req, repoStatus)
|
||||
resp, err := s.client.Do(ctx, req, repoStatus)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return repoStatus, resp, err
|
||||
return repoStatus, resp, nil
|
||||
}
|
||||
|
||||
// CombinedStatus represents the combined status of a repository at a particular reference.
|
||||
type CombinedStatus struct {
|
||||
// State is the combined state of the repository. Possible values are:
|
||||
// State is the combined state of the repository. Possible values are:
|
||||
// failure, pending, or success.
|
||||
State *string `json:"state,omitempty"`
|
||||
|
||||
|
@ -103,10 +104,10 @@ func (s CombinedStatus) String() string {
|
|||
}
|
||||
|
||||
// GetCombinedStatus returns the combined status of a repository at the specified
|
||||
// reference. ref can be a SHA, a branch name, or a tag name.
|
||||
// reference. ref can be a SHA, a branch name, or a tag name.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
|
||||
func (s *RepositoriesService) GetCombinedStatus(owner, repo, ref string, opt *ListOptions) (*CombinedStatus, *Response, error) {
|
||||
func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opt *ListOptions) (*CombinedStatus, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, ref)
|
||||
u, err := addOptions(u, opt)
|
||||
if err != nil {
|
||||
|
@ -119,10 +120,10 @@ func (s *RepositoriesService) GetCombinedStatus(owner, repo, ref string, opt *Li
|
|||
}
|
||||
|
||||
status := new(CombinedStatus)
|
||||
resp, err := s.client.Do(req, status)
|
||||
resp, err := s.client.Do(ctx, req, status)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return status, resp, err
|
||||
return status, resp, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue