refact(bsr/convert): Use new storage.TempFile interface

This changes the ToAscinema function to take a storage.TempFile instead
of a storage.FS. It was noticed that when this was being used a
storage.FS was being created just prior to calling this just so that it
could then create a temporary file. It seemed to make more sense to just
pass the temporary file in, instead of needing to expand the storage.FS
interface.

This also renames this method to align with the file format that the
returned io.Reader will contain.
This commit is contained in:
Timothy Messier committed 2023-05-31 12:18:21 +00:00
1 parent e29939ce41
commit b4ce802572
1 file changed
+2 -2
+2 -2
View File
@@ -11,10 +11,10 @@ import (
"github.com/hashicorp/boundary/internal/storage"
)
// ToAsciinema accepts a bsr.Session and will convert the underlying BSR connection or channel file to an asciinema file.
// ToAsciicast accepts a bsr.Session and will convert the underlying BSR connection or channel file to an asciinema file.
// The tempFs will be used to write the asciinema file to disk
// It returns an io.Reader to the converted asciinema file
// Supports WithChannelId() to indicate this conversion should occur on a chanel on a multiplexed session
func ToAsciinema(ctx context.Context, session bsr.Session, tempFs storage.FS, connectionId string, options ...Option) (io.Reader, error) {
func ToAsciicast(ctx context.Context, session bsr.Session, tmp storage.TempFile, connectionId string, options ...Option) (io.ReadCloser, error) {
panic("not implemented")
}