github

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package github implements baton's source and issue APIs on GitHub. It uses release-sdk where it has the call (and its retries), and go-github directly for contents, labels, and sub-issues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Token

func Token() (string, error)

Token returns GITHUB_TOKEN, else GH_TOKEN, else `gh auth token`.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client reads components and writes issues.

func New

func New(token string) (*Client, error)

New returns a Client authenticated with token.

func (*Client) AddSubIssue

func (c *Client) AddSubIssue(repo string, number int, childID int64) error

AddSubIssue implements writer.Issues.

func (*Client) Comment

func (c *Client) Comment(repo string, number int, body string) error

Comment implements writer.Issues.

func (*Client) CommitAt

func (c *Client) CommitAt(repo string, asOf time.Time) (string, error)

CommitAt implements source.Source.

func (*Client) CreateIssue

func (c *Client) CreateIssue(repo, title, body string, labels, assignees []string) (writer.Issue, error)

CreateIssue implements writer.Issues.

func (*Client) CreateLabel

func (c *Client) CreateLabel(repo, label, color, description string) error

CreateLabel implements writer.Issues.

func (*Client) File

func (c *Client) File(repo, path, ref string) (content string, found bool, err error)

File implements source.Source.

func (*Client) FlaggedLatest

func (c *Client) FlaggedLatest(repo string) (source.Release, error)

FlaggedLatest implements source.Source.

func (*Client) GetJSON

func (c *Client) GetJSON(url string) (map[string]any, error)

GetJSON implements source.Source.

func (*Client) LabelExists

func (c *Client) LabelExists(repo, label string) (bool, error)

LabelExists implements writer.Issues.

func (*Client) ListIssues

func (c *Client) ListIssues(repo, label string) ([]writer.Issue, error)

ListIssues implements writer.Issues.

func (*Client) PathHistory

func (c *Client) PathHistory(repo, path string, until time.Time) ([]source.Commit, error)

PathHistory implements source.Source.

func (*Client) Releases

func (c *Client) Releases(repo, kind string) ([]source.Release, error)

Releases implements source.Source.

func (*Client) SubIssueIDs

func (c *Client) SubIssueIDs(repo string, number int) ([]int64, error)

SubIssueIDs implements writer.Issues.

func (*Client) TagCommit

func (c *Client) TagCommit(repo, tag string) (string, error)

TagCommit implements source.Source. The commits endpoint peels annotated tags, and the refs/tags/ prefix keeps a branch of the same name from matching.

func (*Client) UpdateIssue

func (c *Client) UpdateIssue(repo string, number int, u writer.Update) (writer.Issue, error)

UpdateIssue implements writer.Issues.

Jump to

Keyboard shortcuts

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