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 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