Documentation ¶
Index ¶
- Constants
- type PupManager
- func (t PupManager) AdoptPup(m dogeboxd.PupManifest, source dogeboxd.ManifestSource) (string, error)
- func (t PupManager) CalculateDeps(pupID string) ([]dogeboxd.PupDependencyReport, error)
- func (t PupManager) CanPupStart(pupId string) (bool, error)
- func (t PupManager) FastPollPup(id string)
- func (t PupManager) FindPupByIP(ip string) (dogeboxd.PupState, dogeboxd.PupStats, error)
- func (t PupManager) GetAllFromSource(source dogeboxd.ManifestSourceConfiguration) []*dogeboxd.PupState
- func (t PupManager) GetAssetsMap() map[string]dogeboxd.PupAsset
- func (t PupManager) GetMetrics(pupId string) map[string]interface{}
- func (t PupManager) GetPup(id string) (dogeboxd.PupState, dogeboxd.PupStats, error)
- func (t PupManager) GetPupFromSource(name string, source dogeboxd.ManifestSourceConfiguration) *dogeboxd.PupState
- func (t PupManager) GetPupHealthState(pup *dogeboxd.PupState) dogeboxd.PupHealthStateReport
- func (t PupManager) GetPupSpecificEnvironmentVariablesForContainer(pupID string) map[string]string
- func (t PupManager) GetStateMap() map[string]dogeboxd.PupState
- func (t PupManager) GetStatsChannel() chan []dogeboxd.PupStats
- func (t PupManager) GetStatsMap() map[string]dogeboxd.PupStats
- func (t PupManager) GetUpdateChannel() chan dogeboxd.Pupdate
- func (t PupManager) PurgePup(pupId string) error
- func (t PupManager) Run(started, stopped chan bool, stop chan context.Context) error
- func (t *PupManager) SetSourceManager(sourceManager dogeboxd.SourceManager)
- func (t PupManager) UpdateMetrics(u dogeboxd.UpdateMetrics)
- func (t PupManager) UpdatePup(id string, updates ...func(*dogeboxd.PupState, *[]dogeboxd.Pupdate)) (dogeboxd.PupState, error)
Constants ¶
const (
MIN_WEBUI_PORT int = 10000 // start assigning ports from..
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PupManager ¶
type PupManager struct {
// contains filtered or unexported fields
}
func NewPupManager ¶
func NewPupManager(dataDir string, tmpDir string, monitor dogeboxd.SystemMonitor) (*PupManager, error)
func (PupManager) AdoptPup ¶
func (t PupManager) AdoptPup(m dogeboxd.PupManifest, source dogeboxd.ManifestSource) (string, error)
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)
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) 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 (PupManager) GetAllFromSource ¶
func (t PupManager) GetAllFromSource(source dogeboxd.ManifestSourceConfiguration) []*dogeboxd.PupState
func (PupManager) GetAssetsMap ¶
func (t PupManager) GetAssetsMap() map[string]dogeboxd.PupAsset
func (PupManager) GetMetrics ¶
func (t PupManager) GetMetrics(pupId string) map[string]interface{}
get all the metrics currently stored for a pup
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) 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) 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) 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