 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- type Client
- type ClientOption
- type FakeHTTP
- type GraphQLError
- type GraphQLErrorResponse
- type Issue
- type IssueLabel
- type IssuesAndTotalCount
- type IssuesPayload
- type NotFoundError
- type PullRequest
- func CreatePullRequest(client *Client, repo *Repository, params map[string]interface{}) (*PullRequest, error)
- func PullRequestByNumber(client *Client, repo ghrepo.Interface, number int) (*PullRequest, error)
- func PullRequestForBranch(client *Client, repo ghrepo.Interface, branch string) (*PullRequest, error)
- func PullRequestList(client *Client, vars map[string]interface{}, limit int) ([]PullRequest, error)
 
- type PullRequestAndTotalCount
- type PullRequestChecksStatus
- type PullRequestReviewStatus
- type PullRequestsPayload
- type RepoNetworkResult
- type Repository
- type RepositoryOwner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
	// contains filtered or unexported fields
}
    Client facilitates making HTTP requests to the GitHub API
type ClientOption ¶
type ClientOption = func(http.RoundTripper) http.RoundTripper
ClientOption represents an argument to NewClient
func AddHeader ¶
func AddHeader(name, value string) ClientOption
AddHeader turns a RoundTripper into one that adds a request header
func ReplaceTripper ¶
func ReplaceTripper(tr http.RoundTripper) ClientOption
ReplaceTripper substitutes the underlying RoundTripper with a custom one
func VerboseLog ¶
func VerboseLog(out io.Writer, logBodies bool) ClientOption
VerboseLog enables request/response logging within a RoundTripper
type FakeHTTP ¶
type FakeHTTP struct {
	// Requests stores references to sequental requests that RoundTrip has received
	Requests []*http.Request
	// contains filtered or unexported fields
}
    FakeHTTP provides a mechanism by which to stub HTTP responses through
type GraphQLError ¶
GraphQLError is a single error returned in a GraphQL response
type GraphQLErrorResponse ¶
type GraphQLErrorResponse struct {
	Errors []GraphQLError
}
    GraphQLErrorResponse contains errors returned in a GraphQL response
func (GraphQLErrorResponse) Error ¶
func (gr GraphQLErrorResponse) Error() string
type Issue ¶
type Issue struct {
	Number    int
	Title     string
	URL       string
	State     string
	Body      string
	UpdatedAt time.Time
	Comments  struct {
		TotalCount int
	}
	Author struct {
		Login string
	}
	Labels struct {
		Nodes      []IssueLabel
		TotalCount int
	}
}
    func IssueByNumber ¶
func IssueCreate ¶
func IssueCreate(client *Client, repo *Repository, params map[string]interface{}) (*Issue, error)
IssueCreate creates an issue in a GitHub repository
type IssueLabel ¶
type IssueLabel struct {
	Name string
}
    type IssuesAndTotalCount ¶
type IssuesPayload ¶
type IssuesPayload struct {
	Assigned  IssuesAndTotalCount
	Mentioned IssuesAndTotalCount
	Authored  IssuesAndTotalCount
}
    func IssueStatus ¶
type NotFoundError ¶
type NotFoundError struct {
	// contains filtered or unexported fields
}
    type PullRequest ¶
type PullRequest struct {
	Number      int
	Title       string
	State       string
	URL         string
	BaseRefName string
	HeadRefName string
	Body        string
	Author struct {
		Login string
	}
	HeadRepositoryOwner struct {
		Login string
	}
	HeadRepository struct {
		Name             string
		DefaultBranchRef struct {
			Name string
		}
	}
	IsCrossRepository   bool
	MaintainerCanModify bool
	ReviewDecision string
	Commits struct {
		TotalCount int
		Nodes      []struct {
			Commit struct {
				StatusCheckRollup struct {
					Contexts struct {
						Nodes []struct {
							State      string
							Status     string
							Conclusion string
						}
					}
				}
			}
		}
	}
}
    func CreatePullRequest ¶
func CreatePullRequest(client *Client, repo *Repository, params map[string]interface{}) (*PullRequest, error)
CreatePullRequest creates a pull request in a GitHub repository
func PullRequestByNumber ¶
func PullRequestForBranch ¶
func PullRequestList ¶
func PullRequestList(client *Client, vars map[string]interface{}, limit int) ([]PullRequest, error)
func (*PullRequest) ChecksStatus ¶
func (pr *PullRequest) ChecksStatus() (summary PullRequestChecksStatus)
func (PullRequest) HeadLabel ¶
func (pr PullRequest) HeadLabel() string
func (*PullRequest) ReviewStatus ¶
func (pr *PullRequest) ReviewStatus() PullRequestReviewStatus
type PullRequestAndTotalCount ¶
type PullRequestAndTotalCount struct {
	TotalCount   int
	PullRequests []PullRequest
}
    type PullRequestChecksStatus ¶
type PullRequestReviewStatus ¶
type PullRequestsPayload ¶
type PullRequestsPayload struct {
	ViewerCreated   PullRequestAndTotalCount
	ReviewRequested PullRequestAndTotalCount
	CurrentPR       *PullRequest
}
    func PullRequests ¶
type RepoNetworkResult ¶
type RepoNetworkResult struct {
	ViewerLogin  string
	Repositories []*Repository
}
    RepoNetworkResult describes the relationship between related repositories
func RepoNetwork ¶
func RepoNetwork(client *Client, repos []ghrepo.Interface) (RepoNetworkResult, error)
RepoNetwork inspects the relationship between multiple GitHub repositories
type Repository ¶
type Repository struct {
	ID    string
	Name  string
	Owner RepositoryOwner
	IsPrivate        bool
	HasIssuesEnabled bool
	ViewerPermission string
	DefaultBranchRef struct {
		Name   string
		Target struct {
			OID string
		}
	}
	Parent *Repository
}
    Repository contains information about a GitHub repo
func ForkRepo ¶
func ForkRepo(client *Client, repo ghrepo.Interface) (*Repository, error)
ForkRepo forks the repository on GitHub and returns the new repository
func GitHubRepo ¶
func GitHubRepo(client *Client, repo ghrepo.Interface) (*Repository, error)
GitHubRepo looks up the node ID of a named repository
func (Repository) IsFork ¶
func (r Repository) IsFork() bool
IsFork is true when this repository has a parent repository
func (Repository) RepoName ¶
func (r Repository) RepoName() string
RepoName is the name of the repository
func (Repository) RepoOwner ¶
func (r Repository) RepoOwner() string
RepoOwner is the login name of the owner
func (Repository) ViewerCanPush ¶
func (r Repository) ViewerCanPush() bool
ViewerCanPush is true when the requesting user has push access
type RepositoryOwner ¶
type RepositoryOwner struct {
	Login string
}
    RepositoryOwner is the owner of a GitHub repository