Documentation
¶
Index ¶
- func EnsureSkel(path string)
- func RESTAPI(config ServerConfig, dbx Dogeboxd, ws WSRelay) conductor.Service
- func Server(config ServerConfig) server
- func WriteContainerConfig()
- type Action
- type Change
- type CommandManifest
- type ConfigFields
- type ConfigFile
- type Dogeboxd
- type InstallPup
- type InternalState
- type Job
- type LoadLocalPup
- type ManifestSource
- type PupManifest
- type PupStatus
- type RestartPup
- type ServerConfig
- type StartPup
- type StopPup
- type SystemJobber
- type UninstallPup
- type UpdatePupConfig
- type WSCONN
- type WSRelay
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureSkel ¶
func EnsureSkel(path string)
func Server ¶
func Server(config ServerConfig) server
func WriteContainerConfig ¶
func WriteContainerConfig()
Types ¶
type Action ¶
type Action any
Actions are passed to the dogeboxd service via its * AddAction method, and represent tasks that need to * be done such as installing a package, starting or * stopping a service etc.
type CommandManifest ¶
type CommandManifest struct { Path string `json:"path"` Args string `json:"args"` CWD string `json:"cwd"` ENV map[string]string `json:"env"` Config ConfigFields `json:"config"` ConfigFiles []ConfigFile `json:"configFiles"` }
Represents the command to run inside this PUP * Container.
type ConfigFields ¶
type ConfigFields struct { Sections []struct { Name string `json:"name"` Label string `json:"label"` Fields []map[string]interface{} `json:"fields"` } `json:"sections"` }
Represents fields that are user settable, which provide the values * for templates (Args, ENV, ConfigFiles), we only care about Name
type ConfigFile ¶
Represents a Config file that needs to be written * inside the DRE filesystem at Path, Template is a * text/template string which will be filled with * values provided by CommandManifest.Config.
type Dogeboxd ¶
type Dogeboxd struct { Manifests map[string]ManifestSource Pups map[string]PupStatus Internal *InternalState Changes chan Change // contains filtered or unexported fields }
func NewDogeboxd ¶
func (Dogeboxd) AddAction ¶
Add an Action to the Action queue, returns a unique ID which can be used to match the outcome in the Event queue
func (Dogeboxd) GetManifests ¶
func (t Dogeboxd) GetManifests() map[string]ManifestSource
func (Dogeboxd) GetPupStats ¶
type InstallPup ¶
type InstallPup struct {
PupID string
}
type InternalState ¶
InternalState is stored in dogeboxd.gob and contains various details about what's installed, what condition we're in overall etc.
type LoadLocalPup ¶
type LoadLocalPup struct {
Path string
}
Instruct dogeboxd to load/reload a local (dev) PUP presumably because there have been changes to the manifest.
type ManifestSource ¶
type ManifestSource struct { ID string `json:"id"` Label string `json:"label"` URL string `json:"url"` LastUpdated time.Time `json:"lastUpdated"` Available []PupManifest `json:"available"` }
A ManifestSource is a .. well, it's a source of manifests, derp.
func (ManifestSource) UpdateAvailable ¶
func (t ManifestSource) UpdateAvailable(sourceID string, l []PupManifest)
Append or replace available pups
type PupManifest ¶
type PupManifest struct { ID string `json:"id"` Package string `json:"package"` // ie: dogecoin-core Hash string `json:"hash"` // package checksum Command CommandManifest `json:"command"` // contains filtered or unexported fields }
PupManifest represents a Nix installed process * running inside the Dogebox Runtime Environment. * These are defined in pup.json files.
func FindLocalPups ¶
func FindLocalPups(path string) (pups []PupManifest)
func (*PupManifest) Hydrate ¶
func (t *PupManifest) Hydrate(sourceID string)
This is called when a Pup is loaded from storage, JSON/GOB etc.
type PupStatus ¶
type PupStatus struct { ID string `json:"id"` Stats map[string][]float32 `json:"stats"` Config map[string]string `json:"config"` Installation string `json:"installation"` Status string `json:"status"` // contains filtered or unexported fields }
PupStatus is persisted to disk
func NewPUPStatus ¶
func NewPUPStatus(pupDir string, m PupManifest) PupStatus
type RestartPup ¶
type RestartPup struct {
PupID string
}
type SystemJobber ¶
type UninstallPup ¶
type UninstallPup struct {
PupID string
}
type UpdatePupConfig ¶
type WSRelay ¶
type WSRelay struct {
// contains filtered or unexported fields
}
func NewWSRelay ¶
func (WSRelay) GetWSHandler ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher Service monitors important files and updates State as needed