From f04d054b5af406cae676ae81e4ba7baae72e0285 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 10 Dec 2018 09:55:04 +0100 Subject: [PATCH] lib/db: Document current keyspace --- lib/db/keyer.go | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/lib/db/keyer.go b/lib/db/keyer.go index b8f9b523c..e40377e35 100644 --- a/lib/db/keyer.go +++ b/lib/db/keyer.go @@ -21,19 +21,44 @@ const ( ) const ( - KeyTypeDevice = 0 - KeyTypeGlobal = 1 - KeyTypeBlock = 2 + // KeyTypeDevice = FileInfo + KeyTypeDevice = 0 + + // KeyTypeGlobal = VersionList + KeyTypeGlobal = 1 + + // KeyTypeBlock <32 bytes hash> <§file name> = int32 (block index) + KeyTypeBlock = 2 + + // KeyTypeDeviceStatistic = some value KeyTypeDeviceStatistic = 3 + + // KeyTypeFolderStatistic = some value KeyTypeFolderStatistic = 4 - KeyTypeVirtualMtime = 5 - KeyTypeFolderIdx = 6 - KeyTypeDeviceIdx = 7 - KeyTypeIndexID = 8 - KeyTypeFolderMeta = 9 - KeyTypeMiscData = 10 - KeyTypeSequence = 11 - KeyTypeNeed = 12 + + // KeyTypeVirtualMtime = dbMtime + KeyTypeVirtualMtime = 5 + + // KeyTypeFolderIdx = string value + KeyTypeFolderIdx = 6 + + // KeyTypeDeviceIdx = string value + KeyTypeDeviceIdx = 7 + + // KeyTypeIndexID = protocol.IndexID + KeyTypeIndexID = 8 + + // KeyTypeFolderMeta = CountsSet + KeyTypeFolderMeta = 9 + + // KeyTypeMiscData = some value + KeyTypeMiscData = 10 + + // KeyTypeSequence = KeyTypeDevice key + KeyTypeSequence = 11 + + // KeyTypeNeed = + KeyTypeNeed = 12 ) type keyer interface {