fs: Add context to NewFs #3257 #4685

This adds a context.Context parameter to NewFs and related calls.

This is necessary as part of reading config from the context -
backends need to be able to read the global config.
This commit is contained in:
Nick Craig-Wood
2020-11-09 18:05:54 +00:00
parent 30c8b1b84f
commit d846210978
82 changed files with 231 additions and 227 deletions
+1 -3
View File
@@ -165,9 +165,7 @@ var (
)
// NewFs creates a filesystem backed by Tardigrade.
func NewFs(name, root string, m configmap.Mapper) (_ fs.Fs, err error) {
ctx := context.Background()
func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (_ fs.Fs, err error) {
// Setup filesystem and connection to Tardigrade
root = norm.NFC.String(root)
root = strings.Trim(root, "/")