forge

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package forge implements the software forge capability.

Package forge implements the software forge capability (Gitea, Gogs, Forgejo).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Descriptor

func Descriptor(backend, app string, svc Service) hub.Descriptor

Descriptor returns the hub capability descriptor for forge.

func RegisterService

func RegisterService(backend, app string, svc Service) error

RegisterService registers the forge capability with the hub registry. It returns nil and logs a warning when svc is nil (provider not configured).

Types

type ListIssuesQuery

type ListIssuesQuery struct {
	Page  ability.PageRequest
	State string // open, closed, all
}

ListIssuesQuery wraps pagination and filtering for listing issues.

type Service

type Service interface {
	// GetUser returns the authenticated user's profile.
	GetUser(ctx context.Context) (*ability.ForgeUser, error)
	// GetRepo returns a single repository by owner and name.
	GetRepo(ctx context.Context, owner, repo string) (*ability.ForgeRepo, error)
	// ListIssues returns a paginated list of issues for the given owner.
	ListIssues(ctx context.Context, owner string, q *ListIssuesQuery) (*ability.ListResult[ability.ForgeIssue], error)
	// GetIssue returns a single issue by owner, repo name, and issue index.
	GetIssue(ctx context.Context, owner, repo string, index int64) (*ability.ForgeIssue, error)
	// GetCommitDiff returns the diff for a specific commit.
	GetCommitDiff(ctx context.Context, owner, repo, commitID string) (*ability.ForgeCommitDiff, error)
	// GetFileContent returns file content at a specific commit with line range.
	GetFileContent(ctx context.Context, owner, repo, commitID, filePath string, lineStart, lineCount int) ([]byte, error)
}

Service defines the forge capability contract. Provider adapters implement this interface to bridge forge providers and invokers.

Directories

Path Synopsis
Package gitea implements the Gitea adapter for the forge capability.
Package gitea implements the Gitea adapter for the forge capability.

Jump to

Keyboard shortcuts

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