Documentation ¶
Overview ¶
A service represents a running daemonized process on an operating system States -
running: The service is running stopped: The service is stopped
Index ¶
- type File
- type Metadata
- type Package
- func (pkg *Package) Apply() *Result
- func (pkg *Package) GetDpkgPackage(name string) (string, string, error)
- func (pkg *Package) GetPackageStatus(name string) (string, string, error)
- func (pkg *Package) InstallPackage(name, version string) error
- func (pkg *Package) Meta() Metadata
- func (pkg *Package) RemovePackage(name string) error
- func (pkg *Package) State() *Result
- type Result
- type ResultMap
- type Service
- type State
- type StateMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type Metadata ¶
type Metadata struct { Name string // Unique name to associate with a state Type string // The type of state "package", "file", etc. State string // The desired state "installed", "rendered", etc. Requirements []string `json:"require"` // List of dependent states. }
func MetadataFromJSON ¶
func MetadataFromJSON(data json.RawMessage) (Metadata, error)
type Package ¶
type Package struct { Name string `json:"name"` Version string `json:"version"` Metadata Metadata `json:"metadata"` }
func (*Package) GetDpkgPackage ¶
Get the status of a package in DPKG
func (*Package) GetPackageStatus ¶
Check to see if a package is installed on the operating system
func (*Package) InstallPackage ¶
Install a package on the operating system
func (*Package) RemovePackage ¶
Remove a package from the operating system
type ResultMap ¶
func ResultMapFromError ¶
Return an array with a single result in state "Faulted", add the error message to the Result.
func ResultMapFromJson ¶
Create a ResultMap from JSON byte array
type Service ¶
type State ¶
type StateMap ¶
type StateMap struct {
States []State
}
func NewStateMap ¶
func NewStateMap() *StateMap
func StateMapFromJson ¶
Load a StateMap from a JSON byte array
func StateMapFromProcessedJson ¶
Load a StateMap from a JSON Byte array which has already been initialized (contains State Metadata)
func StateMapFromYaml ¶
Load a StateMap from a YAML byte array
func StateMapFromYamlPath ¶
Load a YAML file from a given path, if the file doesn't exist default to ~/.otter