feat(storage): Add support for storage plugins

This commit is contained in:
Louis Ruch authored and Timothy Messier committed 2023-05-31 12:18:12 +00:00
1 parent 9ef94892f4
commit 798a1f952a
17 files changed
+253 -138

No files matched your search

+5 -2
View File
@@ -36,7 +36,10 @@ type LoopbackPlugin struct {
*LoopbackStorage
}
// NewLoopbackPlugin returns a new loopback plugin
// NewLoopbackPlugin returns a new loopback pluginre
// For storage service testings NewLoopbackPlugin Supports WithMockErrors
// and WithMockBuckets as options. If no mock buckets are provided,
// a bucket named `default` will be created.
func NewLoopbackPlugin(opt ...TestOption) (*LoopbackPlugin, error) {
opts, err := getTestOpts(opt...)
if err != nil {
@@ -49,7 +52,7 @@ func NewLoopbackPlugin(opt ...TestOption) (*LoopbackPlugin, error) {
hostMap: make(map[string][]*loopbackPluginHostInfo),
},
LoopbackStorage: &LoopbackStorage{
buckets: make(map[BucketName]Bucket),
buckets: map[BucketName]Bucket{"default": {}},
errs: make([]PluginMockError, 0),
},
}