mirror of
https://github.com/taigrr/bitcask
synced 2025-01-18 04:03:17 -08:00
* get reclaimable space added * import order fix Co-authored-by: yash <yash.chandra@grabpay.com>
23 lines
439 B
Go
23 lines
439 B
Go
package metadata
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/prologic/bitcask/internal"
|
|
)
|
|
|
|
type MetaData struct {
|
|
IndexUpToDate bool `json:"index_up_to_date"`
|
|
ReclaimableSpace int64 `json:"reclaimable_space"`
|
|
}
|
|
|
|
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
|
|
}
|