Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidFile = errors.New("invalid file")
Functions ¶
func SaveToFile ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func Open ¶
Open create a new Eagle instance in the target directory and loads existing data from disk.
func (*DB) Close ¶
Close closed the current instance of the db. Any subsequent map operation will no more be synched on disk
func (*DB) ContainsKey ¶
ContainsKey returns true if this map contains a mapping for the specified key.
func (*DB) Get ¶
Get returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
func (*DB) Put ¶
Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value.
type Options ¶
type Options struct { MaxFileSize uint32 MaxTombstoneFileSize uint32 RootDir string FileCompactionThreshold float64 EncryptKey []byte }
func DefaultOptions ¶
DefaultOptions returns a list of recommended options for good performance.
func (*Options) UseEncryption ¶
func (Options) WithEncryptionKey ¶
WithEncryptionKey sets the encryption key which will be used for crypting and decrypting each frame.
func (Options) WithFileCompactionThreshold ¶
WithMaxStaleDataThreshold represents the threshold of stale data above which a bucket is rewritten from scratch. In particular, for a given file f, if staleSize(f) / size(f) > threshold and size(f) > minRewriteFileSize, then a bucket is entirely rewritten, and the old file is discarded.
func (Options) WithMaxFileSize ¶
type ValuePointer ¶
type ValuePointer struct { FileId uint32 // contains filtered or unexported fields }