util

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CanNotOpen = "can't open"
View Source
const CommandNotFound = "command not found"
View Source
const ErrorIsNotRecoverable = "Error is not recoverable"
View Source
const NoSuchFileOrDirectory = "no such file or directory"
View Source
const NotInstalled = "not installed"
View Source
const ProgramCanBeFound = "can be found in the following packages"

Variables

Functions

func Append

func Append(dest, source map[string]interface{}, override bool)

AppendMap source to dest map

func AsDataMap

func AsDataMap(source interface{}) data.Map

func AsExtractable

func AsExtractable(input interface{}) (string, map[string]interface{})

AsExtractable returns text and data structure

func AsPayload

func AsPayload(data []byte) string

AsPayload return string optionally encoded as base64 data has binary data.

func CheckCommandNotFound

func CheckCommandNotFound(stdout ...string) bool

CheckCommandNotFound checks for command not found message in the provided stdout.

func CheckNoSuchFileOrDirectory

func CheckNoSuchFileOrDirectory(stdout ...string) bool

CheckNoSuchFileOrDirectory checks for no such file or directory message in the provided stdout.

func Decode

func Decode(ownerURL, URI string, result interface{}) error

Decode load and decode URI into result pointer

func DecodeMap

func DecodeMap(ownerURL, URI string, result map[string]interface{}) error

DecodeMap load and decode URI into result pointer

func EscapeStdout

func EscapeStdout(stdout string) string

func EscapedContains

func EscapedContains(stdout, match string) bool

func ExtractColumn

func ExtractColumn(line string, columnIndex int) (string, bool)

ExtractColumn extract a column from the line for provided index

func ExtractColumns

func ExtractColumns(line string) ([]string, bool)

ExtractColumns extract all column from the line

func FromPayload

func FromPayload(payload string) ([]byte, error)

FromPayload return bytes from

func GetCredential

func GetCredential(name, username, password string) (string, error)

func GetDummyCredential

func GetDummyCredential() (string, error)

func GetUsername

func GetUsername(service *secret.Service, credentials string) (string, error)

func NormalizeMap

func NormalizeMap(keyValuePairs interface{}, deep bool) (map[string]interface{}, error)

NormalizeMap normalizes keyValuePairs from map or slice (map with preserved key order)

func SetNonEmpty added in v0.8.0

func SetNonEmpty(ptr1, ptr2 *string)

func SetNonZero added in v0.8.0

func SetNonZero(ptr1, ptr2 *int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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