utils

package
v2.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0, BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckClientVersion

func CheckClientVersion(client utilClient, version string)

func CopyToByTargets

func CopyToByTargets(sourceParameters map[string]interface{}, parameters ...string) map[string]interface{}

func DelimitedStringToArray

func DelimitedStringToArray(text, delimiter string) []string

Returns a slice of strings. If the string is empty it will return an empty slice.

func EscapeStringToJson

func EscapeStringToJson(input string) string

func LogErrorAndExit

func LogErrorAndExit(err error)

func LogErrorMessage

func LogErrorMessage(message string)

func LogErrorMessageAndExit

func LogErrorMessageAndExit(message string)

func LogMissingParameterAndExit

func LogMissingParameterAndExit(c *cli.Context, missingFlags []string, message ...string)

func LogMissingParameterMessageAndExit

func LogMissingParameterMessageAndExit(c *cli.Context, message string)

func Println

func Println(a ...interface{}) (n int, err error)

func RandStr

func RandStr(n int) string

func ReadContentFromURL

func ReadContentFromURL(urlLocation string, client *http.Client) []byte

func ReadFile

func ReadFile(fileLocation string) []byte

func SafeInt32Convert

func SafeInt32Convert(value *int32) int32

func SafeStringConvert

func SafeStringConvert(value *string) string

func SafeStringTypeAssert

func SafeStringTypeAssert(value interface{}) string

func TimeTrack

func TimeTrack(start time.Time, name string)

Types

type CBFormatter

type CBFormatter struct {
}

func (*CBFormatter) Format

func (f *CBFormatter) Format(entry *log.Entry) ([]byte, error)

type Output

type Output struct {
	Format string
}

func (*Output) Write

func (o *Output) Write(header []string, row Row)

func (*Output) WriteList

func (o *Output) WriteList(header []string, tableRows []Row)

type RESTError

type RESTError struct {
	Response interface{}
	Code     int
}

func (*RESTError) Error

func (e *RESTError) Error() string

func (*RESTError) ShortError

func (e *RESTError) ShortError() string

type Row

type Row interface {
	DataAsStringArray() []string
}

Jump to

Keyboard shortcuts

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