Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DebugPool ¶
type DebugPool struct {
sync.Mutex
Rand *rand.Rand
OnLog func(string) // May be used to print debug logs in real-time
OnError func(string)
OnFatal func(string)
// contains filtered or unexported fields
}
func NewDebugPool ¶ added in v0.3.0
func NewTestDebugPool ¶
type Pool ¶
type Pool interface {
// Get retrieves a buffer of the appropriate length from the buffer pool or
// allocates a new one. Get may choose to ignore the pool and treat it as empty.
// Callers should not assume any relation between values passed to Put and the
// values returned by Get.
//
// If no suitable buffer exists in the pool, Get creates one.
// buffer may contain arbitrary data and have any cap <= length.
Get(length int) []byte
// Put adds x to the pool. Caller should not use buffer after
// putting it to pool.
Put(buf []byte)
}
Click to show internal directories.
Click to hide internal directories.