recording

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package recording implements a wrapper around a given recording command. It provides functionality to start, stop, automatically restart and to wait for the command to finish.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StartFunc

type StartFunc func(command string, args []string, w io.Writer) (
	stop context.CancelFunc,
	wait WaitFunc,
)

StartFunc executes the recording command with the given args and writes the output to the provided writer. It returns a function to stop the recording and a function to wait for the recording to stop.

type WaitFunc

type WaitFunc func() error

WaitFunc waits for the command execution to stop. It returns an error explaining the stop.

func Start

func Start(command string, args []string, w io.Writer) (
	stop context.CancelFunc,
	wait WaitFunc,
)

Start executes the recording command with the given args and writes the output to the provided writer. It returns a function to stop the recording and a function to wait for the recording to stop. If the recording command fails unexpectedly, it is restarted automatically.

Jump to

Keyboard shortcuts

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