github

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(remotePath string) (*model.Metadata, error)

Parse parses remote path to get its metadata according to github convention

Types

type Asset

type Asset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
}

Asset defines github release asset

type Client

type Client struct{}

Client defines github client

func (*Client) DownloadAsset

func (c *Client) DownloadAsset(ctx context.Context, apiPath string) ([]byte, error)

DownloadAsset downloads github asset based on the asset api path. Currently, it can only download asset from publicly available repository. `apiPath` follows prefix [https://api.github.com/repos], which can be generated by this provider parser. For more information, check [this](https://docs.github.com/en/rest/releases/releases) documentation.

func (*Client) DownloadRelease

func (*Client) DownloadRelease(ctx context.Context, apiPath string) (*model.RepositoryRelease, error)

DownloadRelease downloads a release based on the API path

type Release

type Release struct {
	TagName    string   `json:"tag_name"`
	Draft      bool     `json:"draft"`
	Prerelease bool     `json:"prerelease"`
	Assets     []*Asset `json:"assets"`
}

Release defines github repository release

Jump to

Keyboard shortcuts

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