github

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 5 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 {
	// contains filtered or unexported fields
}

Client represents a wrapper of GitHub API client

func NewClient

func NewClient(accessToken string) *Client

NewClient creates new Client object

func (*Client) DescribeRelease

func (c *Client) DescribeRelease(ctx context.Context, owner, repo, tag string) (*Tag, error)

DescribeRelease returns detail of the given release

func (*Client) ListTagsAndReleases

func (c *Client) ListTagsAndReleases(ctx context.Context, owner, repo string) ([]*Tag, error)

ListTagsAndReleases retrieves all tags and releases of the given repository

type ClientInterface

type ClientInterface interface {
	DescribeRelease(ctx context.Context, owner, repo, tag string) (*Tag, error)
	ListTagsAndReleases(ctx context.Context, owner, repo string) ([]*Tag, error)
}

type Release

type Release struct {
	ArtifactURLs []string
	Author       string
	Body         string
	Commit       string
	CreatedAt    time.Time
	Name         string
	PublishedAt  time.Time
	URL          string
}

type RepositoriesServiceInterface

type RepositoriesServiceInterface interface {
	GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*github.RepositoryRelease, *github.Response, error)
	GetCommit(ctx context.Context, owner, repo, sha string) (*github.RepositoryCommit, *github.Response, error)
	ListReleases(ctx context.Context, owner, repo string, opt *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error)
	ListTags(ctx context.Context, owner string, repo string, opt *github.ListOptions) ([]*github.RepositoryTag, *github.Response, error)
}

type Tag

type Tag struct {
	Name    string
	Release *Release
}

Jump to

Keyboard shortcuts

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