lib/config, lib/fs: Make junction behaviour configurable (ref #6606) (#6907)

This commit is contained in:
Simon Frei
2020-08-19 19:58:51 +02:00
committed by GitHub
parent ce4d149bf5
commit fc2c46e82f
11 changed files with 49 additions and 17 deletions
+5 -3
View File
@@ -178,13 +178,15 @@ var IsPermission = os.IsPermission
// IsPathSeparator is the equivalent of os.IsPathSeparator
var IsPathSeparator = os.IsPathSeparator
func NewFilesystem(fsType FilesystemType, uri string) Filesystem {
type Option func(Filesystem)
func NewFilesystem(fsType FilesystemType, uri string, opts ...Option) Filesystem {
var fs Filesystem
switch fsType {
case FilesystemTypeBasic:
fs = newBasicFilesystem(uri)
fs = newBasicFilesystem(uri, opts...)
case FilesystemTypeFake:
fs = newFakeFilesystem(uri)
fs = newFakeFilesystem(uri, opts...)
default:
l.Debugln("Unknown filesystem", fsType, uri)
fs = &errorFilesystem{