From de73063977e54616d259eccb90cfcb76531a2dab Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 20 Oct 2016 17:46:51 +0100 Subject: [PATCH] Fix output of crypt objects in logs --- cmd/mount/createinfo.go | 5 +++++ fs/fs.go | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cmd/mount/createinfo.go b/cmd/mount/createinfo.go index babc0c259..ea5ad9e73 100644 --- a/cmd/mount/createinfo.go +++ b/cmd/mount/createinfo.go @@ -26,6 +26,11 @@ func (ci *createInfo) Fs() fs.Info { return ci.f } +// String returns the remote path +func (ci *createInfo) String() string { + return ci.remote +} + // Remote returns the remote path func (ci *createInfo) Remote() string { return ci.remote diff --git a/fs/fs.go b/fs/fs.go index 48840b90c..ea7d00340 100644 --- a/fs/fs.go +++ b/fs/fs.go @@ -165,9 +165,6 @@ type Info interface { type Object interface { ObjectInfo - // String returns a description of the Object - String() string - // SetModTime sets the metadata on the object to set the modification date SetModTime(time.Time) error @@ -199,6 +196,9 @@ type ObjectInfo interface { // BasicInfo common interface for Dir and Object providing the very // basic attributes of an object. type BasicInfo interface { + // String returns a description of the Object + String() string + // Remote returns the remote path Remote() string @@ -357,6 +357,11 @@ type Dir struct { Count int64 // number of objects -1 for unknown } +// String returns the name +func (d *Dir) String() string { + return d.Name +} + // Remote returns the remote path func (d *Dir) Remote() string { return d.Name @@ -523,6 +528,7 @@ type staticObjectInfo struct { func (i *staticObjectInfo) Fs() Info { return i.fs } func (i *staticObjectInfo) Remote() string { return i.remote } +func (i *staticObjectInfo) String() string { return i.remote } func (i *staticObjectInfo) ModTime() time.Time { return i.modTime } func (i *staticObjectInfo) Size() int64 { return i.size } func (i *staticObjectInfo) Storable() bool { return i.storable }