Documentation ¶
Index ¶
- Variables
- func ConsoleUI(root CommandNode) error
- func ConsoleUIInterupt(fn func())
- func NewLogFuncWriter(prefix string, log func(format string, args ...interface{})) io.Writer
- func OSExec(owner *Command, dir string, logPrefix string, program string, args ...string) error
- func OSExecAllToStdOut(owner *Command, dir string, logPrefix string, program string, args ...string) error
- func SingleCommandUI(c *Command)
- func StreamCall(command CommandNode, attachTo CommandNode, threads int, input io.Reader, ...) error
- func StreamReceive(input io.Reader, output io.Writer) error
- type Command
- func (c *Command) Add(caption string, cmd CommandNode) CommandNode
- func (c *Command) AnyError() bool
- func (c *Command) AsCommand() *Command
- func (c *Command) Err(err error)
- func (c *Command) Errf(message string, args ...interface{})
- func (c *Command) GetResult() interface{}
- func (c *Command) Logf(message string, args ...interface{})
- func (c *Command) SetProgress(p float64)
- func (c *Command) SetResult(value interface{})
- type CommandNode
- type CommandState
- type LogEntry
- type MonitorEvent
- type RootCommand
- type Runner
Constants ¶
This section is empty.
Variables ¶
View Source
var SpinnerCharacters = []rune("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏")
Functions ¶
func ConsoleUI ¶
func ConsoleUI(root CommandNode) error
func ConsoleUIInterupt ¶
func ConsoleUIInterupt(fn func())
func NewLogFuncWriter ¶
func OSExecAllToStdOut ¶
func SingleCommandUI ¶
func SingleCommandUI(c *Command)
func StreamCall ¶
Types ¶
type Command ¶
type Command struct { ID string Caption string State CommandState LogEvent func(evt *MonitorEvent) LogArray []*LogEntry Children []CommandNode RemoteCommand bool // contains filtered or unexported fields }
func (*Command) Add ¶
func (c *Command) Add(caption string, cmd CommandNode) CommandNode
func (*Command) SetProgress ¶
type CommandNode ¶
type CommandNode interface { Execute() AsCommand() *Command }
func NewBashCommands ¶
func NewBashCommands(dir string, timeTakenFormat string, logprefix string, commands ...string) CommandNode
func NewExecCommand ¶
func NewFuncCommand ¶
func NewFuncCommand(execute func(cmd *Command)) CommandNode
type CommandState ¶
type CommandState int
const ( CommandStateReady CommandState = iota CommandStateRunning CommandStatePaused CommandStateCompleted )
type MonitorEvent ¶
type MonitorEvent struct { EventType monitorEventType CommandID string ParentID string State CommandState Caption string LogEntry *LogEntry Result interface{} }
type RootCommand ¶
type RootCommand struct {
Command
}
func NewRootCommand ¶
func NewRootCommand(caption string) *RootCommand
func (*RootCommand) Execute ¶
func (c *RootCommand) Execute()
Click to show internal directories.
Click to hide internal directories.