issues

package
v0.0.0-...-dfed30f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package issues defines a client interface wrapping the Github API for creating, listing, and closing issues on a single repository.

Index

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

func NewClient(org, authToken, alertLabel string) *Client

NewClient creates an Client authenticated using the Github authToken. Future operations are only performed on the given github "org/repo".

func NewEnterpriseClient

func NewEnterpriseClient(baseURL, uploadURL, org, authToken, alertLabel string) (*Client, error)

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

func (c *Client) CloseIssue(issue *github.Issue) (*github.Issue, error)

CloseIssue changes the issue state to "closed" unconditionally. If the issue is already close, then this should have no effect.

func (*Client) CreateIssue

func (c *Client) CreateIssue(repo, title, body string, extra []string) (*github.Issue, error)

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

func (c *Client) LabelIssue(issue *github.Issue, label string, add bool) error

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

func (c *Client) ListOpenIssues() ([]*github.Issue, error)

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

type ListClient interface {
	ListOpenIssues() ([]*github.Issue, error)
}

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.

Directories

Path Synopsis
Package local provides in memory operations on GitHub issues.
Package local provides in memory operations on GitHub issues.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL