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 (*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 ¶
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.