Documentation ¶
Index ¶
- func NewPrefixWriter(prefix string, writer io.Writer) io.Writer
- func WithEnv(env map[string]string) optionLoader
- func WithOsPipe() optionLoader
- func WithPrefixWriter(node Node) optionLoader
- func WithStderr(w io.Writer) optionLoader
- func WithStdout(w io.Writer) optionLoader
- func WithTimeout(timeout time.Duration) optionLoader
- type ClusterDispatcher
- type Command
- type Node
- type PrefixWriter
- type UserQualifiedHostname
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithOsPipe ¶
func WithOsPipe() optionLoader
WithOsPipe sets the stdout and stderr of the command to `os.Stdout` and `os.Stderr`.
func WithPrefixWriter ¶
func WithPrefixWriter(node Node) optionLoader
WithPrefixWriter sets the prefix writer for the command. Must be used after WithStdout or WithStderr.
func WithStderr ¶
WithStderr sets the stderr writer for the command. If `nil`, it defaults to `os.Stderr`.
func WithStdout ¶
WithStdout sets the stdout writer for the command. If `nil`, it defaults to `os.Stdout`.
func WithTimeout ¶
WithTimeout sets the timeout for the command.
Types ¶
type ClusterDispatcher ¶
type ClusterDispatcher interface { // GetNodes returns all nodes in the cluster. GetNodes() []Node // GetMasterNode returns the master node in the cluster. GetMasterNode() Node // GetWorkerNodes returns all worker nodes in the cluster. GetWorkerNodes() []Node // Ready checks if the cluster is ready to accept commands. Ready() bool // SendCommands sends commands to a node in the cluster. SendCommands(node Node, cmds ...Command) error // SendCommandsContext sends commands to a node in the cluster with a custom context. SendCommandsContext(ctx context.Context, node Node, cmds ...Command) error // SendFile sends a file to a node in the cluster. SendFile(node Node, src, dst string) error // DownloadProject sets up the log-console project into the given node. If the source begins with // local://, it'll mount the local directory into the node. For all other sources, it'll git // clone the URL. DownloadProject(node Node, source string) error // Cleanup disposes of any held resources. Cleanup() error }
type Command ¶
type Command struct { Cmd string Env map[string]string Stdout io.Writer Stderr io.Writer Timeout time.Duration }
func NewCommand ¶
NewCommand creates a command object from a command string with provided options.
func NewCommands ¶
NewCommands creates a list of command objects from the provided command strings, and options.
type Node ¶
type Node struct { Name string Remote UserQualifiedHostname }
type PrefixWriter ¶
type PrefixWriter struct {
// contains filtered or unexported fields
}
type UserQualifiedHostname ¶
func (*UserQualifiedHostname) ParseString ¶
func (r *UserQualifiedHostname) ParseString(s string) (*UserQualifiedHostname, error)
func (UserQualifiedHostname) String ¶
func (r UserQualifiedHostname) String() string
Click to show internal directories.
Click to hide internal directories.