Documentation
¶
Overview ¶
Package forgejo is a client for the pieces of the Forgejo API (Gitea-compatible) forge-dashboard needs — the same shape as internal/github, against a different API under a self-hosted host. Driven by code.gitea.io/sdk/gitea, the official Gitea Go client and the one Forgejo's own API compatibility targets, rather than hand-rolled requests.
Index ¶
- type Client
- func (c *Client) ListOpenIssues(ctx context.Context, owner, name, repo string) ([]dashboard.Issue, error)
- func (c *Client) ListOpenPullRequests(ctx context.Context, owner, name, repo string) ([]dashboard.PullRequest, error)
- func (c *Client) ListRepos(ctx context.Context) ([]dashboard.RepoRef, 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 talks to a Forgejo instance's API, either as an authenticated user (a token) or anonymously against one user's public repositories on that instance (a username, no token at all).
func NewClient ¶
NewClient returns a Client against instanceURL (e.g. "https://git.higherlearning.eu"). With token set, it authenticates as that user and ListRepos returns every repo the token can push to, private included. With token empty and username set, every request goes out unauthenticated and ListRepos returns only username's public repos on that instance.
func (*Client) ListOpenIssues ¶
func (c *Client) ListOpenIssues(ctx context.Context, owner, name, repo string) ([]dashboard.Issue, error)
ListOpenIssues returns every open issue against repo. Forgejo's issues endpoint takes type=issues to exclude pull requests server-side, unlike GitHub's equivalent — no client-side filtering needed here.
func (*Client) ListOpenPullRequests ¶
func (c *Client) ListOpenPullRequests(ctx context.Context, owner, name, repo string) ([]dashboard.PullRequest, error)
ListOpenPullRequests returns every open pull request against repo, with CI already resolved. repo is owner-qualified ("alrayyes/tempus-fugit").