Documentation
¶
Overview ¶
Package forgejo lists and mirrors repositories from a self-hosted Forgejo (or Gitea) instance over its REST API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
BaseURL *url.URL
Token string
HTTP *http.Client
// SkipMirrors excludes repositories Forgejo reports as mirrors of an
// external upstream from ListRepos. Off by default -- the zero value
// backs up exactly what earlier versions of this client did.
SkipMirrors bool
}
Client lists and mirrors repositories from a self-hosted Forgejo instance.
func (*Client) ListRepos ¶
ListRepos implements backup.Lister by paging through /api/v1/repos/search. The archived parameter on that endpoint is tri-state -- true, false, or omitted for all -- so StateAll is a single pass rather than two.
func (*Client) Remote ¶
Remote implements backup.Remoter by deriving the clone URL from the configured base URL rather than the API's own clone_url, which can report a host or port the caller can't actually reach -- inside a container it's the container's internal port, and behind a reverse proxy it can be wrong entirely. Forgejo's git-http-backend accepts the same "token <t>" Authorization header as its REST API, so no username is needed.