mirror of
https://github.com/restic/restic.git
synced 2026-11-14 06:44:03 +00:00
Store maps in new subdir "maps"
This commit is contained in:
1 parent
b1923063fe
commit
33ce4e33aa
9 files changed
+57
-12
No files matched your search
+12
@@ -6,6 +6,8 @@ import (
|
||||
"errors"
|
||||
"sort"
|
||||
"sync"
|
||||
|
||||
"github.com/fd0/khepri/backend"
|
||||
)
|
||||
|
||||
type BlobList struct {
|
||||
@@ -21,6 +23,16 @@ func NewBlobList() *BlobList {
|
||||
}
|
||||
}
|
||||
|
||||
func LoadBlobList(ch *ContentHandler, id backend.ID) (*BlobList, error) {
|
||||
bl := &BlobList{}
|
||||
err := ch.LoadJSONRaw(backend.Map, id, bl)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return bl, nil
|
||||
}
|
||||
|
||||
func (bl *BlobList) find(blob Blob) (int, Blob, error) {
|
||||
pos := sort.Search(len(bl.list), func(i int) bool {
|
||||
return blob.ID.Compare(bl.list[i].ID) >= 0
|
||||
|
||||
Reference in new issue
Block a user