gh

package
v0.0.0-...-2272bf2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(ctx context.Context, client *github.Client, name string, permissions []string) (*github.Authorization, error)

Add creates a new authorization token on the remote.

func AnonClient

func AnonClient() *github.Client

AnonClient creates a new github.Client instance, using an anonymous transport.

func ClientFromCredentials

func ClientFromCredentials(username string, password string, OTP string) *github.Client

ClientFromCredentials creates a new github.Client instance, using a BasicAuthTransport.

func ClientFromToken

func ClientFromToken(token string) *github.Client

ClientFromToken creates a new github.Client instance, using an OAuth2 transport.

func CreateRelease

func CreateRelease(ctx context.Context, client *github.Client, owner, repo, version, author string, draft bool, body string) (*github.RepositoryRelease, error)

CreateRelease creates a new release on the remote repository.

func Delete

func Delete(ctx context.Context, client *github.Client, id int) error

Delete removes a personal access token on the remote

func DeleteRelease

func DeleteRelease(ctx context.Context, client *github.Client, owner string, repo string, version string) error

DeleteRelease deletes a release from the remote repository.

func DeleteReleaseAsset

func DeleteReleaseAsset(ctx context.Context, client *github.Client, owner string, repo string, id int) error

DeleteReleaseAsset deletes a release asset from the remote repository.

func DownloadAsset

func DownloadAsset(url string, out io.Writer) error

DownloadAsset downloads an asset from a release, it handles redirect.

func GeneratePersonalAuthTokenRequest

func GeneratePersonalAuthTokenRequest(name string, permissions []string) (*github.AuthorizationRequest, []string)

GeneratePersonalAuthTokenRequest forges a request to create the personal access token on the remote

func GetReleaseByID

func GetReleaseByID(ctx context.Context, client *github.Client, owner string, repo string, id int) (*github.RepositoryRelease, error)

GetReleaseByID gets a release by its id on the the remote

func List

func List(ctx context.Context, client *github.Client) (map[string]*github.Authorization, error)

List retrieve existing authorizations generated by gh-api-cli.

func ListReleaseAssets

func ListReleaseAssets(ctx context.Context, client *github.Client, owner string, repo string, release github.RepositoryRelease) ([]*github.ReleaseAsset, error)

ListReleaseAssets retrieves the first 200 release assets on the remote

func ListReleases

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

ListReleases fetches first 200 releases on the remote.

func ReleaseExists

func ReleaseExists(ctx context.Context, client *github.Client, owner string, repo string, version string, draft bool) (bool, error)

ReleaseExists tells if a release exits by its version on the remote

func ReleaseID

func ReleaseID(ctx context.Context, client *github.Client, owner string, repo string, version string) (int, error)

ReleaseID get ID of a release givne its version.

func UploadMultipleReleaseAssets

func UploadMultipleReleaseAssets(ctx context.Context, client *github.Client, owner string, repo string, releaseID int, files []string, info chan<- error)

UploadMultipleReleaseAssets uploads multiple assets to the remote release identified by its release ID.

func UploadReleaseAsset

func UploadReleaseAsset(ctx context.Context, client *github.Client, owner string, repo string, releaseID int, file string) error

UploadReleaseAsset uploads one asset to the remote release identified by its release ID.

func UploadReleaseAssets

func UploadReleaseAssets(ctx context.Context, client *github.Client, owner string, repo string, version string, files []string) []error

UploadReleaseAssets uploads multiple assets to the remote release identified by its version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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