Documentation
¶
Index ¶
Constants ¶
View Source
const InMemoryDB = "in:mem:db"
InMemoryDB represents a magic value which can be used instead of db path in order to instantiate in memory file system instead of disk
Variables ¶
View Source
var ( // ErrKeyNotFound signifies that the requested key was not found in keydir // This effectively means that the key does not exist in the database itself ErrKeyNotFound = errors.New("gocask: key not found") // ErrPartialWrite signifies that the underlying disk write was not complete, which means // that write was successful but the entry is corrupted and the operation should be retried ErrPartialWrite = errors.New("gocask: key/value pair not fully written") // ErrCRCFailed is thrown upon reading a corrupted value ErrCRCFailed = errors.New("gocask: crc check failed for db entry (value is corrupted)") // ErrInvalidKey is thrown when attempting Get, Put or Delete with an invalid key ErrInvalidKey = errors.New("gocask: key should not be empty or nil") // ErrInvalidValue is thrown when attempting to store a nil value ErrInvalidValue = errors.New("gocask: value should not be nil") )
View Source
var DefaultConfig = Config{
MaxDataFileSize: 1024 * 1024 * 1024 * 2,
DataDir: "./",
}
DefaultConfig represents default gocask config
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents bitcask db implementation
func (*DB) Delete ¶
Delete deletes a key/value pair if it exists or reports key not found error if the key does not exist
type FS ¶
type FS interface { // Open should open the active data file for the given db path Open(string) (File, error) // Rotate should generate and open new data file for the given db path Rotate(string) (File, error) // Walk should walk through all data files for the given db path Walk(string, func(File) error) error // ReadFileAt should read a chunk of named path data file at the given offset ReadFileAt(string, string, []byte, int64) (int, error) }
FS represents a file system interface
Click to show internal directories.
Click to hide internal directories.