Documentation
¶
Overview ¶
Package forge reads a Forgejo or Gitea instance the way aqua gr reads GitHub.
Both serve the API Gitea wrote and Forgejo inherited, at /api/v1, which GitHub's was the model for: a release says tag_name, published_at, draft and prerelease, and an asset says name and browser_download_url. What differs is how a page is asked for -- page and limit rather than per_page -- and that nothing says how many pages there are.
The answers are translated into go-github's types, because what reads them is aqua's generator, which is written against GitHub. Translating here is what lets the asset naming of a release on an instance be inferred by the same code that infers GitHub's.
Index ¶
- type Client
- func (c *Client) Get(ctx context.Context, owner, repo string) (*gogithub.Repository, *gogithub.Response, error)
- func (c *Client) GetLatestRelease(ctx context.Context, owner, repo string) (*gogithub.RepositoryRelease, *gogithub.Response, error)
- func (c *Client) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*gogithub.RepositoryRelease, *gogithub.Response, error)
- func (c *Client) Host() string
- func (c *Client) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *gogithub.ListOptions) ([]*gogithub.ReleaseAsset, *gogithub.Response, error)
- func (c *Client) ListReleases(ctx context.Context, owner, repo string, opts *gogithub.ListOptions) ([]*gogithub.RepositoryRelease, *gogithub.Response, error)
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 reads one instance. Which instance is not an argument because a package is on one of them: a client is made for the package's own.
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, owner, repo string) (*gogithub.Repository, *gogithub.Response, error)
Get returns what the generator reads about a repository, which is its description.
func (*Client) GetLatestRelease ¶
func (c *Client) GetLatestRelease(ctx context.Context, owner, repo string) (*gogithub.RepositoryRelease, *gogithub.Response, error)
GetLatestRelease returns the instance's newest release of the repository.
func (*Client) GetReleaseByTag ¶
func (c *Client) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*gogithub.RepositoryRelease, *gogithub.Response, error)
GetReleaseByTag returns the release the tag names.
func (*Client) ListReleaseAssets ¶
func (c *Client) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *gogithub.ListOptions) ([]*gogithub.ReleaseAsset, *gogithub.Response, error)
ListReleaseAssets returns one page of a release's assets.
func (*Client) ListReleases ¶
func (c *Client) ListReleases(ctx context.Context, owner, repo string, opts *gogithub.ListOptions) ([]*gogithub.RepositoryRelease, *gogithub.Response, error)
ListReleases returns one page of the repository's releases, newest first.