mirror of
https://github.com/taigrr/bitcask
synced 2025-01-18 04:03:17 -08:00
* 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>
22 lines
384 B
Go
22 lines
384 B
Go
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
|
|
}
|