recording

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotInitialized = errors.New("Recordings have not been initialized")

Functions

func DialogReader

func DialogReader() io.ReadCloser

func InitializeRecordings

func InitializeRecordings()

Types

type PtyTracker

type PtyTracker struct {
	Pty                *os.File
	WindowListenerChan chan os.Signal

	OnReady func()
	// contains filtered or unexported fields
}

PtyTracker is here to help collect all of the pty related items that need to be passed around

func NewPtyTracker

func NewPtyTracker(termOut, readOut io.Writer, termInput io.Reader, onReadyFunc func()) PtyTracker

NewPtyTracker generates an initial tracker. termOut io.Writer // The writer that will be used to output events to what would be considered stdout

// Note: In many cases, you will want to pass a multiplexed writer (see io.MultiWriter)

readOut io.Writer // A writer that will forward along stdin events. This is the result of calling io.TeeReader.

// Note: if you are not interested in receiving stdin events, send along a io.Discard / no-op writer

onReady func() // A hook into the run state that provides a pre-recording area to display messages

Note: This method assumes all inputs come from stdin. This will adjust the stdin on the calling terminal We will attempt to restore to the original state on exit.

func (*PtyTracker) Run

func (t *PtyTracker) Run(shell string) error

Run starts the pty session

type RecordingInput

type RecordingInput struct {
	FileName         string
	FileDir          string
	Shell            string
	TermInput        io.Reader
	EventMiddleware  []eventers.EventMiddleware
	OnRecordingStart func(RecordingOutput)
}

RecordingInput is a small structure for holding all configuration details for starting up a recording.

This structure contains the following fields: FileName: The name of the file to be written FileDir: Where the file should be stored Shell: What shell to use for the PTY EventMiddleware: How to transform events that come through OnRecordingStart: A hook into the recording process just before actual recording starts

This is intended allow the user to provide messaging to the user

type RecordingOutput

type RecordingOutput struct {
	FilePath string
}

RecordingOutput is a small structure for communicating in-progress or completed recording details

func StartRecording

func StartRecording(opSlug string) (RecordingOutput, error)

StartRecording takes control of the terminal and starts a subshell to record input.

Jump to

Keyboard shortcuts

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