Change DB label format (index folders, devices)

This commit is contained in:
Jakob Borg
2016-01-03 19:08:19 +01:00
parent 18ae87962d
commit ac190b2e39
14 changed files with 522 additions and 125 deletions

View File

@@ -7,6 +7,7 @@
package db
import (
"encoding/binary"
"fmt"
"time"
)
@@ -24,10 +25,12 @@ type VirtualMtimeRepo struct {
}
func NewVirtualMtimeRepo(ldb *Instance, folder string) *VirtualMtimeRepo {
prefix := string(KeyTypeVirtualMtime) + folder
var prefix [5]byte // key type + 4 bytes folder idx number
prefix[0] = KeyTypeVirtualMtime
binary.BigEndian.PutUint32(prefix[1:], ldb.folderIdx.ID([]byte(folder)))
return &VirtualMtimeRepo{
ns: NewNamespacedKV(ldb, prefix),
ns: NewNamespacedKV(ldb, string(prefix[:])),
}
}