github

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*github.Client
}

func NewAppClient

func NewAppClient(cfg *Config) (*Client, error)

NewAppClient inits GitHub app client according to user's installation ID

func NewClient

func NewClient(cfg *Config) *Client

func (*Client) CreateCheckRun

func (c *Client) CreateCheckRun(ctx context.Context, owner, repo string, opts github.CreateCheckRunOptions) (*github.CheckRun, error)

func (*Client) CreateHook

func (c *Client) CreateHook(ctx context.Context, owner, repo string, hook *git.Hook) (*github.Hook, error)

func (*Client) CreateStatus

func (c *Client) CreateStatus(ctx context.Context, owner, repo, ref string, status *github.RepoStatus) (*github.RepoStatus, error)

func (*Client) DeleteHook

func (c *Client) DeleteHook(ctx context.Context, owner, repo string, id int64) error

func (*Client) GetAuthenticatedUser

func (c *Client) GetAuthenticatedUser(ctx context.Context) (*github.User, error)

func (*Client) GetContents

func (*Client) GetLatestRepositoryCommit added in v1.4.0

func (c *Client) GetLatestRepositoryCommit(ctx context.Context, owner, repo, path, branch string) (*github.RepositoryCommit, error)

func (*Client) GetPullRequest

func (c *Client) GetPullRequest(ctx context.Context, owner string, repo string, number int) (*github.PullRequest, error)

func (*Client) GetTree added in v1.4.0

func (c *Client) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*github.Tree, error)

func (*Client) GetTreeContents added in v1.4.0

func (c *Client) GetTreeContents(ctx context.Context, owner, repo, path, branch string) (afero.Fs, error)

GetTreeContents recursively gets all file contents under the given path, and writes to an in-memory file system.

func (*Client) GetYAMLContents added in v1.4.0

func (c *Client) GetYAMLContents(ctx context.Context, owner, repo, path, branch string, split bool) ([]string, error)

GetYAMLContents recursively gets all yaml contents under the given path. if split is true, manifests in the same file will be split to separated ones.

func (*Client) ListBranches

func (c *Client) ListBranches(ctx context.Context, owner, repo string, opts *ListOptions) ([]*github.Branch, error)

func (*Client) ListCommits

func (c *Client) ListCommits(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*github.RepositoryCommit, error)

func (*Client) ListFiles

func (c *Client) ListFiles(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*github.CommitFile, error)

func (*Client) ListHooks

func (c *Client) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*github.Hook, error)

func (*Client) ListInstallations

func (c *Client) ListInstallations(ctx context.Context, opts *ListOptions) ([]*github.Installation, error)

func (*Client) ListOrganizationsForAuthenticatedUser

func (c *Client) ListOrganizationsForAuthenticatedUser(ctx context.Context, opts *ListOptions) ([]*github.Organization, error)

func (*Client) ListPullRequests

func (c *Client) ListPullRequests(ctx context.Context, owner string, repo string, opts *github.PullRequestListOptions) ([]*github.PullRequest, error)

func (*Client) ListReleases

func (c *Client) ListReleases(ctx context.Context, owner, repo string, opts *ListOptions) ([]*github.RepositoryRelease, error)

func (*Client) ListRepositoriesForAuthenticatedUser

func (c *Client) ListRepositoriesForAuthenticatedUser(ctx context.Context, opts *ListOptions) ([]*github.Repository, error)

func (*Client) ListRepositoryCommits added in v1.4.0

func (c *Client) ListRepositoryCommits(ctx context.Context, owner, repo, path, branch string, opts *ListOptions) ([]*github.RepositoryCommit, error)

func (*Client) ListTags

func (c *Client) ListTags(ctx context.Context, owner, repo string, opts *ListOptions) ([]*github.RepositoryTag, error)

func (*Client) UpdateCheckRun

func (c *Client) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts github.UpdateCheckRunOptions) (*github.CheckRun, error)

type Config

type Config struct {
	BaseURL     string
	AccessToken string
	Proxy       string
	AppKey      string
	AppID       int
	Owner       string

	HTTPClient *http.Client
}

type ListOptions

type ListOptions struct {
	// Page number of the results to fetch. Default: 1
	Page int
	// Results per page (max 100). Default: 30
	PerPage int

	// NoPaginated indicates if we need to fetch all result or just one page. True means fetching just one page
	NoPaginated bool
}

Jump to

Keyboard shortcuts

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