Documentation
¶
Overview ¶
Package recordertest is the scripted recorder.Engine every recorder test drives: sessions and recordings that record their calls, an optional gate that holds OpenSession (the output picker), and a hook that ends a recording as a failed capture would.
Index ¶
- type Engine
- func (e *Engine) OpenOutput(output string, _ bool) (recorder.Session, error)
- func (e *Engine) OpenSession(ctx context.Context, _ bool) (recorder.Session, error)
- func (e *Engine) Outputs() []string
- func (e *Engine) Recordings() []*Recording
- func (e *Engine) Replays() []*Replay
- func (e *Engine) Sessions() []*Session
- type Recording
- type Replay
- func (r *Replay) Bytes() uint64
- func (r *Replay) Fail(reason string)
- func (r *Replay) FailSaves(err error)
- func (r *Replay) Keyframe(n uint64)
- func (r *Replay) Save(path string, format config.RecorderFormat) error
- func (r *Replay) Saves() []string
- func (r *Replay) Stop() error
- func (r *Replay) Stops() int
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// OpenErr and StartErr fail the respective step; StopErr is what
// every recording's Stop returns.
OpenErr, StartErr, StopErr error
// Gate, when set, holds OpenSession until it closes or ctx ends.
Gate chan struct{}
// WriteOutput makes a stopped recording leave a non-empty file at
// its output path, as a finalized muxer does.
WriteOutput bool
// contains filtered or unexported fields
}
Engine is a fake recorder.Engine.
func (*Engine) OpenOutput ¶ added in v0.3.15
OpenOutput implements recorder.Engine.
func (*Engine) OpenSession ¶
OpenSession implements recorder.Engine.
func (*Engine) Recordings ¶
Recordings are the started recordings.
type Recording ¶
type Recording struct {
// Opts are the options it started with.
Opts recorder.Options
// contains filtered or unexported fields
}
Recording is a fake recorder.Recording.
func (*Recording) HoldStop ¶
func (r *Recording) HoldStop() (release func())
HoldStop makes Stop block until release runs, so a test can see what the service shows while a recording finalizes.
type Replay ¶ added in v0.3.15
type Replay struct {
// Opts and Span are what it started with.
Opts recorder.Options
Span time.Duration
// contains filtered or unexported fields
}
Replay is a fake recorder.Replay: Save writes the path and format it was asked for into the file, as a muxed ring would write footage.
func (*Replay) Keyframe ¶ added in v0.3.15
Keyframe makes the ring hold n bytes and reports a keyframe entering it.
func (*Replay) Save ¶ added in v0.3.15
func (r *Replay) Save(path string, format config.RecorderFormat) error
Save implements recorder.Replay.