Documentation
¶
Overview ¶
Package pool provides wrappers over sync.Pool to be used in Holyheld applications
Index ¶
Constants ¶
View Source
const Unsized = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
func NewBufferPool ¶
func NewBufferPool(defaultSize int64) *BufferPool
NewBufferPool creates a new buffer pool with the given default size. If defaultSize is 0, the pool will create a new empty buffer for each Pool.New call Else, the pool will create a new buffer with the given cap for each Pool.New call
Panics if defaultSize is negative.
func (*BufferPool) Get ¶
func (p *BufferPool) Get() *bytes.Buffer
Get returns a buffer from the pool.
func (*BufferPool) Put ¶
func (p *BufferPool) Put(v *bytes.Buffer)
Put resets the buffer and puts it back to the pool.
func (*BufferPool) Size ¶
func (p *BufferPool) Size() int64
Click to show internal directories.
Click to hide internal directories.