api

package
v0.0.0-...-a35789a Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobResult

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

type Result

type Result struct {
	Host   string
	Output []byte
	Err    error
}

Result: the results of running a command against a specific host. The struct and its fields are exported to enable live-streaming results to the caller.

type WorkerPool

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

WorkerPool: everything required to orchestrate running the command against remote hosts

func CreatePool

func CreatePool(poolSize int, cmd string, config ssh.ClientConfig) *WorkerPool

CreatePool: create the worker pool

func (*WorkerPool) RunJob

func (wp *WorkerPool) RunJob(ctx context.Context, host string) (Result, error)

RunJob: run the remote command against the specified host and return the Result. Return an error if the context is cancelled before the job finishes.

func (*WorkerPool) ScheduleWorkers

func (wp *WorkerPool) ScheduleWorkers()

ScheduleWorkers: add workers to the worker pool

Jump to

Keyboard shortcuts

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