refactor(storage): read from local disk for putObject

This commit is contained in:
Damian Debkowski authored and Timothy Messier committed 2023-05-31 12:18:15 +00:00
1 parent 7263d08bc5
commit 39a07252b6
10 files changed
+471 -1213

No files matched your search

+12 -1
View File
@@ -35,6 +35,7 @@ type TestOption func(*TestOptions) error
type TestOptions struct {
withMockBuckets map[BucketName]Bucket
withMockError []PluginMockError
withChunkSize int
}
// getTestOpts - iterate the inbound Options and return a struct
@@ -49,7 +50,9 @@ func getTestOpts(opt ...TestOption) (TestOptions, error) {
}
func getDefaultTestOptions() TestOptions {
return TestOptions{}
return TestOptions{
withChunkSize: 8,
}
}
// WithMockBuckets provides an option to create mocked external object store buckets.
@@ -67,3 +70,11 @@ func WithMockError(err PluginMockError) TestOption {
return nil
}
}
// WithChunkSize provides an option to set the chunkSize used for grpc streams.
func WithChunkSize(size int) TestOption {
return func(o *TestOptions) error {
o.withChunkSize = size
return nil
}
}