stacktic
/
dropbox
Archived
1
0
Fork 0

Add support to read modifier data in metadata

This commit is contained in:
Brian Smith 2015-02-14 14:35:36 -08:00 committed by Arnaud Ysmal
parent 285abe6e58
commit 55eb966d46
1 changed files with 21 additions and 14 deletions

View File

@ -157,22 +157,29 @@ func (dbt DBTime) MarshalJSON() ([]byte, error) {
return json.Marshal(time.Time(dbt).Format(DateFormat))
}
// Represents the user who made a change on a particular file
type Modifier struct {
Uid int64 `json:"uid"`
DisplayName string `json:"display_name"`
}
// Entry represents the metadata of a file or folder.
type Entry struct {
Bytes int `json:"bytes,omitempty"` // Size of the file in bytes.
ClientMtime DBTime `json:"client_mtime,omitempty"` // Modification time set by the client when added.
Contents []Entry `json:"contents,omitempty"` // List of children for a directory.
Hash string `json:"hash,omitempty"` // Hash of this entry.
Icon string `json:"icon,omitempty"` // Name of the icon displayed for this entry.
IsDeleted bool `json:"is_deleted,omitempty"` // true if this entry was deleted.
IsDir bool `json:"is_dir,omitempty"` // true if this entry is a directory.
MimeType string `json:"mime_type,omitempty"` // MimeType of this entry.
Modified DBTime `json:"modified,omitempty"` // Date of last modification.
Path string `json:"path,omitempty"` // Absolute path of this entry.
Revision string `json:"rev,omitempty"` // Unique ID for this file revision.
Root string `json:"root,omitempty"` // dropbox or sandbox.
Size string `json:"size,omitempty"` // Size of the file humanized/localized.
ThumbExists bool `json:"thumb_exists,omitempty"` // true if a thumbnail is available for this entry.
Bytes int `json:"bytes,omitempty"` // Size of the file in bytes.
ClientMtime DBTime `json:"client_mtime,omitempty"` // Modification time set by the client when added.
Contents []Entry `json:"contents,omitempty"` // List of children for a directory.
Hash string `json:"hash,omitempty"` // Hash of this entry.
Icon string `json:"icon,omitempty"` // Name of the icon displayed for this entry.
IsDeleted bool `json:"is_deleted,omitempty"` // true if this entry was deleted.
IsDir bool `json:"is_dir,omitempty"` // true if this entry is a directory.
MimeType string `json:"mime_type,omitempty"` // MimeType of this entry.
Modified DBTime `json:"modified,omitempty"` // Date of last modification.
Path string `json:"path,omitempty"` // Absolute path of this entry.
Revision string `json:"rev,omitempty"` // Unique ID for this file revision.
Root string `json:"root,omitempty"` // dropbox or sandbox.
Size string `json:"size,omitempty"` // Size of the file humanized/localized.
ThumbExists bool `json:"thumb_exists,omitempty"` // true if a thumbnail is available for this entry.
Modifier *Modifier `json:"modifier"` // last user to edit the file if in a shared folder
}
// Link for sharing a file.