Documentation
¶
Index ¶
- func DurationSecondToInt(d *time.Duration) *int
- func GetWriter(consumer func(string)) io.WriteCloser
- func StringToBool(s string) bool
- type SafeBuffer
- type Set
- func (s Set[T]) Add(v T)
- func (s Set[T]) AddAll(v ...T)
- func (s Set[T]) Clear()deprecated
- func (s Set[T]) Diff(other Set[T]) Set[T]
- func (s Set[T]) Elements() []T
- func (s Set[T]) Has(v T) bool
- func (s Set[T]) Remove(v T) bool
- func (s Set[T]) RemoveAll(elements ...T)
- func (s Set[T]) Union(other Set[T]) Set[T]deprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationSecondToInt ¶
func GetWriter ¶
func GetWriter(consumer func(string)) io.WriteCloser
GetWriter creates an io.Writer that will actually split by line and format by LogConsumer
func StringToBool ¶
StringToBool converts a string to a boolean ignoring errors
Types ¶
type SafeBuffer ¶
type SafeBuffer struct {
// contains filtered or unexported fields
}
SafeBuffer is a thread safe version of bytes.Buffer
func (*SafeBuffer) Bytes ¶
func (b *SafeBuffer) Bytes() []byte
Bytes is a thread safe version of bytes.Buffer::Bytes
func (*SafeBuffer) Read ¶
func (b *SafeBuffer) Read(p []byte) (n int, err error)
Read is a thread safe version of bytes.Buffer::Read
func (*SafeBuffer) RequireEventuallyContains ¶
func (b *SafeBuffer) RequireEventuallyContains(t testing.TB, v string)
RequireEventuallyContains is a thread safe eventual checker for the buffer content
func (*SafeBuffer) String ¶
func (b *SafeBuffer) String() string
String is a thread safe version of bytes.Buffer::String
type Set ¶
type Set[T comparable] map[T]struct{}
func NewSet ¶
func NewSet[T comparable](v ...T) Set[T]
Click to show internal directories.
Click to hide internal directories.