identify

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 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, ids *g2.Identities, defs map[string]string) *Controller

New creates a Controller.

func (*Controller) Identify

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

Identify carries every branch still named after a package over to one named after an id.

The branches are the list of what to do, because a branch named after a package is what says which package it holds -- that name is the only place it is written down. A branch holding no definition isn't one of them: it holds nothing but the template every new branch starts with, and a run taking the package over again makes it afresh.

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