metadata_database.proto revision f2477e01787aa58f445919b809d89e252beef54f
1// Copyright 2013 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4// 5// Protocol buffer definitions for Drive backend of Syncable FileSystem. 6 7syntax = "proto2"; 8 9option optimize_for = LITE_RUNTIME; 10 11package sync_file_system.drive_backend; 12 13enum FileKind { 14 FILE_KIND_UNSUPPORTED = 0; 15 FILE_KIND_FILE = 1; 16 FILE_KIND_FOLDER = 2; 17} 18 19enum TrackerKind { 20 TRACKER_KIND_REGULAR = 0; 21 TRACKER_KIND_APP_ROOT = 1; 22 TRACKER_KIND_DISABLED_APP_ROOT = 2; 23} 24 25message ServiceMetadata { 26 optional int64 largest_change_id = 1; 27 optional int64 sync_root_tracker_id = 2; 28 29 // The sequence number of FileTrackers. Must be positive. 30 optional int64 next_tracker_id = 3; 31} 32 33// Holds details of file/folder metadata. 34message FileDetails { 35 repeated string parent_folder_ids = 1; 36 37 optional string title = 2; 38 optional FileKind file_kind = 3; 39 optional string md5 = 4; 40 optional string etag = 5; 41 42 // Creation time and modification time of the resource. 43 // Serialized by Time::ToInternalValue. 44 optional int64 creation_time = 6; 45 optional int64 modification_time = 7; 46 47 optional bool missing = 8; 48 optional int64 change_id = 9; 49} 50 51// Represents a server-side file. 52message FileMetadata { 53 // File ID of the remote file/folder which the FileMetadata represents. 54 required string file_id = 1; 55 56 optional FileDetails details = 2; 57} 58 59// Represents synced local file. 60message FileTracker { 61 // A unique sequence number to identify the tracker. Must be positive. 62 required int64 tracker_id = 1; 63 64 // Points the parent tracker in the tracker tree. 0 if there's no parent. 65 required int64 parent_tracker_id = 2; 66 67 required string file_id = 3; 68 69 optional string app_id = 4; 70 optional TrackerKind tracker_kind = 5; 71 72 // Available on an active tracker. 73 // Represents detailed file information on last remote-to-local sync. 74 optional FileDetails synced_details = 6; 75 76 // True if the file is changed since the last update for this file. 77 optional bool dirty = 7; 78 79 // True if the FileTracker is active. 80 // Remote file modification should only be applied to active trackers. 81 // Active FileTracker must have a unique title under its parent. 82 optional bool active = 8; 83 84 // Valid only for folders. 85 // True if the folder contents have not yet been fetched. 86 optional bool needs_folder_listing = 9; 87} 88