spanner

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	Command    []string
	SaveOutput bool
	Silent     bool
	ExecType   string
	HostID     string
}

Job is a spanner job

type Spanner

type Spanner struct {
	Job
	Laforge  *core.Laforge
	TeamDirs map[int]string
	Workers  map[int]*Worker
	LogDir   string
	BuildDir string
	Result   chan *Worker
	ExecTime int64
}

Spanner is a multiplexer for teams in a laforge environment

func New

func New(base *core.Laforge, command []string, exectype, hostid string, saveOutput, silent bool) (*Spanner, error)

New returns a new Spanner

func (*Spanner) CreateWorkerPool

func (s *Spanner) CreateWorkerPool() error

CreateWorkerPool creates the individual workers for the spanner

func (*Spanner) Do

func (s *Spanner) Do() error

Do does stuff

type Worker

type Worker struct {
	Job
	ID         int64
	TeamID     int
	Parent     *Spanner
	Host       *core.ProvisionedHost
	BeginTime  time.Time
	EndTime    time.Time
	LogFile    string
	TeamDir    string
	ExitStatus int
	ExitError  error
}

Worker is a single unit of work and corrasponds to a single team element within a build

func (*Worker) ResolveProvisionedHost

func (w *Worker) ResolveProvisionedHost() error

ResolveProvisionedHost gets the provisioned host config from the team

func (*Worker) RunLocalCommand

func (w *Worker) RunLocalCommand(wc chan *Worker)

RunLocalCommand executes the worker's task, piping output to the logfile

func (*Worker) RunRemoteCommand

func (w *Worker) RunRemoteCommand(wc chan *Worker)

RunRemoteCommand begins the process for executing commands across the Spanner's worker.

func (*Worker) RunSSHCommand

func (w *Worker) RunSSHCommand(wc chan *Worker)

RunSSHCommand executes the remote command over the SSH remote protocol

func (*Worker) RunWinRMCommand

func (w *Worker) RunWinRMCommand(wc chan *Worker)

RunWinRMCommand executes the remote command over the WinRM protocol on remote Windows hosts

func (*Worker) Verify

func (w *Worker) Verify() error

Verify attempts to validate the constructs of the spanner

Jump to

Keyboard shortcuts

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