pool

package
v3.11.38 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytePool added in v3.10.93

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

func NewBytePool added in v3.10.82

func NewBytePool(size int) *BytePool

func (*BytePool) Cap added in v3.10.93

func (p *BytePool) Cap() int

func (*BytePool) Get added in v3.10.93

func (p *BytePool) Get() *[]byte

func (*BytePool) Put added in v3.10.93

func (p *BytePool) Put(b *[]byte)

func (*BytePool) Stats added in v3.10.93

func (p *BytePool) Stats() Stats

type BytesPool added in v3.10.93

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

func NewBytesPool added in v3.10.82

func NewBytesPool(size int) *BytesPool

func (*BytesPool) Cap added in v3.10.93

func (p *BytesPool) Cap() int

func (*BytesPool) Get added in v3.10.93

func (p *BytesPool) Get() *bytes.Buffer

func (*BytesPool) Put added in v3.10.93

func (p *BytesPool) Put(b *bytes.Buffer)

func (*BytesPool) Stats added in v3.10.93

func (p *BytesPool) Stats() Stats

type Pool

type Pool[T any] struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool[T any](fn func() T) Pool[T]

func (Pool[T]) Get

func (p Pool[T]) Get() T

func (Pool[T]) Put

func (p Pool[T]) Put(t T)

type Stats added in v3.10.93

type Stats struct {
	Get uint64
	Put uint64
	Mis uint64
	Ret uint64
}

Stats struct

type Statser added in v3.10.93

type Statser interface {
	Stats() Stats
	Cap() int
}

Statser provides buffer pool stats

type StringsPool added in v3.10.93

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

func NewStringsPool added in v3.10.93

func NewStringsPool(size int) *StringsPool

func (*StringsPool) Cap added in v3.10.93

func (p *StringsPool) Cap() int

func (*StringsPool) Get added in v3.10.93

func (p *StringsPool) Get() *strings.Builder

func (*StringsPool) Put added in v3.10.93

func (p *StringsPool) Put(b *strings.Builder)

func (*StringsPool) Stats added in v3.10.93

func (p *StringsPool) Stats() Stats

Jump to

Keyboard shortcuts

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