forge

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 10 Imported by: 0

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

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 New

func New(httpClient *http.Client, host string) *Client

New returns a client reading the instance at the given host.

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) Host

func (c *Client) Host() string

Host is the instance the client reads.

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.

Jump to

Keyboard shortcuts

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