util

package
v0.3.1-rc2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2015 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoNetwork = errors.New("Networking not available to load resource")
	ErrNotFound  = errors.New("Failed to find resource")
)

Functions

func Contains

func Contains(values []string, value string) bool

func Convert added in v0.2.0

func Convert(from, to interface{}) error

func ExtractTar

func ExtractTar(archive string, dest string) error

func GetFsType

func GetFsType(device string) (string, error)

func GetOSType added in v0.3.1

func GetOSType() string

func GetServices added in v0.3.0

func GetServices(urls []string) ([]string, error)

func GetValue added in v0.3.0

func GetValue(kvPairs []string, key string) string

func IsRunningInTty

func IsRunningInTty() bool

func KVPairs2Map added in v0.3.1

func KVPairs2Map(kvs []string) map[string]string

func LoadResource added in v0.3.0

func LoadResource(location string, network bool, urls []string) ([]byte, error)

func Map2KVPairs added in v0.3.1

func Map2KVPairs(m map[string]string) []string

func MergeBytes added in v0.3.0

func MergeBytes(left, right []byte) ([]byte, error)

func MergeMaps added in v0.2.0

func MergeMaps(left, right map[interface{}]interface{})

func Mount

func Mount(device, directory, fsType, options string) error

func RandSeq

func RandSeq(n int) string

func Remount

func Remount(directory, options string) error

func ResolveDevice

func ResolveDevice(spec string) string

func ShortCircuit

func ShortCircuit(funcs ...ReturnsErr) error

Types

type ErrWriter

type ErrWriter struct {
	Err error
	// contains filtered or unexported fields
}

func NewErrorWriter

func NewErrorWriter(w io.Writer) *ErrWriter

func (*ErrWriter) Write

func (e *ErrWriter) Write(buf []byte) *ErrWriter

type ReturnsErr

type ReturnsErr func() error

Jump to

Keyboard shortcuts

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