gutil

package module
v0.0.0-...-7e90bad Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: LGPL-3.0 Imports: 3 Imported by: 1

README

gutil

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToJSONTree

func ConvertToJSONTree(in interface{}) interface{}

ConvertToJSONTree will take a value or tree of lists and maps and return a version where types that are not json compatible are converted to json formats. Those are: int, int32, int64, float32 -> float64 maps with non string keys to maps with string keys

func FatalIf

func FatalIf(message string, values ...interface{})

if one of the parameters after the format string is of type error (implicitly not nil) log.Fatal will be called */

func LogIf

func LogIf(message string, values ...interface{})

func PrintAsYAML

func PrintAsYAML(obj interface{})

PrintAsYAML prins the given object formatted as yaml to stdout

Types

type ErrorCollector

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

func Merge

func Merge(a, b *ErrorCollector) *ErrorCollector

Merge creates a new errors collector with the errors from both parameters

func NewErrorCollector

func NewErrorCollector() *ErrorCollector

func (*ErrorCollector) Add

func (ec *ErrorCollector) Add(err error) bool

func (*ErrorCollector) Error

func (ec *ErrorCollector) Error() string

func (*ErrorCollector) First

func (ec *ErrorCollector) First() error

func (*ErrorCollector) Has

func (ec *ErrorCollector) Has() bool

func (*ErrorCollector) Last

func (ec *ErrorCollector) Last() error

func (*ErrorCollector) StringList

func (ec *ErrorCollector) StringList() []string

func (*ErrorCollector) ThisOrNil

func (ec *ErrorCollector) ThisOrNil() error

ThisOrNil returns the instance if there are errors inside, otherwise nil. This is usefull to mimik the default error handling where nil means no error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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