Documentation ¶
Overview ¶
Package cache includes a struct for caching reads.
Index ¶
- type Cache
- func (c *Cache) Close() error
- func (c *Cache) Read(p []byte) (n int, err error)
- func (c *Cache) ReadAll() ([]byte, error)
- func (c *Cache) ReadAllAndClose() ([]byte, error)
- func (c *Cache) ReadAt(i int) (byte, error)
- func (c *Cache) ReadByte() (byte, error)
- func (c *Cache) ReadBytes(delim byte) ([]byte, error)
- func (c *Cache) ReadFirst() (byte, error)
- func (c *Cache) ReadRange(start int, end int) ([]byte, error)
- func (c *Cache) ReadString(delim byte) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Reader io.ByteReadCloser Cursor int Complete *bool Content *[]byte }
func NewCache ¶
func NewCache(r io.ByteReadCloser) *Cache
func NewCacheWithContent ¶
func NewCacheWithContent(r io.ByteReadCloser, c *[]byte, i int) *Cache
func (*Cache) Read ¶
Read reads a maximum len(p) bytes from the reader and returns an error, if any.
func (*Cache) ReadAll ¶
ReadAll reads all content from the underlying reader and returns the content
func (*Cache) ReadAllAndClose ¶
Click to show internal directories.
Click to hide internal directories.