Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool a wrapper under sync.Pool which holds buffers.
func NewBufferPool ¶
func NewBufferPool(size int) *BufferPool
NewBufferPool creates new instance of BufferPool.
type ErrOnce ¶
type ErrOnce struct {
// contains filtered or unexported fields
}
ErrOnce we same as sync.Once but require a function which can return an error. This error will be hold inside this type and return every time when someone call `Do` method.
type ErrOnceWithValue ¶
type ErrOnceWithValue[T any] struct { // contains filtered or unexported fields }
ErrOnceWithValue we same as ErrOnce but holds the value as well.
func (*ErrOnceWithValue[T]) Do ¶
func (e *ErrOnceWithValue[T]) Do(fn func() (T, error)) (T, error)
Do doing the stuff.
Click to show internal directories.
Click to hide internal directories.