lib/db: Document current keyspace

This commit is contained in:
Jakob Borg 2018-12-10 09:55:04 +01:00
parent 132789785d
commit f04d054b5a

View File

@ -21,18 +21,43 @@ const (
) )
const ( const (
// KeyTypeDevice <int32 folder ID> <int32 device ID> <file name> = FileInfo
KeyTypeDevice = 0 KeyTypeDevice = 0
// KeyTypeGlobal <int32 folder ID> <file name> = VersionList
KeyTypeGlobal = 1 KeyTypeGlobal = 1
// KeyTypeBlock <int32 folder ID> <32 bytes hash> <§file name> = int32 (block index)
KeyTypeBlock = 2 KeyTypeBlock = 2
// KeyTypeDeviceStatistic <device ID as string> <some string> = some value
KeyTypeDeviceStatistic = 3 KeyTypeDeviceStatistic = 3
// KeyTypeFolderStatistic <folder ID as string> <some string> = some value
KeyTypeFolderStatistic = 4 KeyTypeFolderStatistic = 4
// KeyTypeVirtualMtime <int32 folder ID> <file name> = dbMtime
KeyTypeVirtualMtime = 5 KeyTypeVirtualMtime = 5
// KeyTypeFolderIdx <int32 id> = string value
KeyTypeFolderIdx = 6 KeyTypeFolderIdx = 6
// KeyTypeDeviceIdx <int32 id> = string value
KeyTypeDeviceIdx = 7 KeyTypeDeviceIdx = 7
// KeyTypeIndexID <int32 device ID> <int32 folder ID> = protocol.IndexID
KeyTypeIndexID = 8 KeyTypeIndexID = 8
// KeyTypeFolderMeta <int32 folder ID> = CountsSet
KeyTypeFolderMeta = 9 KeyTypeFolderMeta = 9
// KeyTypeMiscData <some string> = some value
KeyTypeMiscData = 10 KeyTypeMiscData = 10
// KeyTypeSequence <int32 folder ID> <int64 sequence number> = KeyTypeDevice key
KeyTypeSequence = 11 KeyTypeSequence = 11
// KeyTypeNeed <int32 folder ID> <file name> = <nothing>
KeyTypeNeed = 12 KeyTypeNeed = 12
) )