Documentation ¶
Overview ¶
Package core Module file
This file contains everything directly related to handling a Module model.
Package core Systems file ¶
This file contains structs relative to the operating system that we are setting up. As well as functions to validate and set the target system.
Index ¶
Constants ¶
const ModuleNotFoundError string = "no module found"
Variables ¶
var CurrentState = coreConfig{ Config: Config{ModuleRegistry: ModuleRegistry}, System: System{ Name: runtime.GOOS, Runner: NormalRunner{}, }, }
CurrentState The state of the app.
var ModuleRegistry = &Registry{ make(map[string]Module), }
ModuleRegistry This is the ModuleRegistry for the running application.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ModuleRegistry *Registry
}
Config The entire Config YAML.
func (*Config) ReadConfigFromFile ¶
ReadConfigFromFile Attempts to read the file at filePath and set the settings for each module using the file and yaml.Unmarshal.
func (*Config) WriteConfigToFile ¶
WriteConfigToFile will generate a YAML file using the defaults we outline.
type Module ¶
type Module interface { ParseSettings(map[string]interface{}) error Config() ModuleConfig Setup() error TearDown() error Update() error }
Module Any struct that implements these methods can be considered a module.
type ModuleConfig ¶
ModuleConfig General items we may need to track for each module.
type NormalRunner ¶ added in v0.1.1
type NormalRunner struct{}
NormalRunner cmdRunner implementation that doesn't use sudo.
type Registry ¶
Registry This registry contains Modules. The Modules take a string and map it to a Module.
func NewModuleRegistry ¶
func NewModuleRegistry() *Registry
func (*Registry) RunTeardown ¶
RunTeardown Runs the Setup method on each Registry.Modules