apt

package
v0.6.4-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service for apt package management operations. It manages subscribers and publishes events to all of them.

func New

func New() *Service

func (*Service) ListUpgradablePackages

func (s *Service) ListUpgradablePackages(ctx context.Context, matcher func(update.UpgradablePackage) bool) ([]update.UpgradablePackage, error)

ListUpgradablePackages lists all upgradable packages using the `apt list --upgradable` command. It runs the `apt-get update` command before listing the packages to ensure the package list is up to date. It filters the packages using the provided matcher function. It returns a slice of UpgradablePackage or an error if the command fails.

func (*Service) UpgradePackages

func (s *Service) UpgradePackages(ctx context.Context, names []string) (<-chan update.Event, error)

UpgradePackages upgrades the specified packages using the `apt-get upgrade` command. It publishes events to subscribers during the upgrade process. It returns an error if the upgrade is already in progress or if the upgrade command fails.

Jump to

Keyboard shortcuts

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