From b4ce802572e4ed357c988a32d4d31b9c5c8d5c31 Mon Sep 17 00:00:00 2001 From: Timothy Messier Date: Thu, 11 May 2023 19:58:21 +0000 Subject: [PATCH] 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. --- internal/bsr/convert/convert.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/bsr/convert/convert.go b/internal/bsr/convert/convert.go index 3b11ee3e2..da24d337a 100644 --- a/internal/bsr/convert/convert.go +++ b/internal/bsr/convert/convert.go @@ -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") }