Documentation
¶
Overview ¶
Package gitea implements backend.Backend against the Gitea REST API (api/v1), which is close enough to GitHub's release API in shape (tag_name/name/body/draft) that the adapter logic mirrors internal/backend/github — the differences are the base path, the Authorization header scheme, and list pagination's query param names.
Index ¶
- type Client
- func (c *Client) CommitURL(sha string) string
- func (c *Client) CompareURL(from, to string) string
- func (c *Client) Publish(ctx context.Context, tag string) error
- func (c *Client) ResolveAuthor(_ context.Context, _ string) (backend.AuthorReference, bool, error)
- func (c *Client) ResolvePR(_ context.Context, _ string) (commit.PRReference, bool, error)
- func (c *Client) UpsertDraft(ctx context.Context, req backend.UpsertDraftRequest) 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 implements backend.Backend against a Gitea instance's REST API.
func New ¶
New returns a Client for owner/repo against the Gitea instance at baseURL (e.g. "https://gitea.example.com" — no trailing slash or "/api/v1" suffix needed, New adds it). Unlike GitHub's fixed api.github.com, Gitea is self-hosted, so baseURL is always required.
func (*Client) CommitURL ¶
CommitURL implements backend.Backend, using baseURL as the instance's web root (same host as the API, just without the "/api/v1" prefix).
func (*Client) CompareURL ¶ added in v0.2.0
CompareURL implements backend.Backend.
func (*Client) Publish ¶
Publish implements backend.Backend: flips the draft release matching tag to published. As with GitHub, the underlying git tag doesn't exist until this point; leaving target_commitish unset in the PATCH means Gitea keeps whatever was set at draft-creation time (also left unset, which Gitea resolves to the default branch), so publish always tags the default branch's current state rather than a stale commitish.
func (*Client) ResolveAuthor ¶
ResolveAuthor implements backend.Backend. Unlike GitHub's "get a commit" endpoint, no Gitea endpoint returning a commit's linked account has been verified against a live instance — per ADR-0001, this always reports "not supported" rather than attempting an unverified lookup.
func (*Client) ResolvePR ¶
ResolvePR implements backend.Backend. Gitea has no commit→PR lookup endpoint (unlike GitHub's commits/{sha}/pulls) — per ADR-0001, only ticket 05's text extraction (the "Reviewed-on:" trailer) applies here, so this always reports "not supported" rather than attempting a lookup that doesn't exist.
func (*Client) UpsertDraft ¶
UpsertDraft implements backend.Backend.