Documentation ¶
Overview ¶
Package sqlitefile provides bytes buffers backed by a temporary SQLite table.
Index ¶
- type Buffer
- func (bb *Buffer) Cap() (n int64)
- func (bb *Buffer) Close() error
- func (bb *Buffer) Len() (n int64)
- func (bb *Buffer) Read(p []byte) (n int, err error)
- func (bb *Buffer) ReadByte() (byte, error)
- func (bb *Buffer) Reset()
- func (bb *Buffer) UnreadByte() error
- func (bb *Buffer) Write(p []byte) (n int, err error)
- func (bb *Buffer) WriteByte(c byte) error
- func (bb *Buffer) WriteString(p string) (n int, err error)
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
A Buffer is a variable-sized bytes buffer backed by SQLite blobs.
The bytes are broken into pages, with the first and last pages stored in memory, and intermediate pages loaded into blobs. Unlike a single SQLite blob, a Buffer can grow beyond its initial size. The blobs are allocated in a temporary table.
A Buffer is very similar to a bytes.Buffer.
func NewBufferSize ¶
NewBufferSize creates a Buffer with a specified page size.
func (*Buffer) Cap ¶
Cap returns the number of bytes that have been allocated for this buffer, both in memory as well as in the database.
func (*Buffer) Close ¶
Close releases all resources associated with the file, removing the storage from the database.
func (*Buffer) ReadByte ¶
ReadByte reads a byte from the beginning of the buffer, or returns io.EOF if the buffer is empty.
func (*Buffer) Reset ¶
func (bb *Buffer) Reset()
Reset empties the buffer, but retains the blobs written to the database for future writes.
func (*Buffer) UnreadByte ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a readable, writable, and seekable series of temporary SQLite blobs.
func NewFileSize ¶
NewFileSize creates a new File with the given number of bytes of capacity.
func (*File) Close ¶
Close releases all resources associated with the file, removing the storage from the database.