summaryrefslogtreecommitdiffstats
path: root/lib/db/keyer.go
diff options
context:
space:
mode:
authorJakob Borg <jakob@kastelo.net>2018-12-10 09:55:04 +0100
committerJakob Borg <jakob@kastelo.net>2018-12-10 09:55:21 +0100
commitf04d054b5af406cae676ae81e4ba7baae72e0285 (patch)
tree7f40ed05c5c586886f6551bd366db6d59dce09b6 /lib/db/keyer.go
parent132789785d1bddf750b81a7ef86b9b54055bffc1 (diff)
lib/db: Document current keyspace
Diffstat (limited to 'lib/db/keyer.go')
-rw-r--r--lib/db/keyer.go47
1 files changed, 36 insertions, 11 deletions
diff --git a/lib/db/keyer.go b/lib/db/keyer.go
index b8f9b523c1..e40377e357 100644
--- a/lib/db/keyer.go
+++ b/lib/db/keyer.go
@@ -21,19 +21,44 @@ const (
)
const (
- KeyTypeDevice = 0
- KeyTypeGlobal = 1
- KeyTypeBlock = 2
+ // KeyTypeDevice <int32 folder ID> <int32 device ID> <file name> = FileInfo
+ KeyTypeDevice = 0
+
+ // KeyTypeGlobal <int32 folder ID> <file name> = VersionList
+ KeyTypeGlobal = 1
+
+ // KeyTypeBlock <int32 folder ID> <32 bytes hash> <§file name> = int32 (block index)
+ KeyTypeBlock = 2
+
+ // KeyTypeDeviceStatistic <device ID as string> <some string> = some value
KeyTypeDeviceStatistic = 3
+
+ // KeyTypeFolderStatistic <folder ID as string> <some string> = some value
KeyTypeFolderStatistic = 4
- KeyTypeVirtualMtime = 5
- KeyTypeFolderIdx = 6
- KeyTypeDeviceIdx = 7
- KeyTypeIndexID = 8
- KeyTypeFolderMeta = 9
- KeyTypeMiscData = 10
- KeyTypeSequence = 11
- KeyTypeNeed = 12
+
+ // KeyTypeVirtualMtime <int32 folder ID> <file name> = dbMtime
+ KeyTypeVirtualMtime = 5
+
+ // KeyTypeFolderIdx <int32 id> = string value
+ KeyTypeFolderIdx = 6
+
+ // KeyTypeDeviceIdx <int32 id> = string value
+ KeyTypeDeviceIdx = 7
+
+ // KeyTypeIndexID <int32 device ID> <int32 folder ID> = protocol.IndexID
+ KeyTypeIndexID = 8
+
+ // KeyTypeFolderMeta <int32 folder ID> = CountsSet
+ KeyTypeFolderMeta = 9
+
+ // KeyTypeMiscData <some string> = some value
+ KeyTypeMiscData = 10
+
+ // KeyTypeSequence <int32 folder ID> <int64 sequence number> = KeyTypeDevice key
+ KeyTypeSequence = 11
+
+ // KeyTypeNeed <int32 folder ID> <file name> = <nothing>
+ KeyTypeNeed = 12
)
type keyer interface {