utils

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2014 License: Apache-2.0, Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(slice []string, data string) []string

Append grows a string array by appending a new element.

func CreateFile

func CreateFile(path string) error

CreateFile creates an empty file at the specified path.

func DeisIfy

func DeisIfy(message string) string

DeisIfy returns a pretty-printed deis logo along with the corresponding message

func Execute

func Execute(script string) error

func Extract

func Extract(file, dir string) (err error)

func GetClientID

func GetClientID() string

GetClientID returns the CoreOS Machine ID or an unknown UUID string

func GetFileBytes

func GetFileBytes(filename string) []byte

GetFileBytes returns a byte array of the contents of a file.

func GetHostIPAddress

func GetHostIPAddress() string

GetHostIPAddress returns the host IP for accessing etcd and Deis services.

func GetHostOs

func GetHostOs() string

GetHostOs returns either "darwin" or "ubuntu".

func GetKey

func GetKey(dir, key, perm string) string

func GetMachineID

func GetMachineID(root string) string

func GetRandomPort

func GetRandomPort() string

GetRandomPort returns an unused TCP listen port on the host.

func GetUserDetails

func GetUserDetails() (string, string)

GetUserDetails returns sections of a UUID.

func GetVersion

func GetVersion() string

func ListFiles

func ListFiles(dir string) ([]string, error)

func NewUuid

func NewUuid() string

NewUuid returns a new V4-style unique identifier.

func PullImage

func PullImage(args string) error

func PutVersion

func PutVersion(version string) error

func RunCommandWithStdoutStderr

func RunCommandWithStdoutStderr(cmd *exec.Cmd) (bytes.Buffer, bytes.Buffer, error)

RunCommandWithStdoutStderr execs a command and returns its output.

func Timeout

func Timeout(msg string, seconds time.Duration, f func()) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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