Help us shape the future of Go! Take the 2026 Go Developer Survey

replaycmd

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Sleep(ctx context.Context, duration time.Duration) error
}

Timestamps are data that come from the recording: each event.Event has a timestamp. The clock acts: replay subtracts two timestamps to get the gap and divides by --speed option and aks the clock to wait that long before rendering the next event.

type EventSink

type EventSink interface {
	Write(evt event.Event)
}

EventSink shows each replayed event. → cmd/steerloop/internal/render

type Options

type Options struct {
	Path    string
	Speed   float64
	MaxWait time.Duration
}

func ParseOptions

func ParseOptions(args []string, stderr io.Writer) (Options, error)

func (Options) Validate

func (o Options) Validate() error

type Replay

type Replay struct {
	// contains filtered or unexported fields
}

Replay is one recording, ready to play. NewReplay builds it.

func NewReplay

func NewReplay(env cli.Environment, clock Clock, opts Options) (*Replay, error)

NewReplay reads the recording at opts.Path and picks the sink. It is the only place that picks a concrete type for each interface replay.go declares.

func (*Replay) Execute

func (r *Replay) Execute(parent context.Context) int

Execute plays the recording and returns the exit code the recorded run ended with. It starts no goroutine of its own: one loop waits, then writes, event by event. Ctrl-C cancels ctx, which ends the current wait.

type ReplayClock

type ReplayClock struct{}

func (*ReplayClock) Sleep

func (c *ReplayClock) Sleep(ctx context.Context, d time.Duration) error

type ReplayCommand

type ReplayCommand struct {
	// contains filtered or unexported fields
}

Command is `steerloop replay`. It implements cli.Command.

func New

func New(env cli.Environment) *ReplayCommand

func (*ReplayCommand) Run

func (c *ReplayCommand) Run(ctx context.Context, args []string) int

Jump to

Keyboard shortcuts

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