pool

package
v0.3.1-rc.10 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 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 (*Bytes) After

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

func (*Bytes) Bytes

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

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