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.
pull/3251/head
Timothy Messier 3 years ago
parent 6705f6128a
commit e29939ce41
No known key found for this signature in database
GPG Key ID: EFD2F184F7600572

@ -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
}

Loading…
Cancel
Save