index

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package index maintains aqua-registry-g2's catalogue of the packages it holds.

Everything else about a package lives on its own branch, which is what keeps one package's history out of another's. Searching can't work that way: it reads a name and a description for every package before knowing which one is wanted. So the catalogue is a single file on the default branch, and it has to be kept in step with the branches by hand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller adds packages to the catalogue.

func New

func New(registry Registry, baseBranch string) *Controller

New creates a Controller.

func (*Controller) AddPackage

func (c *Controller) AddPackage(ctx context.Context, logger *slog.Logger, pkgName string, cfg *aquag2.Config) error

AddPackage puts one package into the catalogue.

This is the path a run takes as it takes a package over: it has just built the definition, so nothing is read back and no branches are listed. The definition is passed in because the branch doesn't hold it yet — it is in the pull request that brings the package, which is the moment the catalogue can first describe it.

func (*Controller) Sync

func (c *Controller) Sync(ctx context.Context, logger *slog.Logger) error

Sync puts every package that has a branch into the catalogue.

This is what catches what the other path missed. A package whose run failed after committing its definition, or whose pull request was never merged, is left out of the catalogue and nothing else would ever notice.

type Registry

type Registry interface {
	Index(ctx context.Context, ref string) (*aquag2.Index, error)
	PackageBranches(ctx context.Context) ([]string, error)
	Config(ctx context.Context, pkgName string) (*aquag2.Config, error)
	BranchSHA(ctx context.Context, branch string) (string, error)
	Commit(ctx context.Context, branch, parent, message string, files []*g2.File) error
	IndexPullRequest(ctx context.Context) (*gogithub.PullRequest, error)
	CreateIndexPullRequest(ctx context.Context, base, title, body string) (*gogithub.PullRequest, error)
}

Registry is what the catalogue is built from and written to.

Jump to

Keyboard shortcuts

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