base2bufpool

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

func (Buffer) Bytes

func (b Buffer) Bytes() []byte

func (Buffer) Free

func (b Buffer) Free()

func (*Buffer) Shrink

func (b *Buffer) Shrink(newPayloadLen uint)

type NoFitBehavior

type NoFitBehavior uint
const (
	AllocateSmaller NoFitBehavior = 1 << iota
	AllocateLarger

	Allocate NoFitBehavior = AllocateSmaller | AllocateLarger
	Panic    NoFitBehavior = 0
)

func NoFitBehaviorString

func NoFitBehaviorString(s string) (NoFitBehavior, error)

NoFitBehaviorString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func NoFitBehaviorValues

func NoFitBehaviorValues() []NoFitBehavior

NoFitBehaviorValues returns all values of the enum

func (NoFitBehavior) IsANoFitBehavior

func (i NoFitBehavior) IsANoFitBehavior() bool

IsANoFitBehavior returns "true" if the value is listed in the enum definition. "false" otherwise

func (NoFitBehavior) String

func (i NoFitBehavior) String() string

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func New

func New(minShift, maxShift uint, noFitBehavior NoFitBehavior) *Pool

func (*Pool) Get

func (p *Pool) Get(minSize uint) Buffer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL