sync

package
v2.103.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 3 Imported by: 0

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

func (p *BufferPool) Copy(buffer *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(buffer *bytes.Buffer)

Put the buffer back.

type Mutex

type Mutex = sync.Mutex

Mutex is an alias of sync.Mutex.

type Pool

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

Pool of type T.

func NewPool

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

NewPool of type T.

func (*Pool[T]) Get

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

Get an item of type T.

func (*Pool[T]) Put

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

Put an item of type T back.

type RWMutex

type RWMutex = sync.RWMutex

RWMutex is an alias of sync.RWMutex.

Jump to

Keyboard shortcuts

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