Documentation
¶
Overview ¶
Package installer is the installer for the genesis package. It handles file backup, manages history, reports on progress, and invents higher-order tasks (such as if-then tasks)>
Package installer is the installer for the genesis package. It handles file backup, manages history, reports on progress, and invents higher-order tasks (such as if-then tasks)>
Index ¶
- Variables
- func EmptyDoTags() []string
- func GetHistory(dir string) []string
- func PrintHeader(tag, desc string)
- func PrintSectionFooter(name string)
- func PrintSectionHeader(name string)
- func ReportDone(msg string, err error)
- func ReportFail(msg string, err error)
- func ReportPass(msg string, err error)
- func ReportSummary()
- func ReportUnknown(msg string, err error)
- func Rerun(dir string) (string, error)
- func RestoreDoTags(doTags []string)
- func SaveHistory(dir string, cmd []string) error
- func SkipID(id string) string
- type Custom
- type FlagMerger
- type IfThen
- type Installer
- func (inst *Installer) Add(task genesis.Doer)
- func (inst *Installer) AddTask(module genesis.Module)
- func (inst *Installer) Build()
- func (inst *Installer) CleanUp()
- func (inst *Installer) Done()
- func (inst *Installer) Files() []string
- func (inst *Installer) Init() *Installer
- func (inst *Installer) ParseFlags()
- type Section
- func (section *Section) Add(doer genesis.Doer)
- func (section *Section) AddTask(module genesis.Module)
- func (section Section) Do() (bool, error)
- func (section Section) Files() []string
- func (section Section) ID() string
- func (section Section) Status() (genesis.Status, error)
- func (section Section) Undo() (bool, error)
- type Switch
- type Task
Constants ¶
This section is empty.
Variables ¶
var DoTags, SkipTags []string
DoTags and SkipTags are global variables, because we need to modify them as we descend into sections and unmodify them on the way back up.
var StatusCount struct { Pass, Fail, Unknown, Done int }
Functions ¶
func EmptyDoTags ¶
func EmptyDoTags() []string
func GetHistory ¶ added in v0.2.0
func PrintHeader ¶
func PrintHeader(tag, desc string)
func PrintSectionFooter ¶
func PrintSectionFooter(name string)
func PrintSectionHeader ¶
func PrintSectionHeader(name string)
func ReportDone ¶ added in v0.1.1
func ReportFail ¶
func ReportPass ¶
func ReportSummary ¶ added in v0.1.1
func ReportSummary()
func ReportUnknown ¶
func RestoreDoTags ¶
func RestoreDoTags(doTags []string)
func SaveHistory ¶ added in v0.2.0
Types ¶
type Custom ¶
type Custom struct { Task genesis.Doer S func() (genesis.Status, error) D func() (bool, error) U func() (bool, error) I func() string F func() []string }
Custom is a type of genesis.Doer. It is a wrapper around another Doer which allows for custom Status/Do/Undo functions.
type FlagMerger ¶ added in v0.3.1
type FlagMerger struct {
// contains filtered or unexported fields
}
func NewFlagMerger ¶ added in v0.3.1
func NewFlagMerger() *FlagMerger
func (*FlagMerger) IsDefined ¶ added in v0.3.1
func (fm *FlagMerger) IsDefined(name string) bool
type IfThen ¶
IfThen is a type of genesis.Doer. It runs doer B if and only if doer A runs.
type Installer ¶
type Installer struct { Cmd string Verbose bool Facts genesis.Facts Tasks []genesis.Doer Dir string Gendir string DoTags string SkipTags string UserFlags []*flag.FlagSet ExecName string BuildDirs []string }
Installer is a wrapper around modules to provide a nice interface for building an installer.
func (*Installer) CleanUp ¶
func (inst *Installer) CleanUp()
CleanUp removes the temporary directory.
func (*Installer) ParseFlags ¶ added in v0.3.1
func (inst *Installer) ParseFlags()
ParseFlags does all the flag parsing for the installer.
type Section ¶
Section is a type of genesis.Doer. It groups Doers together with a label. It is useful for two reasons: 1) it allows for pretty labels in the output, and 2) it can group tasks together into a Doer that can be used as part of other Doers.
func NewSection ¶
type Switch ¶ added in v0.3.1
Switch runs a Doer depending on a value.