* live backup first commit
* exclude lock file in backup
* create path if not exist for backup
Co-authored-by: yash <yash.chandra@grabpay.com>
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
* Add configuration options for FileMode
Add two additional configuration values, and their corresponding default values:
* DirFileModeBeforeUmask - Dir FileMode is used on all directories created. DefaultDirFileModeBeforeUmask is 0700.
* FileFileModeBeforeUmask - File FileMode is used on all files created, except for the "lock" file (managed by the Flock library). DefaultFileFileModeBeforeUmask is 0600.
When using these bits of configuration, keep in mind these FileMode values are set BEFORE any umask rules are applied. For example, if the user's umask is 022, setting DirFileFileModeBeforeUmask to 777 will result in directories with FileMode set to 755 (this umask prevents the write bit from being applied to group and world permissions).
* moving defer statements after checking for errors
use os.ModePerm const instead of os.FileMode(777)
* fix spelling/grammar
* skip these tests for Windows as they appear to break - Windows is less POSIX-y than it claims
* ignore "lock" file for default case too -- this was incorrectly passing before including this, as my local dev station has umask 022
* internal/data: comment exported functions
* internal/data: make smaller codec exported api surface
* make key and value sizes serializing bubble up to everything
* Makefile setup & go mod tidy
* Add Unit Test for testing a corrupted config
* Add Unit Test for testing errors from .Stats()
* Refactor Datafile into an interface and add Unit Tests for testing Merge() errors
* Refactor indexer into an interface and add Unit Tests for .Close() errors
* Add Unit Tests for .Delete() errors
* Add Unit Tests for testing Put/Get errors
* Add Unit Test for testing Open errors (bad path for example)
* Refactor out bitcask.writeConfig
* Add more tests for config errors
* Add unit test for options that might error
* Add more test cases for close errors
* Add test case for rotating datafiles
* Fix a possible data race in .Stats()
* Add test case for checksum errors
* Add test case for Sync errors with Put and WithSync enabled
* Refactor and use testify.mock for mocks and generate mocks for all interfaces
* Refactor TestCloseErrors
* Refactored TestDeleteErrors
* Refactored TestGetErrors
* Refactored TestPutErrors
* Refactored TestMergeErrors and fixed a bug with .Fold()
* Add test case for Scan() errors
* Apparently only Scan() can return nil Node()s?
* Add Unit Test for testing WithSync() option
* Add Unit Test for testing re-indexing
* Add Unit Test for testing re-indexing with deleted keys (tombstone values)
* avoid unnecessary use of encoder/decoder to decrease memory allocations
* add an optional configurable mempool to avoid extra allocs
* add doc.go with examples
* Added new API Stats() and Prune()
* Improved Merge() logic to also prune old key/values and actually reclaim disk space
* Added backward compat for the old Merge() function
* Refactor indexing of keys to items (hints)
* Remove redundant TestOpenMerge
* Add unit test for Stats()
* Improve TestMerge()