github

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 9 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Owner, Repo string
	*github.Client
}

Client is the client for interacting with the GitHub API

func (*Client) CreateRelease

func (c *Client) CreateRelease(ctx context.Context, req *github.RepositoryRelease) (*github.RepositoryRelease, error)

CreateRelease creates a new release object in the GitHub API

func (*Client) EditRelease

func (c *Client) EditRelease(ctx context.Context, releaseID int64, req *github.RepositoryRelease) (*github.RepositoryRelease, error)

EditRelease edit a release object within the GitHub API

func (*Client) GetRelease

func (c *Client) GetRelease(ctx context.Context, tag string) (*github.RepositoryRelease, error)

GetRelease queries the GitHub API for a specified release object

func (*Client) GetRepository

func (c *Client) GetRepository(ctx context.Context) (*github.Repository, error)

GetRepository fetches a repository

func (*Client) ListAssets

func (c *Client) ListAssets(ctx context.Context, releaseID int64) ([]*github.ReleaseAsset, error)

ListAssets lists assets associated with a given release

func (*Client) ListReleases

func (c *Client) ListReleases(ctx context.Context) ([]*github.RepositoryRelease, error)

ListReleases lists Releases given a repository

func (*Client) UploadAsset

func (c *Client) UploadAsset(ctx context.Context, releaseID int64, filename string) (*github.ReleaseAsset, error)

UploadAsset uploads specified assets to a given release object

type GitHub

type GitHub interface {
	GetRepository(ctx context.Context) (*github.Repository, error)
	CreateRelease(ctx context.Context, req *github.RepositoryRelease) (*github.RepositoryRelease, error)
	GetRelease(ctx context.Context, tag string) (*github.RepositoryRelease, error)
	EditRelease(ctx context.Context, releaseID int64, req *github.RepositoryRelease) (*github.RepositoryRelease, error)
	ListReleases(ctx context.Context) ([]*github.RepositoryRelease, error)
	UploadAsset(ctx context.Context, releaseID int64, filename string) (*github.ReleaseAsset, error)
	ListAssets(ctx context.Context, releaseID int64) ([]*github.ReleaseAsset, error)
}

GitHub contains the functions necessary for interacting with GitHub release objects

func NewGitHubClient

func NewGitHubClient(owner, repo, token string) (GitHub, error)

NewGitHubClient creates and initializes a new GitHubClient

Jump to

Keyboard shortcuts

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