Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶ added in v2.11.0
Contains helps to detect if a non-comparable struct is part of an array only use this method if you can't rely on existing golang Contains function of slices (https://pkg.go.dev/golang.org/x/exp/slices#Contains)
func DurationSecondToInt ¶ added in v2.12.0
func GetWriter ¶
func GetWriter(consumer func(string)) io.WriteCloser
GetWriter creates a io.Writer that will actually split by line and format by LogConsumer
func StringContains ¶
StringContains check if an array contains a specific value
func StringToBool ¶ added in v2.3.0
StringToBool converts a string to a boolean ignoring errors
Types ¶
type SafeBuffer ¶ added in v2.12.0
type SafeBuffer struct {
// contains filtered or unexported fields
}
SafeBuffer is a thread safe version of bytes.Buffer
func (*SafeBuffer) Bytes ¶ added in v2.12.0
func (b *SafeBuffer) Bytes() []byte
Bytes is a thread safe version of bytes.Buffer::Bytes
func (*SafeBuffer) Read ¶ added in v2.12.0
func (b *SafeBuffer) Read(p []byte) (n int, err error)
Read is a thread safe version of bytes.Buffer::Read
func (*SafeBuffer) RequireEventuallyContains ¶ added in v2.12.0
func (b *SafeBuffer) RequireEventuallyContains(t testing.TB, v string)
RequireEventuallyContains is a thread safe eventual checker for the buffer content
func (*SafeBuffer) String ¶ added in v2.12.0
func (b *SafeBuffer) String() string
String is a thread safe version of bytes.Buffer::String