Documentation ¶
Index ¶
- Variables
- func CreateTableString(header []string, data []*LineData) (string, error)
- func DisplayByteSlice(slice []byte) string
- func Headline(message string, timestamp string, delimiter string) string
- func SetDisplayByteSlice(f func(slice []byte) string) error
- func ToHexShort(slice []byte) string
- type LineData
Constants ¶
This section is empty.
Variables ¶
var ErrEmptySlices = errors.New("empty slices")
ErrEmptySlices signals that empty slices has been provided
var ErrNilDataLines = errors.New("nil lineData slice")
ErrNilDataLines signals that a nil data lines slice has been provided
var ErrNilDisplayByteSliceHandler = errors.New("nil display byte slice handler")
ErrNilDisplayByteSliceHandler signals that a nil display byte slice handler has been provided
var ErrNilHeader = errors.New("nil header")
ErrNilHeader signals that a nil header slice has been provided
var ErrNilLineDataInSlice = errors.New("nil line data element found in slice")
ErrNilLineDataInSlice signals that a nil line data element was found in slice
var ErrNilValuesOfLineDataInSlice = errors.New("nil line data values slice found")
ErrNilValuesOfLineDataInSlice signals that a line data element has nil values
Functions ¶
func CreateTableString ¶
CreateTableString creates an ASCII table having header as table header and a LineData slice as table rows It automatically resize itself based on the lengths of every cell
func DisplayByteSlice ¶ added in v1.0.41
DisplayByteSlice converts the provided byte slice to its string representation using displayByteSlice function pointer
func Headline ¶
Headline will build a headline message given a delimiter string
timestamp parameter will be printed before the repeating delimiter
func SetDisplayByteSlice ¶ added in v1.0.41
SetDisplayByteSlice sets the converter function from byte slice to string default, this will call hex.EncodeToString. It will also change the logger's convert function so that the messages will be consistent
func ToHexShort ¶ added in v1.0.41
ToHexShort generates a short-hand of provided bytes slice showing only the first 3 and the last 3 bytes as hex in total, the resulting string is maximum 13 characters long