1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-02 08:33:50 +00:00

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

This commit is contained in:
Nick Craig-Wood
2015-08-22 16:53:11 +01:00
parent 0c6f816a49
commit fedf81c2b7
8 changed files with 51 additions and 1 deletions

View File

@@ -112,6 +112,7 @@ func init() {
// FsStorage represents a remote storage server
type FsStorage struct {
name string // name of this remote
svc *storage.Service // the connection to the storage server
client *http.Client // authorized client
bucket string // the bucket we are working on
@@ -135,6 +136,11 @@ type FsObjectStorage struct {
// ------------------------------------------------------------
// The name of the remote (as passed into NewFs)
func (f *FsStorage) Name() string {
return f.name
}
// String converts this FsStorage to a string
func (f *FsStorage) String() string {
if f.root == "" {
@@ -171,6 +177,7 @@ func NewFs(name, root string) (fs.Fs, error) {
}
f := &FsStorage{
name: name,
bucket: bucket,
root: directory,
projectNumber: fs.ConfigFile.MustValue(name, "project_number"),