bufferedwriter

package
v1.101.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Put

func Put(bw *Writer)

Put returns back bw to the pool.

bw cannot be used after returning to the pool.

Types

type Writer

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

Writer is buffered writer, which may be used in order to reduce overhead when sending moderately big responses to http server.

Writer methods can be called from concurrently running goroutines. The writer remembers the first occurred error, which can be inspected with Error method.

func Get

func Get(w io.Writer) *Writer

Get returns buffered writer for the given w.

The writer must be returned to the pool after use by calling Put().

func (*Writer) Error

func (bw *Writer) Error() error

Error returns the first occurred error in bw.

func (*Writer) Flush

func (bw *Writer) Flush() error

Flush flushes bw to the underlying writer.

func (*Writer) Write

func (bw *Writer) Write(p []byte) (int, error)

Write writes p to bw.

Jump to

Keyboard shortcuts

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