Documentation ¶
Index ¶
- Variables
- func NewAllocError(target string) error
- func WithLimit(limit int64) option.AnyOption
- type AllocError
- type AtomicRef
- type Buffer
- func (b *Buffer) AddRef()
- func (b *Buffer) Alloc(size uint) *Data
- func (b *Buffer) Get() []byte
- func (b *Buffer) Release() bool
- func (b *Buffer) Remain() uint
- func (b *Buffer) SetOnReleased(onReleased func(*Buffer)) *Buffer
- func (b *Buffer) Size() uint
- func (b *Buffer) Unused() []byte
- func (b *Buffer) Use() *Buffer
- func (b *Buffer) Used() []byte
- type BufferPool
- type Data
- func (d *Data) AddRef()
- func (d *Data) Cap() uint
- func (d *Data) Compare(o []byte) int
- func (d *Data) Contains(sub []byte) bool
- func (d *Data) ContainsAny(chars string) bool
- func (d *Data) ContainsRune(r rune) bool
- func (d *Data) CopyFrom(off uint, b []byte) int
- func (d *Data) CopyStringFrom(off uint, s string) int
- func (d *Data) Count(sep []byte) int
- func (d *Data) Cut(start uint, end uint) *Data
- func (d *Data) CutCap(start, end, cap uint) *Data
- func (d *Data) CutCapTo(end, cap uint) *Data
- func (d *Data) CutFrom(start uint) *Data
- func (d *Data) CutTo(end uint) *Data
- func (d *Data) Equal(o []byte) bool
- func (d *Data) Get(i uint) byte
- func (d *Data) HasPrefix(prefix []byte) bool
- func (d *Data) HasSuffix(suffix []byte) bool
- func (d *Data) IndexAny(chars string) int
- func (d *Data) IndexByte(c byte) int
- func (d *Data) IndexRune(r rune) int
- func (d *Data) LastIndex(sep []byte) int
- func (d *Data) LastIndexAny(chars string) int
- func (d *Data) LastIndexByte(c byte) int
- func (d *Data) Len() uint
- func (d *Data) LittleUint16(off uint) uint16
- func (d *Data) LittleUint32(off uint) uint32
- func (d *Data) LittleUint64(off uint) uint64
- func (d *Data) PutLittleUint16(off uint, v uint16) *Data
- func (d *Data) PutLittleUint32(off uint, v uint32) *Data
- func (d *Data) PutLittleUint64(off uint, v uint64) *Data
- func (d *Data) PutUint16(off uint, v uint16) *Data
- func (d *Data) PutUint32(off uint, v uint32) *Data
- func (d *Data) PutUint64(off uint, v uint64) *Data
- func (d *Data) Release() bool
- func (d *Data) String() string
- func (d *Data) Uint16(off uint) uint16
- func (d *Data) Uint32(off uint) uint32
- func (d *Data) Uint64(off uint) uint64
- func (d *Data) Use() *Data
- type DataPool
- type DefaultBufferPool
- type DynamicDataPool
- type InvalidReferenceError
- type Pool
- type PoolProvider
- type Reference
- type Relations
- type RelationsReference
- type RingBufferPool
- type SlicePool
- type StackPool
- type StaticDataPool
- type SwapPool
- type SyncPool
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugLogger = assert.Must(log.Config{ Level: log.NewAtomicLevelAt(log.DebugLevel), Encoder: log.NewConsoleEncoder(log.ConsoleEncoderConfig{ EncodeLevel: log.CapitalColorLevelEncoder, }), }.Build())
Functions ¶
func NewAllocError ¶
Types ¶
type AllocError ¶
type AllocError struct {
Target string
}
func (AllocError) Error ¶
func (e AllocError) Error() string
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func (*Buffer) SetOnReleased ¶
type BufferPool ¶
type Data ¶
func (*Data) ContainsAny ¶
func (*Data) ContainsRune ¶
func (*Data) LastIndexAny ¶
func (*Data) LastIndexByte ¶
func (*Data) LittleUint16 ¶
func (*Data) LittleUint32 ¶
func (*Data) LittleUint64 ¶
type DefaultBufferPool ¶
type DefaultBufferPool struct {
// contains filtered or unexported fields
}
func NewDefaultBufferPool ¶
func NewDefaultBufferPool(size uint, reversed uint, poolProvider PoolProvider[*Buffer], poolOptions ...option.AnyOption) *DefaultBufferPool
func (*DefaultBufferPool) Alloc ¶
func (p *DefaultBufferPool) Alloc(size uint) *Data
func (*DefaultBufferPool) Get ¶
func (p *DefaultBufferPool) Get() []byte
type DynamicDataPool ¶
type DynamicDataPool struct {
// contains filtered or unexported fields
}
func NewDynamicDataPool ¶
func NewDynamicDataPool(pools ...*StaticDataPool) *DynamicDataPool
func NewDynamicDataPoolWithExp ¶
func NewDynamicDataPoolWithExp(min, max uint, poolProvider PoolProvider[*Data], poolOptions ...option.AnyOption) *DynamicDataPool
func NewDynamicDataPoolWithThresholds ¶
func NewDynamicDataPoolWithThresholds(thresholds []int, poolProvider PoolProvider[*Data], poolOptions ...option.AnyOption) *DynamicDataPool
func (*DynamicDataPool) Alloc ¶
func (p *DynamicDataPool) Alloc(len uint) *Data
func (*DynamicDataPool) AllocCap ¶
func (p *DynamicDataPool) AllocCap(len, cap uint) *Data
type InvalidReferenceError ¶
func NewInvalidReferenceError ¶
func NewInvalidReferenceError(cur, last int64) InvalidReferenceError
func (InvalidReferenceError) Error ¶
func (e InvalidReferenceError) Error() string
type PoolProvider ¶
func StackPoolProvider ¶
func StackPoolProvider[O any](size uint) PoolProvider[O]
type Relations ¶
type Relations struct { AtomicRef // contains filtered or unexported fields }
func (*Relations) AddRelation ¶
type RelationsReference ¶
type RingBufferPool ¶
type RingBufferPool struct {
// contains filtered or unexported fields
}
func NewRingBufferPool ¶
func NewRingBufferPool(count uint, size uint, reversed uint) *RingBufferPool
func (*RingBufferPool) Alloc ¶
func (p *RingBufferPool) Alloc(size uint) *Data
func (*RingBufferPool) Get ¶
func (p *RingBufferPool) Get() []byte
type SlicePool ¶
type SlicePool[O any] struct { // contains filtered or unexported fields }
func NewSlicePool ¶
type StackPool ¶
type StackPool[O any] struct { // contains filtered or unexported fields }
func NewStackPool ¶
type StaticDataPool ¶
type StaticDataPool struct {
// contains filtered or unexported fields
}
func NewStaticDataPool ¶
func NewStaticDataPool(size uint, poolProvider PoolProvider[*Data], poolOptions ...option.AnyOption) *StaticDataPool
func (*StaticDataPool) Alloc ¶
func (p *StaticDataPool) Alloc(len uint) (d *Data)
func (*StaticDataPool) AllocCap ¶
func (p *StaticDataPool) AllocCap(len, cap uint) (d *Data)
func (*StaticDataPool) Size ¶
func (p *StaticDataPool) Size() uint
type SyncPool ¶
type SyncPool[O any] struct { // contains filtered or unexported fields }
func NewSyncPool ¶
Click to show internal directories.
Click to hide internal directories.