Documentation
¶
Index ¶
- Variables
- type Event
- type EventType
- type Manager
- func (m *Manager) ListUpgradablePackages(ctx context.Context, matcher func(UpgradablePackage) bool) ([]UpgradablePackage, error)
- func (b *Manager) Subscribe() chan Event
- func (b *Manager) Unsubscribe(eventCh chan Event)
- func (m *Manager) UpgradePackages(ctx context.Context, pkgs []UpgradablePackage) error
- type PackageType
- type ServiceUpdater
- type UpgradablePackage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOperationAlreadyInProgress = errors.New("an operation is already in progress")
View Source
var MatchAllPackages = func(p UpgradablePackage) bool { return true }
View Source
var MatchArduinoPackage = func(p UpgradablePackage) bool { return strings.HasPrefix(p.Name, "arduino-") || (p.Name == "adbd" && strings.Contains(p.ToVersion, "arduino")) }
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(debUpdateService ServiceUpdater, arduinoPlatformUpdateService ServiceUpdater) *Manager
func (*Manager) ListUpgradablePackages ¶
func (m *Manager) ListUpgradablePackages(ctx context.Context, matcher func(UpgradablePackage) bool) ([]UpgradablePackage, error)
func (*Manager) Unsubscribe ¶
Unsubscribe removes the channel from the list of subscribers and closes it.
func (*Manager) UpgradePackages ¶
func (m *Manager) UpgradePackages(ctx context.Context, pkgs []UpgradablePackage) error
type PackageType ¶
type PackageType string
const ( Arduino PackageType = "arduino-platform" Debian PackageType = "debian-package" )
func (PackageType) AllowedStatuses ¶
func (s PackageType) AllowedStatuses() []PackageType
type ServiceUpdater ¶
type UpgradablePackage ¶
type UpgradablePackage struct {
Type PackageType `json:"type"` // e.g., "arduino", "deb"
Name string `json:"name"` // Package name without repository information
Architecture string `json:"-"`
FromVersion string `json:"from_version"`
ToVersion string `json:"to_version"`
}
Click to show internal directories.
Click to hide internal directories.