pool

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSize = 16 * 0x400

Variables

This section is empty.

Functions

func GetBuffer

func GetBuffer() *bytes.Buffer

func GetBytes

func GetBytes[T constraints.Integer](size T) []byte

func PutBuffer

func PutBuffer(b *bytes.Buffer)

func PutBytes

func PutBytes(b []byte)

func PutBytesV2

func PutBytesV2(b *Bytes)

Types

type Bytes

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

func GetBytesV2

func GetBytesV2[T constraints.Integer](size T) *Bytes

func NewBytesV2

func NewBytesV2(b []byte) *Bytes

func (*Bytes) After

func (b *Bytes) After(index int) []byte

func (*Bytes) Bytes

func (b *Bytes) Bytes() []byte

func (*Bytes) ResetSize

func (b *Bytes) ResetSize(start, end int)

type Pool

type Pool interface {
	GetBytes(size int) []byte
	PutBytes(b []byte)

	GetBuffer() *bytes.Buffer
	PutBuffer(b *bytes.Buffer)
}
var DefaultPool Pool = &pool{}

type ReverseProxyBuffer

type ReverseProxyBuffer struct{}

func (ReverseProxyBuffer) Get

func (ReverseProxyBuffer) Get() []byte

func (ReverseProxyBuffer) Put

func (ReverseProxyBuffer) Put(b []byte)

Jump to

Keyboard shortcuts

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