convert

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package convert provides functions for converting BSR data into other formats.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedProtocol = errors.New("unsupported protocol")
	ErrMalformedBsr        = errors.New("malformed bsr data file")
)

Common convert errors.

Functions

func ToAsciicast

func ToAsciicast(ctx context.Context, session *bsr.Session, tmp storage.TempFile, connectionId string, options ...Option) (io.ReadCloser, error)

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. This supports the following options:

  • WithChannelId to indicate this conversion should occur on a channel on a multiplexed session
  • WithMinWidth to set a minimum width for the asciicast
  • WithMinHeigh to set a minimum height for the asciicast

Types

type Option

type Option func(*options)

Option - how Options are passed as arguments

func WithChannelId

func WithChannelId(id string) Option

WithChannelId provides and option to specify the channelId

func WithMinHeight

func WithMinHeight(h uint32) Option

WithMinHeight can be used to set a minimum height for playback.

func WithMinWidth

func WithMinWidth(w uint32) Option

WithMinWidth can be used to set a minimum width for playback.

Directories

Path Synopsis
internal
asciicast
Package asciicast defines structs to ease the creation of asciicast files.
Package asciicast defines structs to ease the creation of asciicast files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL