Documentation ¶
Index ¶
- Constants
- Variables
- func GetBytes(size int) *[]byte
- func GetBytesByContext(context context.Context, size int) *[]byte
- func GetIoBuffer(size int) types.IoBuffer
- func NewBufferPoolContext(ctx context.Context) context.Context
- func NewIoBuffer(capacity int) types.IoBuffer
- func NewIoBufferBytes(bytes []byte) types.IoBuffer
- func NewIoBufferEOF() types.IoBuffer
- func NewIoBufferString(s string) types.IoBuffer
- func PoolContext(ctx context.Context) *bufferValue
- func PutBytes(buf *[]byte)
- func PutIoBuffer(buf types.IoBuffer) error
- func RegisterBuffer(poolCtx types.BufferPoolCtx)
- func TransmitBufferPoolContext(dst context.Context, src context.Context)
- type ByteBufferCtx
- type ByteBufferPoolContainer
- type IoBuffer
- func (b *IoBuffer) Alloc(size int)
- func (b *IoBuffer) Append(data []byte) error
- func (b *IoBuffer) AppendByte(data byte) error
- func (b *IoBuffer) Bytes() []byte
- func (b *IoBuffer) Cap() int
- func (b *IoBuffer) Clone() types.IoBuffer
- func (b *IoBuffer) Count(count int32) int32
- func (b *IoBuffer) Cut(offset int) types.IoBuffer
- func (b *IoBuffer) Drain(offset int)
- func (b *IoBuffer) EOF() bool
- func (b *IoBuffer) Free()
- func (b *IoBuffer) Len() int
- func (b *IoBuffer) Mark()
- func (b *IoBuffer) Peek(n int) []byte
- func (b *IoBuffer) Read(p []byte) (n int, err error)
- func (b *IoBuffer) ReadFrom(r io.Reader) (n int64, err error)
- func (b *IoBuffer) ReadOnce(r io.Reader) (n int64, e error)
- func (b *IoBuffer) Reset()
- func (b *IoBuffer) Restore()
- func (b *IoBuffer) SetEOF(eof bool)
- func (b *IoBuffer) String() string
- func (b *IoBuffer) Write(p []byte) (n int, err error)
- func (b *IoBuffer) WriteString(s string) (n int, err error)
- func (b *IoBuffer) WriteTo(w io.Writer) (n int64, err error)
- type IoBufferPool
- type TempBufferCtx
Constants ¶
View Source
const DefaultSize = 1 << 4
View Source
const MaxRead = 1 << 17
View Source
const MinRead = 1 << 9
View Source
const ResetOffMark = -1
Variables ¶
Functions ¶
func GetBytesByContext ¶
GetBytesByContext returns []byte from byteBufferPool by context
func NewBufferPoolContext ¶
NewBufferPoolContext returns a context with bufferValue
func NewIoBuffer ¶
func NewIoBufferBytes ¶
func NewIoBufferEOF ¶
func NewIoBufferString ¶
func PoolContext ¶
PoolContext returns bufferValue by context
func RegisterBuffer ¶
func RegisterBuffer(poolCtx types.BufferPoolCtx)
Types ¶
type ByteBufferCtx ¶
type ByteBufferCtx struct {
TempBufferCtx
}
func (ByteBufferCtx) New ¶
func (ctx ByteBufferCtx) New() interface{}
func (ByteBufferCtx) Reset ¶
func (ctx ByteBufferCtx) Reset(i interface{})
type ByteBufferPoolContainer ¶
type ByteBufferPoolContainer struct {
// contains filtered or unexported fields
}
type IoBuffer ¶
type IoBuffer struct {
// contains filtered or unexported fields
}
IoBuffer
func (*IoBuffer) AppendByte ¶
type IoBufferPool ¶
type IoBufferPool struct {
// contains filtered or unexported fields
}
IoBufferPool is Iobuffer Pool
type TempBufferCtx ¶
type TempBufferCtx struct {
// contains filtered or unexported fields
}
TempBufferCtx is template for types.BufferPoolCtx
func (*TempBufferCtx) Index ¶
func (t *TempBufferCtx) Index() int
func (*TempBufferCtx) New ¶
func (t *TempBufferCtx) New() interface{}
func (*TempBufferCtx) Reset ¶
func (t *TempBufferCtx) Reset(x interface{})
Click to show internal directories.
Click to hide internal directories.