records

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error interface {
	error
	Records() []Record
}

Error is an error with attached records

func WrapError

func WrapError(err error, records ...Record) Error

WrapError wraps 'err' with additional records

type Record

type Record interface {
	// ContentType returns the MIME type for this record's data. e.g. image/gif, text/plain
	ContentType() string
	// Data returns the record data in bytes
	Data() []byte
}

Record contains data that can be attached to errors for more context. i.e. screen recording gif

func New

func New(plainText string) Record

type ScreenRecorder

type ScreenRecorder interface {
	Capture(ctx context.Context) error
	Encode() Record
}

ScreenRecorder takes screenshots and encodes them as a gif

func NewScreenRecorder

func NewScreenRecorder(timeScale float64) ScreenRecorder

NewScreenRecorder creates a new ScreenRecorder and stretches the gif frame delay by 'timeScale'

Jump to

Keyboard shortcuts

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