installer

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 16 Imported by: ? modules, 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

Index

Constants

This section is empty.

Variables

View Source
var ErrBlockingApps = errors.New("blocking applications running")

ErrBlockingApps is returned by Install when a listed blocking application is running: the action was skipped and recorded in the report's DeferredItems (spec R6). It is errors.Is-able so the dependency walk can cascade the deferral instead of treating it as a failure.

View Source
var ErrCanceled = errors.New("canceled by user")

ErrCanceled is returned by Install when the user withdrew the item before the run started its install or uninstall command. Nothing is recorded in the report: the item was neither attempted nor failed.

Functions

This section is empty.

Types

type Cancels

type Cancels struct {
	// contains filtered or unexported fields
}

Cancels lets the service withdraw items from managed runs that are already under way. An item can be withdrawn until a run starts its install or uninstall command; withdrawing it then aborts its download if one is in flight. A running installer command is never interrupted. The service keeps one Cancels for its lifetime and hands it to every run. A nil *Cancels withdraws nothing, which is what the command-line run uses.

func NewCancels

func NewCancels() *Cancels

func (*Cancels) Cancel

func (c *Cancels) Cancel(name string) bool

Cancel withdraws name. It returns false, and changes nothing, once a run has started name's install or uninstall command.

func (*Cancels) EndRun

func (c *Cancels) EndRun()

EndRun forgets the finished run: its withdrawals and the items it acted on. A cancel also reverted the self-serve selection, so later runs do not pick the item up again, and an item an admin manifest also requires must not stay skipped. An operation whose run has finished is refused as finished instead.

func (*Cancels) Reset

func (c *Cancels) Reset(name string)

Reset drops a withdrawal of name; the service calls it when a new install or removal of name is requested, which can happen while a run is under way. It leaves alone whether that run is acting on name: a cancel must still refuse while an installer for name runs.

type ProgressFn

type ProgressFn func(item catalog.Item, state string, percent int, message string)

ProgressFn receives coarse per-item progress events. States emitted per item: `downloading`, `installing`/`removing`, `done`/`failed`. The service attaches an operation-scoped callback for self-service mutations.

type Runner

type Runner struct {
	Report      *report.Report
	Checker     *status.Checker
	Emit        ProgressFn // nil = no progress events
	Cancels     *Cancels   // nil = nothing can be withdrawn
	URLPackages string
	CachePath   string
	CheckOnly   bool
}

Runner is the run-scoped install context (K7: no cross-run package globals)

func (*Runner) Install

func (r *Runner) Install(item catalog.Item, installerType string) (string, error)

Install determines if action needs to be taken on a item and then calls the appropriate function to install or uninstall

Jump to

Keyboard shortcuts

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