cluster

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

func NewCluster

func NewCluster(
	opts Options,
	cmdFactory cmdFactory,
	logger *zap.SugaredLogger,
) *Cluster

func (*Cluster) Connect

Connect creates shell-command executors for each node. If the tool is running over SSH, the SSH connections are established here and the errors are reported.

func (*Cluster) Run

Run executes a given callback on each node consecutively. Stops the execution on error.

func (*Cluster) RunParallel

func (c *Cluster) RunParallel(
	ctx context.Context,
	callback entity.NodeCallback,
) entity.NodeCallbackResults

RunParallel executes a given callback on each node in parallel. The execution does not stop even if there's an error on one of the nodes.

func (*Cluster) Size

func (c *Cluster) Size() int

Size returns the number of nodes in cluster

type Options

type Options struct {
	// a list of hosts where the tool should run
	Hosts    []string
	Binaries entity.NodeBinaries
	DataPath string `yaml:"dataPath"`
}

Jump to

Keyboard shortcuts

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