octopus

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package octopus defines an octopus config struct, and a method to run the octopus command defined with the configs provided.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Octopus

type Octopus struct {
	// contains filtered or unexported fields
}

Octopus is a metaphorical octopus which can run commands on remote hosts in parallel with its many arms.

func New

func New(c remote.Connector, hostGroups []string, groupsFile string) *Octopus

New finds an octopus and trains it about how its environment is configured and what host groups it should operate on.

func (*Octopus) Do

func (o *Octopus) Do(action remote.Action) (numHostErrors int, err error)

Do sends out tentacles to all hosts in the host group(s) in individual goroutines and collects the results of all the tentacles at the end. Returns the number of hosts that report errors if the tentacles are able to be sent out.

type Result

type Result struct {
	Hostname string
	Stdout   *bytes.Buffer
	Stderr   *bytes.Buffer
	Err      error
}

Result is the result of an action. The result includes the hostname of the target to better help the user identify in human-readable format which host the result is from. The result also includes information needed to report success and failure conditions.

func (*Result) Print

func (r *Result) Print()

Print outputs a result in a nice human readable format, printing main output to stdout and error output to stderr.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL