utils

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GalaxyEnv

func GalaxyEnv(c *cli.Context) string

func GalaxyPool

func GalaxyPool(c *cli.Context) string

func GalaxyRedisHost

func GalaxyRedisHost(c *cli.Context) string

func GetEnv

func GetEnv(name, defaultValue string) string

func HomeDir

func HomeDir() string

func HumanDuration

func HumanDuration(d time.Duration) string

HumanDuration returns a human-readable approximation of a duration (eg. "About a minute", "4 hours ago", etc.)

func NextSlot

func NextSlot(used []int) int

NextSlot finds the first available index in an array of integers

func ParseMemory

func ParseMemory(mem string) (int64, error)

func RemoveStringInSlice

func RemoveStringInSlice(a string, list []string) []string

func SSHCmd

func SSHCmd(host string, command string, background bool, debug bool)

func SplitDockerImage

func SplitDockerImage(img string) (string, string, string)

func StringInSlice

func StringInSlice(a string, list []string) bool

Types

type OutputBuffer

type OutputBuffer struct {
	Output []string
}

func (*OutputBuffer) Log

func (o *OutputBuffer) Log(msg string)

type SliceVar

type SliceVar []string

func (*SliceVar) Set

func (s *SliceVar) Set(value string) error

func (*SliceVar) String

func (s *SliceVar) String() string

type VersionedMap

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

VersionedMap is a CRDT where each key contains a version history of prior values. The value of the key is the value with the latest version. VersionMaps can be combined such that they always converge to the same values for all keys.

func NewVersionedMap

func NewVersionedMap() *VersionedMap

func (*VersionedMap) Get

func (v *VersionedMap) Get(key string) string

func (*VersionedMap) Keys

func (v *VersionedMap) Keys() []string

func (*VersionedMap) LatestVersion

func (v *VersionedMap) LatestVersion() int64

func (*VersionedMap) MarshalExpiredMap

func (v *VersionedMap) MarshalExpiredMap(age int64) map[string]string

MarshalExpiredMap returns historical entries that have been superseded by newer values

func (*VersionedMap) MarshalMap

func (v *VersionedMap) MarshalMap() map[string]string

func (*VersionedMap) Merge

func (v *VersionedMap) Merge(other *VersionedMap)

func (*VersionedMap) Set

func (v *VersionedMap) Set(key, value string)

func (*VersionedMap) SetVersion

func (v *VersionedMap) SetVersion(key, value string, version int64)

func (*VersionedMap) UnSet

func (v *VersionedMap) UnSet(key string)

func (*VersionedMap) UnSetVersion

func (v *VersionedMap) UnSetVersion(key string, version int64)

func (*VersionedMap) UnmarshalMap

func (v *VersionedMap) UnmarshalMap(serialized map[string]string) error

Jump to

Keyboard shortcuts

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