Help us shape the future of Go! Take the 2026 Go Developer Survey

initcmd

package
v0.15.16 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 11 Imported by: 0

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