initcmd

package
v0.15.29 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 11 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 initcmd implements the logic behind the 'ar2 init' command.

init builds ar2's initial state: it reads the package list from aqua-registry (v1), looks up each package's star count, and pushes the result to the container registry. The star count decides the order in which packages are processed later, because a full backfill can't be done in one run.

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 runs 'ar2 init'.

func New

func New(gh *gogithub.Client, graphql *github.Client) *Controller

New creates a Controller. Both clients must carry the GitHub access token.

func (*Controller) Init

func (c *Controller) Init(ctx context.Context, logger *slog.Logger, input *Input) error

Init builds the initial state and pushes it to the container registry.

type Input

type Input struct {
	// RegistryRef is the aqua-registry ref the package list is read from.
	RegistryRef string
	// TokenSource authenticates the push to the container registry.
	TokenSource oauth2.TokenSource
	// Registry describes where the state artifact is pushed.
	Registry *state.Registry
	// Output writes the state to this path instead of pushing it. For debugging.
	Output string
}

Input holds the parameters of 'ar2 init'.

Jump to

Keyboard shortcuts

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