pkg

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DepTree

type DepTree struct {
	Ref
	Children []*DepTree
	Circular bool
	Err      error
}

func (*DepTree) Errors added in v0.3.0

func (n *DepTree) Errors() []error

func (*DepTree) HasErrors

func (n *DepTree) HasErrors() bool

func (*DepTree) Refs

func (n *DepTree) Refs() Refs

func (*DepTree) String

func (n *DepTree) String() string

type Manager

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

func New

func New(multi *catalog.Multi, store *storage.Store, platform fetcher.Platform, sandbox bool, reporter Reporter) *Manager

func (*Manager) ApplyPlan

func (m *Manager) ApplyPlan(ctx context.Context, plan Refs) (Refs, error)

func (*Manager) Cleanup

func (m *Manager) Cleanup(maxAge time.Duration, keep Refs) (Refs, error)

func (*Manager) DepTree

func (m *Manager) DepTree(ctx context.Context, ref Ref) *DepTree

func (*Manager) Install

func (m *Manager) Install(ctx context.Context, refs Refs) (Refs, error)

func (*Manager) Plan

func (m *Manager) Plan(ctx context.Context, refs Refs) (Refs, error)

func (*Manager) Reinstall

func (m *Manager) Reinstall(ctx context.Context, refs Refs, withDeps bool) (Refs, error)

func (*Manager) TouchLastUsed

func (m *Manager) TouchLastUsed(refs Refs)

TouchLastUsed bumps the last-used timestamp for every ref. Errors are swallowed: the timestamp is best-effort bookkeeping, and a missing install dir is silently no-op'd inside storage.TouchLastUsed.

func (*Manager) Uninstall

func (m *Manager) Uninstall(ctx context.Context, refs Refs, withDeps bool) (Refs, error)

type ProgressTracker

type ProgressTracker interface {
	Start()
	Stop()
	Update(name string, downloaded, total int64)
	Done(name string)
	Fail(name string, err error)
}

type Ref

type Ref struct {
	Name    string
	Version string
}

func Parse

func Parse(raw string) Ref

func ParseStrict

func ParseStrict(raw string) (Ref, error)

func (Ref) String

func (r Ref) String() string

type Refs

type Refs []Ref

func Merge

func Merge(refs ...Refs) Refs

func ParseAll

func ParseAll(raws []string) Refs

func ParseAllStrict

func ParseAllStrict(raws []string) (Refs, error)

func (Refs) ByName

func (r Refs) ByName() map[string]Ref

func (Refs) Names

func (r Refs) Names() map[string]bool

func (Refs) Strings

func (r Refs) Strings() []string

func (Refs) Versions

func (r Refs) Versions() map[string]string

type Reporter

type Reporter interface {
	report.Basic
	NewProgressTracker(jobs []string) ProgressTracker
	Phase(format string, args ...any) report.Phase
}

Reporter is the narrow output surface the pkg layer renders through; the App supplies the real implementation and tests inject Discard. Every operation — instant or durational — is reported through Phase: begin it with Phase, then call Done or Fail on the returned report.Phase when the work finishes.

var Discard Reporter = discardReporter{}

Jump to

Keyboard shortcuts

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