sync

package
v1.409.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

This section is empty.

Types

type BufferPool

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

BufferPool for sync.

func NewBufferPool

func NewBufferPool() *BufferPool

NewBufferPool for sync.

func (*BufferPool) Copy added in v1.391.0

func (p *BufferPool) Copy(b *bytes.Buffer) []byte

Copy the buffer to a []byte.

func (*BufferPool) Get

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

Get a new buffer.

func (*BufferPool) Put

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

Put the buffer back.

type Pool added in v1.391.0

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

Pool of type T.

func NewPool added in v1.391.0

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

NewPool of type T.

func (*Pool[T]) Get added in v1.391.0

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

Get an item of type T.

func (*Pool[T]) Put added in v1.391.0

func (p *Pool[T]) Put(b *T)

Put an item of type T back.

Jump to

Keyboard shortcuts

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