Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadAllWithBuffer ¶
ReadAllWithBuffer is a fork of https://go.googlesource.com/go/+/go1.16.3/src/io/io.go#626
with a buffer to read into. if the provided buffer is not large enough it will be extended and returned to the caller
func ReadAllWithEstimate ¶
ReadAllWithEstimate is a fork of https://go.googlesource.com/go/+/go1.16.3/src/io/io.go#626
with a starting buffer size. if none is provided it uses the existing default of 512
Types ¶
type BufferedReaderAt ¶ added in v1.5.0
type BufferedReaderAt struct {
// contains filtered or unexported fields
}
BufferedReaderAt implements io.ReaderAt but extends and buffers reads up to the given buffer size. Subsequent reads are returned from the buffers. Additionally it supports concurrent readers by maintaining multiple buffers at different offsets, and matching up reads with existing buffers where possible. When needed the least-recently-used buffer is overwritten with new reads.
func NewBufferedReaderAt ¶ added in v1.5.0
func NewBufferedReaderAt(ra io.ReaderAt, readerSize int64, bufSize, bufCount int) *BufferedReaderAt
type BufferedWriteFlusher ¶ added in v1.5.0
type BufferedWriteFlusher interface { io.WriteCloser Len() int Flush() error }
func NewBufferedWriter ¶ added in v1.5.0
func NewBufferedWriter(w io.Writer) BufferedWriteFlusher
func NewBufferedWriterWithQueue ¶ added in v1.5.0
func NewBufferedWriterWithQueue(w io.Writer) BufferedWriteFlusher
type BufferedWriter ¶ added in v1.5.0
type BufferedWriter struct {
// contains filtered or unexported fields
}
func (*BufferedWriter) Close ¶ added in v1.5.0
func (b *BufferedWriter) Close() error
func (*BufferedWriter) Flush ¶ added in v1.5.0
func (b *BufferedWriter) Flush() error
func (*BufferedWriter) Len ¶ added in v1.5.0
func (b *BufferedWriter) Len() int
type BufferedWriterWithQueue ¶ added in v1.5.0
type BufferedWriterWithQueue struct {
// contains filtered or unexported fields
}
BufferedWriterWithQueue is an attempt at writing an async queue of outgoing data to the underlying writer. As a tradeoff for removing flushes from the hot path, this writer does not provide guarantees about bubbling up errors and takes a best effort approach to signal a failure.
Note: This is not used at the moment due to concerns with error handling when writing async data to the backend.
func (*BufferedWriterWithQueue) Close ¶ added in v1.5.0
func (b *BufferedWriterWithQueue) Close() error
func (*BufferedWriterWithQueue) Flush ¶ added in v1.5.0
func (b *BufferedWriterWithQueue) Flush() error
func (*BufferedWriterWithQueue) Len ¶ added in v1.5.0
func (b *BufferedWriterWithQueue) Len() int