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 ¶
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 ¶
func NewBufferedReaderAt(ra io.ReaderAt, readerSize int64, bufSize, bufCount int) *BufferedReaderAt
type BufferedWriteFlusher ¶
type BufferedWriteFlusher interface { io.WriteCloser Len() int Flush() error }
func NewBufferedWriter ¶
func NewBufferedWriter(w io.Writer) BufferedWriteFlusher
func NewBufferedWriterWithQueue ¶
func NewBufferedWriterWithQueue(w io.Writer) BufferedWriteFlusher
type BufferedWriter ¶
type BufferedWriter struct {
// contains filtered or unexported fields
}
func (*BufferedWriter) Close ¶
func (b *BufferedWriter) Close() error
func (*BufferedWriter) Flush ¶
func (b *BufferedWriter) Flush() error
func (*BufferedWriter) Len ¶
func (b *BufferedWriter) Len() int
type BufferedWriterWithQueue ¶
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 ¶
func (b *BufferedWriterWithQueue) Close() error
func (*BufferedWriterWithQueue) Flush ¶
func (b *BufferedWriterWithQueue) Flush() error
func (*BufferedWriterWithQueue) Len ¶
func (b *BufferedWriterWithQueue) Len() int