Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a Buffer pool.
type BufferPool ¶
func NewBuffer ¶
func NewBuffer(max int) BufferPool
NewBuffer returns a buffer pool. The max specify the max capacity of the Buffer the pool will return. If the Buffer becoomes large than max, it will no longer be returned to the pool. If max <= 0, no limit will be enforced.
type BufferWithCap ¶
type BufferWithCap struct {
// contains filtered or unexported fields
}
BufferWithCap is a Buffer pool that
func (*BufferWithCap) Put ¶
func (b *BufferWithCap) Put(x *bytes.Buffer)
Put the Buffer back into the pool if the capacity doesn't exceed the limit. It resets the Buffer for reuse.
Click to show internal directories.
Click to hide internal directories.