internal

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBuffer

func GetBuffer() *bytes.Buffer

GetBuffer gets a Buffer from the pool.

func Itoa

func Itoa(w *bytes.Buffer, i uint)

Itoa writes the string representation of an int to a Buffer.

func PutBuffer

func PutBuffer(b *bytes.Buffer)

PutBuffer resets a Buffer and puts it back into the pool.

Types

type SerializedWriter

type SerializedWriter struct {
	sync.Mutex
	io.Writer
}

SerializedWriter is a wrapper to guarantee serialized access to the inner Writer.

func NewSerializedWriter

func NewSerializedWriter(w io.Writer) *SerializedWriter

NewSerializedWriter creates a new SerializedWriter using w as the inner Writer.

func (*SerializedWriter) Write

func (o *SerializedWriter) Write(b []byte) (int, error)

Write writes to the inner Writer. Concurrent calls to Write will block so that only one at a time is writing to the inner Writer.

Jump to

Keyboard shortcuts

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