rename

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package rename moves a package to the name its repository has now.

A package's name is part of everything: the branch its generated versions live on, the path aqua fetches them from, the entry the catalogue lists it under. A repository that is renamed or transferred leaves all of it under a name nobody uses, and the versions are not something to generate again -- each one was downloaded, hashed and opened on six machines to get there.

So the branch is carried over and the old name becomes an alias, which is how a configuration still asking for it resolves.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalogue

type Catalogue interface {
	Rename(ctx context.Context, logger *slog.Logger, from, to string, cfg *aquag2.Config) error
}

Catalogue is the index a renamed package has to be listed in under its new name.

type Controller

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

Controller renames a package.

func New

func New(registry Registry, index Catalogue) *Controller

New creates a Controller.

func (*Controller) Rename

func (c *Controller) Rename(ctx context.Context, logger *slog.Logger, from, to string) error

Rename moves the package from one name to the other.

The definition first, then the catalogue. The branch stays where it is -- it is named after the package's id, which is what an id is for -- so what moves is what the definition says the branch holds, and after it the entry the catalogue lists the package under.

The catalogue can go ahead of the pull request that carries the definition, because both names point at the same branch: a reader resolves either one to it, and what it holds for each version doesn't change. What the pull request settles is which name the registry will answer for once a run asks again.

type Registry

type Registry interface {
	RenamePackage(ctx context.Context, logger *slog.Logger, from, to string) (*aquag2.Config, error)
	Config(ctx context.Context, pkgName string) (*aquag2.Config, error)
}

Registry is what a rename reads and writes.

Jump to

Keyboard shortcuts

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