-
Notifications
You must be signed in to change notification settings - Fork 34
Description
vfs
is not consistent on how configuration is is passed. We created the vfs.Options
empty interface type but don't explicitly require how to use it and always end up just casting it as the version-specific variant. Some backends don't need configuration at all. Others accept env vars are use a set of chain-able function like WithOptions
or WithClient
.
Though NewFileSystem
isn't enforceable, we should use the functional options system that i've used for various functions like Delete and NewFile.
The Retry
function in the vfs.FileSystem
interface was instituted as a common way to use a retry wrapper. However, it's only ever been implemented to the gs
backend. Other backends have their own internal retry functionality while other have none but either way, Retry in those cases always returns a no-op retrier and is never even called internally. Also it has little to no value externally. Retrier configuration could just as easily be passed either within a backend option or as its own type via the NewFileSystem
functional option.
Proposed
- create a function option interface for NewFileSystem
- implement backend-specific functional options to replace chain-able functions
- deprecate vfs.Options
- deprecate vfs.Retry and related types