Documentation ¶
Index ¶
- type AssetOptions
- type Client
- func (c *Client) DownloadReleaseAsset(ctx context.Context, repo Repository, opt *AssetOptions) (*ReleaseAsset, rxgo.Observable, error)
- func (c *Client) GetRelease(ctx context.Context, repo Repository, tag string) (*RepositoryRelease, error)
- func (c *Client) ListReleases(ctx context.Context, repo Repository, opt *ListOptions) ([]*RepositoryRelease, error)
- type DownloadProgress
- type ListOptions
- type Progress
- type ReleaseAsset
- type Repository
- type RepositoryRelease
- type WriteCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetOptions ¶
type AssetOptions struct { Tag string Name string OS string OSAlias []string Arch string ArchAlias []string DestPath string Target string PickPattern string }
AssetOptions are parameters to download an asset file.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a github oauth2 client.
func (*Client) DownloadReleaseAsset ¶
func (c *Client) DownloadReleaseAsset(ctx context.Context, repo Repository, opt *AssetOptions, ) (*ReleaseAsset, rxgo.Observable, error)
DownloadReleaseAsset downloads a release asset file. first returns release asset info. second returns download progress info or error info use a stream. third returns initialize error info.
func (*Client) GetRelease ¶
func (c *Client) GetRelease(ctx context.Context, repo Repository, tag string, ) (*RepositoryRelease, error)
GetRelease gets release info.
func (*Client) ListReleases ¶
func (c *Client) ListReleases(ctx context.Context, repo Repository, opt *ListOptions, ) ([]*RepositoryRelease, error)
ListReleases get release list.
type DownloadProgress ¶
DownloadProgress is the current downloaded size of a file.
func (*DownloadProgress) Percentage ¶
func (p *DownloadProgress) Percentage() float64
Percentage is downloaded size over total size.
type ListOptions ¶
type ListOptions = ggithub.ListOptions
ListOptions specifies the optional parameters to various List methods that support pagination.
type ReleaseAsset ¶
type ReleaseAsset = ggithub.ReleaseAsset
ReleaseAsset represents a GitHub release asset in a repository.
type RepositoryRelease ¶
type RepositoryRelease = ggithub.RepositoryRelease
RepositoryRelease represents a GitHub release in a repository.
type WriteCounter ¶
WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.
func NewWriteCounter ¶
func NewWriteCounter(ch chan<- rxgo.Item, total int64) *WriteCounter
NewWriteCounter creates WriteCounter