fs: add Optional ID() method to Object and implement it in backends

ID() shows the internal ID of the Object if available.
This commit is contained in:
Nick Craig-Wood
2018-05-13 12:17:55 +01:00
parent 6791cf7d7f
commit 826975c341
9 changed files with 57 additions and 0 deletions
+6
View File
@@ -1422,6 +1422,11 @@ func (o *Object) MimeType() string {
return o.mimeType
}
// ID returns the ID of the Object if known, or "" if not
func (o *Object) ID() string {
return o.id
}
// Check the interfaces are satisfied
var (
_ fs.Fs = &Fs{}
@@ -1431,4 +1436,5 @@ var (
_ fs.ListRer = &Fs{}
_ fs.Object = &Object{}
_ fs.MimeTyper = &Object{}
_ fs.IDer = &Object{}
)