forgejo

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package forgejo is a thin 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.

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

func NewClient(instanceURL, token, username string) *Client

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").

func (*Client) ListRepos

func (c *Client) ListRepos(ctx context.Context) ([]dashboard.RepoRef, error)

ListRepos returns the repositories this Client is configured to track — see NewClient for the two modes.

Jump to

Keyboard shortcuts

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