rename

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 branch first, then the catalogue. A branch under the new name that the catalogue doesn't list yet is what the reconciliation exists to find; a catalogue naming a branch that isn't there is a registry that answers nothing for a package it says it has.

type Registry

type Registry interface {
	RenamePackage(ctx context.Context, from, to string) (bool, 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