Skip to content

Instantly share code, notes, and snippets.

@ncdc
Last active May 17, 2018 16:09
Show Gist options
  • Save ncdc/1e07721200080e9b8b9d66852f0f6877 to your computer and use it in GitHub Desktop.
Save ncdc/1e07721200080e9b8b9d66852f0f6877 to your computer and use it in GitHub Desktop.
// option 1
arkplugin.NewSimpleServer().
RegisterObjectStores(map[string]func() cloudprovider.ObjectStore{
"aws": setupAws,
"azure": azure.NewObjectStore,
"gcp": setupGcp,
}).
RegisterBlockStores(map[string]func() cloudprovider.BlockStore{
"aws": aws.NewBlockStore,
"azure": azure.NewBlockStore,
"gcp": abc,
}).
Serve()
// option 2
arkplugin.NewSimpleServer().
RegisterObjectStore("aws", xxx).
RegisterObjectStore("azure", azure.NewObjectStore).
RegisterObjectStore("gcp", yyy).
RegisterBlockStore("aws", aws.NewBlockStore).
RegisterBlockStore("azure", azure.NewBlockStore).
RegisterBlockStore("gcp": zzz).
Serve()
// option 3
arkplugin.NewSimpleServer().
Register(PluginKindObjectStore, "aws", asdf).
Register(PluginKindObjectStore, "gcp", gdgs).
Serve()
// option 4
arkplugin.NewSimpleServer().
RegisterObjectStores(
"aws", setupAws,
"gcp", setupGcp,
"azure", setupAzure,
).
RegisterBlockStores(
...
).
Serve()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment