api

package
v0.0.0-...-ef7aa27 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LiteralArgumentType defines an argument with a literal string value.
	LiteralArgumentType ArgumentType = "Literal"

	// ConcatenateArgumentType defines an argument composed of other arguments.
	ConcatenateArgumentType = "Concatenate"

	// EnvironmentArgumentType defines an argument that is pulled from an
	// environment variable.
	EnvironmentArgumentType = "Environment"

	// ProcessNumberArgumentType defines an argument that is calculated using
	// the number of the process in the process list.
	ProcessNumberArgumentType = "ProcessNumber"

	// IPListArgumentType defines an argument that is a comma-separated list of
	// IP addresses, provided through an environment variable.
	IPListArgumentType = "IPList"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	// ArgumentType determines how the value is generated.
	ArgumentType ArgumentType `json:"type,omitempty"`

	// Value provides the value for a Literal type argument.
	Value string `json:"value,omitempty"`

	// Values provides the sub-values for a Concatenate type argument.
	Values []Argument `json:"values,omitempty"`

	// Source provides the name of the environment variable to use for an
	// Environment type argument.
	Source string `json:"source,omitempty"`

	// Multiplier provides a multiplier for the process number for ProcessNumber
	// type arguments.
	Multiplier int `json:"multiplier,omitempty"`

	// Offset provides an offset to add to the process number for ProcessNumber
	// type arguments.
	Offset int `json:"offset,omitempty"`

	// IPFamily provides the family to use for IPList type arguments.
	IPFamily int `json:"ipFamily,omitempty"`
}

Argument defines an argument to the process.

func (Argument) GenerateArgument

func (argument Argument) GenerateArgument(processNumber int, env map[string]string) (string, error)

GenerateArgument processes an argument and generates its string representation.

func (Argument) LookupEnv

func (argument Argument) LookupEnv(env map[string]string) (string, error)

LookupEnv looks up the value for an argument from the environment.

type ArgumentType

type ArgumentType string

ArgumentType defines the types for arguments.

type ProcessConfiguration

type ProcessConfiguration struct {
	// Version provides the version of FoundationDB the process should run.
	Version string `json:"version"`

	// RunServers defines whether we should run the server processes.
	// This defaults to true, but you can set it to false to prevent starting
	// new fdbserver processes.
	RunServers *bool `json:"runServers,omitempty"`

	// BinaryPath provides the path to the binary to launch.
	BinaryPath string `json:"-"`

	// Arguments provides the arguments to the process.
	Arguments []Argument `json:"arguments,omitempty"`
}

ProcessConfiguration models the configuration for starting a FoundationDB process.

func (*ProcessConfiguration) GenerateArguments

func (configuration *ProcessConfiguration) GenerateArguments(processNumber int, env map[string]string) ([]string, error)

GenerateArguments interprets the arguments in the process configuration and generates a command invocation.

Jump to

Keyboard shortcuts

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