bytespool

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: AGPL-3.0, AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PooledSize int `yaml:"pooled_size" json:"pooled_size"`
}

Config - represent BytesPool Service configurations

type Pool

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

Pool represent pooling of []byte

func New

func New(cfg *Config) *Pool

New create new BytesPool

func (*Pool) GetBuf

func (p *Pool) GetBuf() []byte

GetBuf allocates a new []byte

func (*Pool) PrintBytesPoolStats

func (p *Pool) PrintBytesPoolStats()

PrintBytesPoolStats print statistics about bytes pool

func (*Pool) PutBuf

func (p *Pool) PutBuf(buf []byte)

PutBuf return byte buf to cache

Jump to

Keyboard shortcuts

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