Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferCloser ¶ added in v1.16.0
type BufferCloser struct {
// contains filtered or unexported fields
}
BufferCloser is a light wrapping around the bytes.Buffer that implements a "Close" method to return the buffer to a sync.Pool of buffers.
func NewBufferCloser ¶ added in v1.16.0
func NewBufferCloser() *BufferCloser
NewBufferCloser returns a new BufferCloser from the Buffer pool that has been reset.
func (*BufferCloser) Close ¶ added in v1.16.0
func (b *BufferCloser) Close() error
Close implements io.Closer. This will return the buffer to the buffer pool.
func (*BufferCloser) Read ¶ added in v1.16.0
func (b *BufferCloser) Read(p []byte) (n int, err error)
Read implements io.Reader
type Rereader ¶
type Rereader struct {
// contains filtered or unexported fields
}
Rereader has the ability to read the same io.Reader multiple times. There are currently some limitations to the design:
- Reset MUST be called in order to Re-Read the reader.
- Reset MUST be called after the ReReader is exausted (Read will return an io.EOF error).
- Concurrent reads are not supported.
func NewRereader ¶
NewRereader returns a new re-reader and closer that wraps the given reader. The re-reader consumes the given reader on demand, recording the entire stream so it can be replayed. The re-reader is suitable for retries. The re-reader does not support concurrent consumers, as would be necessary for speculative retries or fanout requests.