identify

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package identify puts every package the registry holds on a branch named after its id.

A branch was named after the package, which made the name the address of everything: the branch, the path aqua fetches a version from, the entry the catalogue lists. A package whose repository is renamed then has to be moved, and everything that already wrote the old name down is wrong. An id doesn't change when a name does, so the name becomes something the catalogue maps and nothing else depends on.

This runs once. It creates a branch per package and creates nothing else, so a second run sees the branches it made and has nothing to do.

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 identifies the packages of a registry.

func New

func New(registry Registry) *Controller

New creates a Controller.

func (*Controller) Identify

func (c *Controller) Identify(ctx context.Context, logger *slog.Logger, w io.Writer, path string, dryRun bool) error

Identify gives every package the catalogue lists a branch named after its id.

The catalogue is where the ids are, so it is also the list of what to do: a branch the catalogue doesn't name is a branch nothing can reach, and giving it a second name wouldn't change that.

A package that fails doesn't stop the rest. What is created is created, and a second run picks up where this one got to, so the useful thing to report is everything that went wrong rather than the first of it.

type Registry

type Registry interface {
	PlanIdentity(ctx context.Context, pkgName, id string) (*g2.Identification, error)
	Identify(ctx context.Context, pkgName string, plan *g2.Identification) error
}

Registry is the part of aqua-registry-g2 this reads and writes.

Jump to

Keyboard shortcuts

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