mirror of
https://github.com/taigrr/bitcask
synced 2025-01-18 04:03:17 -08:00
local live backup support (#185)
* 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>
This commit is contained in:
21
internal/metadata/metadata.go
Normal file
21
internal/metadata/metadata.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package metadata
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/prologic/bitcask/internal"
|
||||
)
|
||||
|
||||
type MetaData struct {
|
||||
IndexUpToDate bool `json:"index_up_to_date"`
|
||||
}
|
||||
|
||||
func (m *MetaData) Save(path string, mode os.FileMode) error {
|
||||
return internal.SaveJsonToFile(m, path, mode)
|
||||
}
|
||||
|
||||
func Load(path string) (*MetaData, error) {
|
||||
var m MetaData
|
||||
err := internal.LoadFromJsonFile(path, &m)
|
||||
return &m, err
|
||||
}
|
||||
Reference in New Issue
Block a user