Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCantReadFreeSpace is returned when a buffer has 8 bytes preceding it to indicate a // freeSpace map, but the freeSpace map could not be read. ErrCantReadFreeSpace = errors.New("could not read freeSpace") // ErrInsufficientSpace is returned when a buffer does not have enough space to insert the data // it is trying to allocate. ErrInsufficientSpace = errors.New("insufficient free space") )
var ( // ErrBadValueChecksum is returned when a value is read from the value file, but the checksum // stored with the value does not match the calculated checksum of the value read. This is used // as an indicator of file corruption. ErrBadValueChecksum = errors.New("bad value checksum") // ErrBrokenValue is returned when the entire value could not be read from from the value file. // Or when the entire value could not be written to the file. ErrIncompleteValue = errors.New("incomplete value") // ErrCreatingChecksum is returned when a value is being written to the value file but the // checksum could not be created. ErrCreatingChecksum = errors.New("could not create checksum for value") )
Functions ¶
This section is empty.
Types ¶
type CanSync ¶
type CanSync interface {
Sync() error
}
CanSync is used to check if the current IO interface that a file wrapper is using has a method that allows its changes to be flushed to the disk.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is the root object for the database. You can open/create your DB by calling Open().
type Key ¶
type Key []byte
Key represents an array that will NOT have an 8 byte suffix that is used to indicate the transactionId for the item.
type Options ¶
type Options struct { // MaxWALSegmentSize (in bytes) is the largest a single WAL segment file will grow to before a // new segment is started. This does not include the last transaction to be appended to a single // WAL segment. If the last transaction puts the segment over this limit then it will still be // appended (resulting in a large segment) but then a new segment will be created for subsequent // transactions. // Default is 8kb. MaxWALSegmentSize uint64 // MaxValueChunkSize (in byteS) is the largest a single Value file will grow to before a new // file is created. This does not include the last value appended to the value file. // Default is 32kb. MaxValueChunkSize uint64 // WALDirectory is the folder where WAL segment files will be stored. // Default is db/wal. WALDirectory string // DataDirectory is the folder where heap and value files will be stored. // Default is db/data. DataDirectory string // Number of pending writes that can be queued up concurrently before transaction commits will // be blocked. PendingWritesBuffer int }
Options is used to configure how the database will behave.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions just provides a basic configuration which can be passed to open a database.
type ReaderWriterAt ¶
ReaderWriterAt is used as the interface for reading and writing data for the database. It can be used in nearly every IO portion of the database.
type TimestampedKey ¶
type TimestampedKey []byte
TimestampedKey represents a byte array that will always have an 8 byte suffix to indicate the transactionId for the item. This is used to implement MVCC.