runner

package
v0.0.0-...-b274fa0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LeaderAPIsHealthy

func LeaderAPIsHealthy(ctx context.Context, apis []LeaderAPI) error

func LeaderAPIsHealthyNow

func LeaderAPIsHealthyNow(apis []LeaderAPI) (string, error)

func LeaderPeerAPIsHealthy

func LeaderPeerAPIsHealthy(ctx context.Context, apis []LeaderPeersAPI, expectedPeers []string) error

func LeaderPeerAPIsHealthyNow

func LeaderPeerAPIsHealthyNow(apis []LeaderPeersAPI, expectedPeers []string) error

Types

type APIConfig

type APIConfig struct {
	Address url.URL
	CAFile  string
}

APIConfig contains enough information to create a connection to a service: the address of the service and the CA needed for TLS handshaking.

type Command

type Command interface {
	Name() string
	// Args are the command-line arguments to launch the process with.
	Args() []string
	// Env is the key=value settings to put in the environment.
	Env() []string
	// Files are a map from base file name to file contents.  These inputs
	// must be written to the ConfigDir before launch.
	Files() map[string]string
	// WithConfig returns a new Command with alternate config
	Config() Config
	WithConfig(Config) Command
}

Command describes how to run and interact with a process that starts a service.

type Config

type Config struct {
	// ConfigDir is where config files live
	ConfigDir string
	// DataDir is where the process writes data
	DataDir string
	// LogDir is where logs are written by the process, if it knows how to
	// log to disk.
	LogDir string
	// NetworkConfig specifies how network addresses get assigned
	NetworkConfig yurt.NetworkConfig
	// NodeName is the name for this instance of the process.  This may or
	// may not be an addressable name, depending on NetworkConfig.
	NodeName string
	TLS      pki.TLSConfigPEM
	Ports    yurt.Ports
}

Config is the common config shared by all runners, though not all members may be used. For example, a stateless service may have no DataDir.

type Harness

type Harness interface {
	// Endpoint returns the config for the named service.  If local is true,
	// the config is relative to the caller, otherwise it is given in terms
	// of the service nodes themselves.  These may be equivalent depending
	// on the execution model, i.e. whether port forwarding is being used
	// to bridge the local and execution networks.
	Endpoint(name string, local bool) (*APIConfig, error)
	Stop() error
	Kill()
	Wait() error
}

type LeaderAPI

type LeaderAPI interface {
	Leader() (string, error)
}

type LeaderPeersAPI

type LeaderPeersAPI interface {
	Leader() (string, error)
	Peers() ([]string, error)
}

LeaderPeersAPI describes a distributed consensus API of many nodes with a single leader under quorum.

type Status

type Status interface {
	// Status() returns the service-dependent status result, or an error
	// if the service isn't even able to do that
	Status() (interface{}, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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