util

package
v0.0.0-...-10febd9 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2017 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FleetTTL = "3s"
)

Variables

This section is empty.

Functions

func ActiveToSingleStates

func ActiveToSingleStates(active map[string][]UnitState) (map[string]UnitState, error)

ActiveToSingleStates takes a map of active states (such as that returned by WaitForNActiveUnits) and ensures that each unit has at most a single active state. It returns a mapping of unit name to a single UnitState.

func BuildCloudConfig

func BuildCloudConfig(dst io.Writer, ip, etcdEndpoint, etcdKeyPrefix string) error

func CopyFile

func CopyFile(newFile, oldFile string) error

CopyFile()

func GenNewFleetService

func GenNewFleetService(newFile, oldFile, newVal, oldVal string) error

GenNewFleetService() is a helper for generating a temporary fleet service that reads from oldFile, replaces oldVal with newVal, and stores the result to newFile.

func NewMachineID

func NewMachineID() string

func RunFleetctl

func RunFleetctl(args ...string) (string, string, error)

func RunFleetctlWithInput

func RunFleetctlWithInput(input string, args ...string) (string, string, error)

func TempUnit

func TempUnit(contents string) (string, error)

tempUnit creates a local unit file with the given contents, returning the name of the file

func WaitForState

func WaitForState(stateCheckFunc func() bool) (time.Duration, error)

Types

type UnitFileState

type UnitFileState struct {
	Name         string
	DesiredState string
	State        string
}

func ParseUnitFileStates

func ParseUnitFileStates(units []string) (states []UnitFileState)

type UnitState

type UnitState struct {
	Name        string
	ActiveState string
	Machine     string
}

func FilterActiveUnits

func FilterActiveUnits(states []UnitState) (filtered []UnitState)

func ParseUnitStates

func ParseUnitStates(units []string) (states []UnitState)

Jump to

Keyboard shortcuts

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