Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorMarshal ¶
ColorMarshal marshals JSON data with default options
func Must ¶
Must only returns the byte array from the argument tuple (byte array, error).
Use with caution, ie. only when you are absolutely certain that it shouldn't lead to a panic, or that if it leads to a panic it means that there's no way the program should work anyway. For example, `bytes := utils.Must(hex.DecodeString(h))` where `h` is an hexadecimal string hash.
func Retry ¶
func Retry(numberOfRetry int, duration int, callback RetryCallback, args interface{}, needToExit bool, then RetryCallback, thenArgs interface{})
Retry is a function supposed to be called in a goroutine to execute a callback a number of time with a given time between each repetition. duration is in Millisecond.
Types ¶
type ColorFormatter ¶
type ColorFormatter struct {
KeyColor *color.Color
StringColor *color.Color
BoolColor *color.Color
NumberColor *color.Color
NullColor *color.Color
StringMaxLength int
Indent int
DisabledColor bool
RawStrings bool
}
ColorFormatter ...
func (*ColorFormatter) ColorMarshal ¶
func (f *ColorFormatter) ColorMarshal(jsonObj interface{}) ([]byte, error)
ColorMarshal ...
Click to show internal directories.
Click to hide internal directories.