Documentation
¶
Overview ¶
Package versions writes the list of versions a package branch holds.
The list is the branch's own directories, so nothing here decides what it says. What it is for is reading: a reader asking which versions there are, when each was published or whether the file it has is still the one the registry serves would otherwise read the branch's tree and then a file per version.
It is written onto the package branch, beside the definition, because that is where the versions are. A copy on the default branch would be one file every package writes to.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Args ¶
type Args struct {
// Packages narrows the run to the packages named. Naming none does every package.
Packages []string
// Branches narrows the run to the branches named, which is what a branch's own
// workflow passes: it knows the branch it is running on and not the package.
Branches []string
// Limit bounds how many branches one run writes to, 0 for as many as there are.
Limit int
// DryRun says what would be written without writing it.
DryRun bool
}
Args holds what one run does.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller writes the lists.
func New ¶
func New(registry Registry, defs map[string]string) *Controller
New creates a Controller.
type Registry ¶
type Registry interface {
Branch(pkgName string) (string, bool)
BranchSHA(ctx context.Context, branch string) (string, error)
VersionsTree(ctx context.Context, ref string) (string, error)
VersionsOnRef(ctx context.Context, logger *slog.Logger, ref string) (map[string]struct{}, error)
File(ctx context.Context, ref, path string) (string, error)
Push(ctx context.Context, branch, parent, message string, files []*g2.File) error
}
Registry is the part of aqua-registry-g2 this reads and writes.