utils

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(e error)

CheckErr prints the error and do nothing else

func CombineErrs

func CombineErrs(errs []error) error

CombineErrs combines multiple errors

func RandomStr

func RandomStr(chars string, length int) string

RandomStr generates a random string within charset `chars` and shorter than length

func ReConvert

func ReConvert(ptn string) string

ReConvert does the pre-process of the regular expression literal. It does the following things: 1. Remove P before captured group names 2. Add parenthesises to the other parts of the log event string.

func StrIndex

func StrIndex(vs []string, t string) int

StrIndex is the helper function to find the position of a string in a []string

func StrSlice2DCopy

func StrSlice2DCopy(src [][]string) (cpy [][]string)

StrSlice2DCopy is a simple helper function to make a deep copy of a 2-dimensional string slice.

func XMLStr

func XMLStr(maxDepth int, maxElements int, seed []string) (string, error)

XMLStr returns an XML string with specified maximum depth and elements of each level

Types

This section is empty.

Jump to

Keyboard shortcuts

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