Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLogFileSize is returned when "opt.LogFileSize" option is not within the valid range. ErrLogFileSize = errors.New("Invalid LogFileSize, must be between 1MB and 2GB") ErrDatabaseClosed = errors.New("Database already closed") ErrEmptyKey = errors.New("Key cannot be empty") ErrKeyNotFound = errors.New("Key not found") ErrFileNotFound = errors.New("File not found") ErrGcWorking = errors.New("Gc is working") )
Functions ¶
func OpenOrCreateFileWithZeroOffset ¶
OpenOrCreateFileWithZeroOffset Opens or create file for path, and seek start.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Get ¶
Get looks for key and returns corresponding Item. If key is not found, ErrKeyNotFound is returned.
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry provides key size, value size, key, value.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is used in hint file.
type Options ¶
type Options struct {
// Directory to store the data in.
Dir string
// Size of single log file.
LogFileSize int64
}
Options are params for creating DB object.
func DefaultOptions ¶
DefaultOptions sets a list of recommended options for good performance. Feel free to modify these to suit your needs.