Documentation ¶
Overview ¶
Package issues defines a client interface wrapping the Github API for creating, listing, and closing issues on a single repository.
Index ¶
- type Client
- func (c *Client) CloseIssue(issue *github.Issue) (*github.Issue, error)
- func (c *Client) CreateIssue(repo, title, body string, extra []string) (*github.Issue, error)
- func (c *Client) LabelIssue(issue *github.Issue, label string, add bool) error
- func (c *Client) ListOpenIssues() ([]*github.Issue, error)
- type ListClient
- type ListHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // githubClient is an authenticated client for accessing the github API. GithubClient *github.Client // contains filtered or unexported fields }
A Client manages communication with the Github API.
func NewClient ¶
NewClient creates an Client authenticated using the Github authToken. Future operations are only performed on the given github "org/repo".
func NewEnterpriseClient ¶
NewEnterpriseClient creates an Enterprise Client authenticated using the Github authToken. Future operations are only performed on the given github enterprise "org/repo". If uploadURL is empty it will be set to baseURL
func (*Client) CloseIssue ¶
CloseIssue changes the issue state to "closed" unconditionally. If the issue is already close, then this should have no effect.
func (*Client) CreateIssue ¶
CreateIssue creates a new Github issue. New issues are unassigned. Issues are labeled with with an alert named alertLabel. Labels are created automatically if they do not already exist in a repo.
func (*Client) LabelIssue ¶
LabelIssue adds or removes a label from an issue. This call is idempotent; it returns errors if there's a network error, but no error is returned if trying to add a label that's already present or remove one that's absent.
func (*Client) ListOpenIssues ¶
ListOpenIssues returns open issues created by past alerts within the client organization. Because ListOpenIssues uses the Github Search API, the *github.Issue instances returned will contain partial information. See also: https://developer.github.com/v3/search/#search-issues
type ListClient ¶
ListClient defines an interface for listing issues.
type ListHandler ¶
type ListHandler struct {
ListClient
}
ListHandler contains data needed for HTTP handlers.
func (*ListHandler) ServeHTTP ¶
func (lh *ListHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP lists open issues from github for view in a browser.