Add Name() to Fs interface to return name as passed to NewFs

This commit is contained in:
Nick Craig-Wood
2015-08-23 13:36:38 +01:00
parent 0c6f816a49
commit fedf81c2b7
8 changed files with 51 additions and 1 deletions
+7
View File
@@ -74,6 +74,7 @@ func init() {
// FsDrive represents a remote drive server
type FsDrive struct {
name string // name of this remote
svc *drive.Service // the connection to the drive server
root string // the path we are working on
client *http.Client // authorized client
@@ -146,6 +147,11 @@ func (m *dirCache) Flush() {
// ------------------------------------------------------------
// The name of the remote (as passed into NewFs)
func (f *FsDrive) Name() string {
return f.name
}
// String converts this FsDrive to a string
func (f *FsDrive) String() string {
return fmt.Sprintf("Google drive root '%s'", f.root)
@@ -332,6 +338,7 @@ func NewFs(name, path string) (fs.Fs, error) {
}
f := &FsDrive{
name: name,
root: root,
dirCache: newDirCache(),
pacer: make(chan struct{}, 1),