sync
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- func GetBufioReader(reader io.Reader) *bufio.Reader
- func GetByteSlice() *[]byte
- func GetBytesBuffer() *bytes.Buffer
- func GetZlibWriter(w io.Writer) *zlib.Writer
- func PutBufioReader(reader *bufio.Reader)
- func PutByteSlice(buf *[]byte)
- func PutBytesBuffer(buf *bytes.Buffer)
- func PutZlibReader(z ZLibReader)
- func PutZlibWriter(w *zlib.Writer)
- type ZLibReader
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcGetBufioReader¶
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.Poolby calling PutBufioReader.
funcGetByteSlice¶
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.Poolby calling PutByteSlice.
funcGetBytesBuffer¶
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.Poolby calling PutBytesBuffer.
funcGetZlibWriter¶
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.Poolby calling PutZlibWriter.
funcPutBufioReader¶
PutBufioReader puts reader back into its sync.Pool.
funcPutBytesBuffer¶
PutBytesBuffer puts buf back into its sync.Pool.
funcPutZlibReader¶
func PutZlibReader(zZLibReader)
PutZlibReader puts z back into its sync.Pool, first closing the reader.The Byte slice dictionary is also put back into its sync.Pool.
Types¶
typeZLibReader¶
type ZLibReader struct {Reader zlibReadCloser// contains filtered or unexported fields}funcGetZlibReader¶
func GetZlibReader(rio.Reader) (ZLibReader,error)
GetZlibReader returns a ZLibReader that is managed by a sync.Pool.Returns a ZLibReader that is reset using a dictionary that isalso managed by a sync.Pool.
After use, the ZLibReader should be put back into the sync.Poolby calling PutZlibReader.