issues

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package issues is a Go API for GitHub issues

Index

Constants

View Source
const ClientId = "3cb4616362f3ae823872"

Variables

View Source
var CloseUrl = "https://api.github.com/repos"

Modified during testing

View Source
var ConfigPath string
View Source
var ErrBadTempFile = errors.New("issue with using temporary file")
View Source
var ErrNoCreds = errors.New("no credentials. Run `ghi auth` to access this feature")
View Source
var IssuesURL = "https://api.github.com/search/issues"

Modified during testing

View Source
var OpenUrl = "https://api.github.com/repos"

Modified during testing

View Source
var PollUrl = "https://github.com/login/oauth/access_token"

Modified during testing

Functions

func CloseIssue

func CloseIssue(id, owner, repo string) error

CloseIssue closes a GitHub issue

func CredsPoll

func CredsPoll(i int, code string) (url.Values, error)

CredsPoll requests for the user's access token at the given interval (seconds)

func GetCreds

func GetCreds(fname string) (string, error)

GetCreds gets the user's authorized credentials

func Open

func Open(owner, repo string) error

Open opens in issue in GitHub after prompting the user to create one

func StoreCreds

func StoreCreds(creds string, loc string) error

StoreCreds stores the given credentials in ~/.config/ghi/config

Types

type Issue

type Issue struct {
	Number    int
	HTMLURL   string `json:"html_url"`
	Title     string
	State     string
	User      *User
	CreatedAt time.Time `json:"created_at"`
	Body      string    // in Markdown format
}

type IssuesSearchResult

type IssuesSearchResult struct {
	TotalCount int `json:"total_count"`
	Items      []*Issue
}
func Search(term string, page int) (*IssuesSearchResult, error)

Search queries the GitHub issue tracker.

type User

type User struct {
	Login   string
	HTMLURL string `json:"html_url"`
}

Jump to

Keyboard shortcuts

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