target

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package target resolves the set of aptly servers (and default repos / distributions) an invocation acts on, and runs work across servers with an aggregated result.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateError

func AggregateError(results []Result) error

AggregateError returns a combined error if any result failed, else nil.

Types

type Result

type Result struct {
	URL string
	Err error
}

Result captures the outcome of running work against one server.

func (Result) OK

func (r Result) OK() bool

OK reports whether the work succeeded.

type Server

type Server struct {
	URL    string
	Client *client.Client
}

Server pairs a resolved API URL with its client.

type Set

type Set struct {
	Servers       []Server
	Repos         []string
	Distributions []string
}

Set is the resolved fan-out scope for a command.

func Resolve

func Resolve(s *config.Settings, prompt client.Prompter) (*Set, error)

Resolve builds one client per configured API URL. prompt is used for 401-triggered authentication when no password was supplied.

func (*Set) ForEachServer

func (set *Set) ForEachServer(fn func(Server) error) []Result

ForEachServer runs fn against every server sequentially, collecting results. A failure on one server does not stop the others.

Jump to

Keyboard shortcuts

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