client

package
v0.0.0-...-8999b7b Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: ISC Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultOwner = "collectd"
	DefaultRepo  = "collectd"

	StatusSuccess = "success"
	StatusFailure = "failure"
	StatusError   = "error"
	StatusPending = "pending"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*github.Client
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, owner, repo string) (*Client, error)

func (*Client) CheckRuns

func (c *Client) CheckRuns(ctx context.Context, ref string) ([]*github.CheckRun, error)

func (*Client) CreateStatus

func (c *Client) CreateStatus(ctx context.Context, name, state, desc, url, ref string) error

func (*Client) FormatUser

func (c *Client) FormatUser(ctx context.Context, login string) string

func (*Client) Issue

func (c *Client) Issue(ctx context.Context, number int) (*Issue, error)

func (*Client) Milestones

func (c *Client) Milestones(ctx context.Context) (map[string]int, error)

func (*Client) NewStage

func (c *Client) NewStage(pr *github.PullRequest) *Stage

func (*Client) Owner

func (c *Client) Owner() string

func (*Client) PR

func (c *Client) PR(ctx context.Context, number int) (*PR, error)

func (*Client) PullRequestBySHA

func (c *Client) PullRequestBySHA(ctx context.Context, sha string) (*PR, error)

func (*Client) Repo

func (c *Client) Repo() string

func (*Client) WrapIssue

func (c *Client) WrapIssue(issue *github.Issue) *Issue

func (*Client) WrapPR

func (c *Client) WrapPR(pr *github.PullRequest) *PR

type Issue

type Issue struct {
	*github.Issue
	// contains filtered or unexported fields
}

func (*Issue) AddLabel

func (i *Issue) AddLabel(ctx context.Context, label string) error

func (*Issue) HasLabel

func (i *Issue) HasLabel(name string) bool

func (*Issue) Milestone

func (i *Issue) Milestone(ctx context.Context, id int) error

func (*Issue) Number

func (i *Issue) Number() int

func (*Issue) String

func (i *Issue) String() string

type PR

type PR struct {
	*github.PullRequest
	// contains filtered or unexported fields
}

func (*PR) Blob

func (pr *PR) Blob(ctx context.Context, sha string) (string, error)

func (*PR) CombinedStatus

func (pr *PR) CombinedStatus(ctx context.Context) (*github.CombinedStatus, error)

CombinedStatus ...

func (*PR) Files

func (pr *PR) Files(ctx context.Context) ([]PRFile, error)

Files returns the files that are added or modified by this PR. Files without SHA (deleted files) are not returned.

func (*PR) Issue

func (pr *PR) Issue(ctx context.Context) (*Issue, error)

func (*PR) Merge

func (pr *PR) Merge(ctx context.Context, title, msg string) error

Merge merges the pull request.

func (*PR) Mergeable

func (pr *PR) Mergeable(ctx context.Context) (bool, error)

Mergeable returns true if the pull request can be merged without conflicts.

func (*PR) Number

func (pr *PR) Number() int

func (*PR) Reviews

func (pr *PR) Reviews(ctx context.Context) ([]*github.PullRequestReview, error)

func (*PR) String

func (pr *PR) String() string

type PRFile

type PRFile struct {
	Filename string
	SHA      string
}

type Stage

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

func (*Stage) Add

func (s *Stage) Add(path, content string)

func (*Stage) Commit

func (s *Stage) Commit(ctx context.Context, message string) error

Jump to

Keyboard shortcuts

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