sync

package
v5.16.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: Apache-2.0 Imports: 5 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBufioReader

func GetBufioReader(reader io.Reader) *bufio.Reader

GetBufioReader returns a *bufio.Reader that is managed by a sync.Pool. Returns a bufio.Reader that is reset with reader and ready for use.

After use, the *bufio.Reader should be put back into the sync.Pool by calling PutBufioReader.

func GetByteSlice

func GetByteSlice() *[]byte

GetByteSlice returns a *[]byte that is managed by a sync.Pool. The initial slice length will be 16384 (16kb).

After use, the *[]byte should be put back into the sync.Pool by calling PutByteSlice.

func GetBytesBuffer

func GetBytesBuffer() *bytes.Buffer

GetBytesBuffer returns a *bytes.Buffer that is managed by a sync.Pool. Returns a buffer that is reset and ready for use.

After use, the *bytes.Buffer should be put back into the sync.Pool by calling PutBytesBuffer.

func GetZlibWriter

func GetZlibWriter(w io.Writer) *zlib.Writer

GetZlibWriter returns a *zlib.Writer that is managed by a sync.Pool. Returns a writer that is reset with w and ready for use.

After use, the *zlib.Writer should be put back into the sync.Pool by calling PutZlibWriter.

func PutBufioReader

func PutBufioReader(reader *bufio.Reader)

PutBufioReader puts reader back into its sync.Pool.

func PutByteSlice

func PutByteSlice(buf *[]byte)

PutByteSlice puts buf back into its sync.Pool.

func PutBytesBuffer

func PutBytesBuffer(buf *bytes.Buffer)

PutBytesBuffer puts buf back into its sync.Pool.

func PutZlibReader

func PutZlibReader(z ZLibReader)

PutZlibReader puts z back into its sync.Pool, first closing the reader. The Byte slice dictionary is also put back into its sync.Pool.

func PutZlibWriter

func PutZlibWriter(w *zlib.Writer)

PutZlibWriter puts w back into its sync.Pool.

Types

type ZLibReader

type ZLibReader struct {
	Reader zlibReadCloser
	// contains filtered or unexported fields
}

func GetZlibReader

func GetZlibReader(r io.Reader) (ZLibReader, error)

GetZlibReader returns a ZLibReader that is managed by a sync.Pool. Returns a ZLibReader that is reset using a dictionary that is also managed by a sync.Pool.

After use, the ZLibReader should be put back into the sync.Pool by calling PutZlibReader.

Jump to

Keyboard shortcuts

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

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy