mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-13 02:00:27 +01:00
Remove duplicate check
This commit is contained in:
parent
4e04cb9926
commit
6362b322c2
@ -2,7 +2,6 @@ package dropbox
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -29,23 +28,19 @@ type Config struct {
|
|||||||
|
|
||||||
// NewStorageBackend creates and initializes a new Dropbox storage backend.
|
// NewStorageBackend creates and initializes a new Dropbox storage backend.
|
||||||
func NewStorageBackend(opts Config, logFunc storage.Log) (storage.Backend, error) {
|
func NewStorageBackend(opts Config, logFunc storage.Log) (storage.Backend, error) {
|
||||||
if opts.Token == "" {
|
config := dropbox.Config{
|
||||||
return nil, errors.New("NewStorageBackend: No Dropbox token has been provided")
|
Token: opts.Token,
|
||||||
} else {
|
|
||||||
config := dropbox.Config{
|
|
||||||
Token: opts.Token,
|
|
||||||
}
|
|
||||||
|
|
||||||
client := files.New(config)
|
|
||||||
|
|
||||||
return &dropboxStorage{
|
|
||||||
StorageBackend: &storage.StorageBackend{
|
|
||||||
DestinationPath: opts.RemotePath,
|
|
||||||
Log: logFunc,
|
|
||||||
},
|
|
||||||
client: client,
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client := files.New(config)
|
||||||
|
|
||||||
|
return &dropboxStorage{
|
||||||
|
StorageBackend: &storage.StorageBackend{
|
||||||
|
DestinationPath: opts.RemotePath,
|
||||||
|
Log: logFunc,
|
||||||
|
},
|
||||||
|
client: client,
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name returns the name of the storage backend
|
// Name returns the name of the storage backend
|
||||||
|
Loading…
Reference in New Issue
Block a user