pup

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_WEBUI_PORT int = 10000 // start assigning ports from..
)

Variables

This section is empty.

Functions

func ParseGitHubOwnerRepo

func ParseGitHubOwnerRepo(remote string) (string, bool)

func ParseVersionLenient

func ParseVersionLenient(versionStr string) (*semver.Version, error)

ParseVersionLenient attempts to parse a version string, handling non-semver formats

Types

type PupManager

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

func NewPupManager

func NewPupManager(config dogeboxd.ServerConfig, monitor dogeboxd.SystemMonitor) (*PupManager, error)

func (PupManager) AdoptPup

This method is used to add a new pup from a manifest

* and init it's values to then be configured by the user * and dogebox system. See PurgePup() for the opposite. * * Once a pup has been initialised it is considered 'managed' * by the PupManager until purged. * * Returns PupID, error

func (PupManager) CalculateDeps

func (t PupManager) CalculateDeps(pupID string) ([]dogeboxd.PupDependencyReport, error)

CalculateDeps calculates the dependencies for a given pup

func (PupManager) CanPupStart

func (t PupManager) CanPupStart(pupId string) (bool, error)

This function only checks pup-specific conditions, it does not check the rest of the system is ready for a pup to start.

func (*PupManager) CheckAllPupUpdates

func (t *PupManager) CheckAllPupUpdates() map[string]dogeboxd.PupUpdateInfo

func (*PupManager) CheckForUpdates

func (t *PupManager) CheckForUpdates(pupID string) (dogeboxd.PupUpdateInfo, error)

func (*PupManager) CleanOldSnapshots

func (t *PupManager) CleanOldSnapshots(maxAge time.Duration) (int, error)

CleanOldSnapshots removes snapshots older than the specified duration

func (*PupManager) ClearCacheEntry

func (t *PupManager) ClearCacheEntry(pupID string)

func (*PupManager) CreateSnapshot

func (t *PupManager) CreateSnapshot(pupState dogeboxd.PupState) error

CreateSnapshot creates a snapshot of the current pup state before an upgrade

func (*PupManager) DeleteSnapshot

func (t *PupManager) DeleteSnapshot(pupID string) error

DeleteSnapshot removes a pup's version snapshot

func (*PupManager) DetectInterfaceChanges

func (t *PupManager) DetectInterfaceChanges(oldManifest, newManifest dogeboxd.PupManifest) []dogeboxd.PupInterfaceVersion

func (PupManager) FastPollPup

func (t PupManager) FastPollPup(id string)

called when we expect a pup to be changing state, this will rapidly poll for a few seconds and update the frontend with status.

func (PupManager) FindPupByIP

func (t PupManager) FindPupByIP(ip string) (dogeboxd.PupState, dogeboxd.PupStats, error)

func (*PupManager) GetAllCachedUpdates

func (t *PupManager) GetAllCachedUpdates() map[string]dogeboxd.PupUpdateInfo

func (PupManager) GetAllFromSource

func (t PupManager) GetAllFromSource(source dogeboxd.ManifestSourceConfiguration) []*dogeboxd.PupState

func (PupManager) GetAssetsMap

func (t PupManager) GetAssetsMap() map[string]dogeboxd.PupAsset

func (*PupManager) GetCachedUpdateInfo

func (t *PupManager) GetCachedUpdateInfo(pupID string) (dogeboxd.PupUpdateInfo, bool)

func (*PupManager) GetEventChannel

func (t *PupManager) GetEventChannel() <-chan dogeboxd.PupUpdatesCheckedEvent

func (PupManager) GetMetrics

func (t PupManager) GetMetrics(pupId string) map[string]interface{}

get all the metrics currently stored for a pup

func (PupManager) GetPup

func (PupManager) GetPupFromSource

func (t PupManager) GetPupFromSource(name string, source dogeboxd.ManifestSourceConfiguration) *dogeboxd.PupState

func (PupManager) GetPupHealthState

func (t PupManager) GetPupHealthState(pup *dogeboxd.PupState) dogeboxd.PupHealthStateReport

func (PupManager) GetPupSpecificEnvironmentVariablesForContainer

func (t PupManager) GetPupSpecificEnvironmentVariablesForContainer(pupID string) map[string]string

func (*PupManager) GetSnapshot

func (t *PupManager) GetSnapshot(pupID string) (*dogeboxd.PupVersionSnapshot, error)

GetSnapshot retrieves a pup's version snapshot if it exists

func (PupManager) GetStateMap

func (t PupManager) GetStateMap() map[string]dogeboxd.PupState

func (PupManager) GetStatsChannel

func (t PupManager) GetStatsChannel() chan []dogeboxd.PupStats

Hand out channels to stat subscribers

func (PupManager) GetStatsMap

func (t PupManager) GetStatsMap() map[string]dogeboxd.PupStats

func (PupManager) GetUpdateChannel

func (t PupManager) GetUpdateChannel() chan dogeboxd.Pupdate

Hand out channels to pupdate subscribers

func (*PupManager) HasSnapshot

func (t *PupManager) HasSnapshot(pupID string) bool

HasSnapshot checks if a snapshot exists for a pup

func (*PupManager) ListSnapshots

func (t *PupManager) ListSnapshots() ([]string, error)

ListSnapshots returns a list of all pup IDs that have snapshots

func (PupManager) PurgePup

func (t PupManager) PurgePup(pupId string) error

func (PupManager) Run

func (t PupManager) Run(started, stopped chan bool, stop chan context.Context) error
Run as a service so we can listen for stats from the

* SystemMonitor and update t.stats

func (*PupManager) SetSourceManager

func (t *PupManager) SetSourceManager(sourceManager dogeboxd.SourceManager)

func (*PupManager) StartPeriodicCheck

func (t *PupManager) StartPeriodicCheck(stop chan bool)

func (*PupManager) StartPup

func (t *PupManager) StartPup(pupID string, nixManager dogeboxd.NixManager, logger dogeboxd.SubLogger) error

StartPup starts a stopped pup by enabling it and triggering a rebuild. Note: This only updates the in-memory state and triggers a rebuild. For the container to actually start, the caller must ensure the nix pup file is written with Enabled=true before this is called. Prefer using enablePup in SystemUpdater which handles this correctly.

func (*PupManager) StopPup

func (t *PupManager) StopPup(pupID string, nixManager dogeboxd.NixManager, logger dogeboxd.SubLogger) error

StopPup stops a running pup by disabling it and triggering a rebuild This is safer than using _dbxroot pup stop directly as it ensures proper state management

func (PupManager) UpdateMetrics

func (t PupManager) UpdateMetrics(u dogeboxd.UpdateMetrics)

Updates the stats.Metrics field with data from the pup router

func (PupManager) UpdatePup

func (t PupManager) UpdatePup(id string, updates ...func(*dogeboxd.PupState, *[]dogeboxd.Pupdate)) (dogeboxd.PupState, error)
Updating a PupState follows the veradic update func pattern

* to accept multiple types of updates before saving to disk as * an atomic update. * * ie: err := manager.UpdatePup(id, SetPupInstallation(STATE_READY)) * see bottom of file for options

type UpdateChecker

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

UpdateChecker manages checking for pup updates

func NewUpdateChecker

func NewUpdateChecker(pm dogeboxd.PupManager, sm dogeboxd.SourceManager, dataDir string) *UpdateChecker

NewUpdateChecker creates a new update checker

func (*UpdateChecker) CheckAllPupUpdates

func (uc *UpdateChecker) CheckAllPupUpdates() map[string]dogeboxd.PupUpdateInfo

CheckAllPupUpdates checks for updates on all installed pups

func (*UpdateChecker) CheckForUpdates

func (uc *UpdateChecker) CheckForUpdates(pupID string) (dogeboxd.PupUpdateInfo, error)

CheckForUpdates checks if a specific pup has updates available

func (*UpdateChecker) ClearAllCache

func (uc *UpdateChecker) ClearAllCache()

ClearAllCache clears the entire update cache

func (*UpdateChecker) ClearCacheEntry

func (uc *UpdateChecker) ClearCacheEntry(pupID string)

ClearCacheEntry removes a specific pup from the cache

func (*UpdateChecker) DetectInterfaceChanges

func (uc *UpdateChecker) DetectInterfaceChanges(oldManifest, newManifest dogeboxd.PupManifest) []dogeboxd.PupInterfaceVersion

DetectInterfaceChanges compares interfaces between two manifests

func (*UpdateChecker) FindAffectedPups

func (uc *UpdateChecker) FindAffectedPups(interfaceName, oldVersion, newVersion string) []string

FindAffectedPups finds all pups that depend on a specific interface

func (*UpdateChecker) GetAllCachedUpdates

func (uc *UpdateChecker) GetAllCachedUpdates() map[string]dogeboxd.PupUpdateInfo

GetAllCachedUpdates returns all cached update information

func (*UpdateChecker) GetCachedUpdateInfo

func (uc *UpdateChecker) GetCachedUpdateInfo(pupID string) (dogeboxd.PupUpdateInfo, bool)

GetCachedUpdateInfo retrieves cached update info for a pup

func (*UpdateChecker) GetEventChannel

func (uc *UpdateChecker) GetEventChannel() <-chan dogeboxd.PupUpdatesCheckedEvent

GetEventChannel returns the channel for update check completion events

func (*UpdateChecker) StartPeriodicCheck

func (uc *UpdateChecker) StartPeriodicCheck(stop chan bool)

StartPeriodicCheck starts a background goroutine that checks for updates periodically

Jump to

Keyboard shortcuts

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