Closed cfunkhouser closed 8 years ago
as per table-side discussion, please do away with the validProviders string slice, and implement the awesome register provider and associated magic.
Okay, I've implemented and tested the drive client provider registration logic we discussed around the table.
This gets us some more complexity in the drive module; namely:
RegisterProvider
function, which is meant to be called from the module init() functionValidProvider
function which checks if a provider is registeredNewClient
function - which has the same signature as the per-provider constructor - and creates the new client of the correct provider type based on the Provider
member in the Config
structI've also updated the drive provider modules, and shadeutil.
This change adds an extra check for provider validity at config parse time, and expands the tests. There are no multi-provider tests in this change.