1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +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

@@ -128,6 +128,7 @@ const (
// FsS3 represents a remote s3 server
type FsS3 struct {
name string // the name of the remote
c *s3.S3 // the connection to the s3 server
bucket string // the bucket we are working on
perm string // permissions for new buckets / objects
@@ -151,6 +152,11 @@ type FsObjectS3 struct {
// ------------------------------------------------------------
// The name of the remote (as passed into NewFs)
func (f *FsS3) Name() string {
return f.name
}
// String converts this FsS3 to a string
func (f *FsS3) String() string {
if f.root == "" {
@@ -235,6 +241,7 @@ func NewFs(name, root string) (fs.Fs, error) {
return nil, err
}
f := &FsS3{
name: name,
c: c,
bucket: bucket,
// FIXME perm: s3.Private, // FIXME need user to specify