lib/api: Expose blocksHash in file info (#8810)

This adds the BlocksHash field from the FileInfo to our API output. It
can be useful for debugging, or for external tools. I'm intentionally
leaving it as an opaque base64 string because no meaning should be
derived from it: it's just a string.
This commit is contained in:
Jakob Borg
2023-03-06 15:37:15 +01:00
committed by GitHub
parent 3cdcb7dd72
commit ab8e6a82ab
3 changed files with 10 additions and 0 deletions
+1
View File
@@ -1828,6 +1828,7 @@ func fileIntfJSONMap(f protocol.FileIntf) map[string]interface{} {
"localFlags": f.FileLocalFlags(),
"platform": f.PlatformData(),
"inodeChange": f.InodeChangeTime(),
"blocksHash": f.FileBlocksHash(),
}
if f.HasPermissionBits() {
out["permissions"] = fmt.Sprintf("%#o", f.FilePermissions())