Documentation
¶
Overview ¶
Package replay provides a biome that records all events to an underlying biome and then allows replaying those command invocations later.
Index ¶
- type Recorder
- func (rec *Recorder) Close() error
- func (rec *Recorder) Describe() *biome.Descriptor
- func (rec *Recorder) Dirs() *biome.Dirs
- func (rec *Recorder) IsAbsPath(path string) bool
- func (rec *Recorder) JoinPath(elem ...string) string
- func (rec *Recorder) Run(ctx context.Context, invoke *biome.Invocation) error
- type Replay
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
A Recorder wraps another biome and records its commands in memory. The interactions are saved to the filesystem when it is finished.
func NewRecorder ¶
NewRecorder returns a new Recorder biome that wraps the given biome and saves to dir on Close.
func (*Recorder) Close ¶
Close writes the recorded invocations to the directory passed into NewRecorder.
func (*Recorder) Describe ¶
func (rec *Recorder) Describe() *biome.Descriptor
type Replay ¶
type Replay struct {
// contains filtered or unexported fields
}
Replay is a biome that replays Run commands from a recorded file.
func Load ¶
func Load(dir string, desc *biome.Descriptor) (*Replay, error)
Load reads the biome interactions in the given directory for the given descriptor and returns a biome that repeats those commands.
func (*Replay) Describe ¶
func (r *Replay) Describe() *biome.Descriptor
Describe returns the recorded descriptor.