util

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FleetTTL = "3s"
)

Variables

This section is empty.

Functions

func ActiveToSingleStates added in v0.8.0

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 added in v0.10.0

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

func CopyFile added in v0.13.0

func CopyFile(newFile, oldFile string) error

CopyFile()

func GenNewFleetService added in v0.13.0

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 added in v0.13.0

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 added in v0.12.0

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

Types

type UnitFileState added in v0.12.0

type UnitFileState struct {
	Name         string
	DesiredState string
	State        string
}

func ParseUnitFileStates added in v0.12.0

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

type UnitState

type UnitState struct {
	Name        string
	ActiveState string
	Machine     string
}

func FilterActiveUnits added in v0.9.0

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

func ParseUnitStates added in v0.9.0

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

Jump to

Keyboard shortcuts

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