feat(storage): Define interface for creating temporary files
This provides a new type for a temporary file and a method on a RecordingStorage to create temporary files. Temporary files will get removed when closed.
This commit is contained in:
1 file changed
+8
@@ -23,6 +23,8 @@ type RecordingStorage interface {
|
||||
|
||||
// PluginClients returns a map of storage plugin clients keyed on the plugin name.
|
||||
PluginClients() map[string]plgpb.StoragePluginServiceClient
|
||||
|
||||
CreateTemp(ctx context.Context, p string) (TempFile, error)
|
||||
}
|
||||
|
||||
// Bucket is a resource that represents a bucket in an external object store
|
||||
@@ -54,3 +56,9 @@ type File interface {
|
||||
io.Writer
|
||||
io.StringWriter
|
||||
}
|
||||
|
||||
// TempFile is a temporary File. It will get removed when Closed.
|
||||
type TempFile interface {
|
||||
File
|
||||
io.Seeker
|
||||
}
|
||||
Reference in new issue
Block a user