Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedReader ¶
type CachedReader struct {
// contains filtered or unexported fields
}
CachedReader provides a cache support for up to the first cacheSize bytes on top of the UpstreamReader.
func NewCachedReader ¶
func NewCachedReader(ctx context.Context, rd UpstreamReader) *CachedReader
NewCachedReader returns a new CachedReader for upstream rd.
func (*CachedReader) Read ¶
func (r *CachedReader) Read(p []byte) (int, error)
Read reads len(p) bytes of packed results from the current offset.
func (*CachedReader) ReadAt ¶
func (r *CachedReader) ReadAt(p []byte, off int64) (int, error)
ReadAt reads len(p) bytes of packed results from offset off.
func (*CachedReader) ResultSet ¶
func (r *CachedReader) ResultSet() resultset.ResultSet
ResultSet returns the upstream ResultSet.
type UpstreamReader ¶
type UpstreamReader interface { io.ReadSeeker io.ReaderAt // ResultSet returns the upstream result set. ResultSet() resultset.ResultSet }
UpstreamReader is the reader CachedReader reads from.
Click to show internal directories.
Click to hide internal directories.