Documentation
¶
Overview ¶
Package github reads gh-* extensions from github.com anonymously. It has no way to send credentials: gt's accounts belong to Gitea instances, and a GitHub token must never be guessed from the environment.
Index ¶
- Constants
- Variables
- type Asset
- type Client
- func (c Client) Commit(ctx context.Context, owner, repo, ref string) (string, error)
- func (c Client) Download(ctx context.Context, asset Asset) (io.ReadCloser, error)
- func (c Client) File(ctx context.Context, owner, repo, ref, path string) ([]byte, bool, error)
- func (c Client) Release(ctx context.Context, owner, repo, tag string) (Release, error)
- func (c Client) Repository(ctx context.Context, owner, repo string) (Repository, error)
- type Release
- type Repository
Constants ¶
View Source
const Host = "https://github.com"
Host is the instance URL extensions from GitHub are recorded with.
Variables ¶
View Source
var ErrNotFound = errors.New("not found on GitHub")
ErrNotFound reports a repository, release or file GitHub does not have.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
Size int64 `json:"size"`
URL string `json:"browser_download_url"`
// Digest is "sha256:HEX" for assets GitHub recorded a digest for.
Digest string `json:"digest"`
}
Asset is a GitHub release asset.
type Client ¶
type Client struct {
// API is the REST API root, https://api.github.com unless a test replaces it.
API string
HTTP *http.Client
}
Client reads public repositories and releases from GitHub.
func (Client) Release ¶
Release returns the release tagged tag, or the latest release when tag is empty.
func (Client) Repository ¶
Repository returns the public repository owner/repo.
Click to show internal directories.
Click to hide internal directories.