Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BufferPool ¶
type BufferPool interface { // 获取一个预估容量为<size>的Buffer对象,不同的策略返回的Buffer对象实际容量可能会有不同,但是不会返回nil Get(size int) *bytes.Buffer // 将Buffer对象放回池中 Put(buf *bytes.Buffer) // 获取池当前状态 RetrieveStatus() Status }
func NewBufferPool ¶
func NewBufferPool(strategy Strategy) BufferPool
type SliceBucket ¶
type SliceBucket struct {
// contains filtered or unexported fields
}
func NewSliceBucket ¶
func NewSliceBucket() *SliceBucket
func (*SliceBucket) Get ¶
func (b *SliceBucket) Get() *bytes.Buffer
func (*SliceBucket) Put ¶
func (b *SliceBucket) Put(buf *bytes.Buffer)
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
func RetrieveStatus ¶
func RetrieveStatus() Status
type StdPoolBucket ¶
type StdPoolBucket struct {
// contains filtered or unexported fields
}
func NewStdPoolBucket ¶
func NewStdPoolBucket() *StdPoolBucket
func (*StdPoolBucket) Get ¶
func (b *StdPoolBucket) Get() *bytes.Buffer
func (*StdPoolBucket) Put ¶
func (b *StdPoolBucket) Put(buf *bytes.Buffer)
Click to show internal directories.
Click to hide internal directories.