Documentation ¶
Index ¶
- type Player
- func (p *Player) Acquire()
- func (p *Player) Commands() []detect.Command
- func (p *Player) Events() []sessions.Event
- func (p *Player) Goto(index, offset int)
- func (p *Player) GotoProgress(index, offset int, progress chan<- int)
- func (p *Player) Location() search.Address
- func (p *Player) Output(start, end int) (data []byte, ok bool)
- func (p *Player) Preview(params *params.Parameters, viewport, location geom.Vec2, ...) *tty.State
- func (p *Player) Process(event sessions.Event) error
- func (p *Player) Release()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Player ¶
func FromEvents ¶
func FromEventsContext ¶ added in v1.2.0
FromEventsContext creates a Player from the given events, but stops if the context is cancelled.
func (*Player) Goto ¶
Goto moves the player to the specified event index and byte offset. If the index and offset are before the current location, the player will reset the terminal and start from the beginning, since there's no way to "rewind" a terminal session. This means that playing backwards is very slow on long sessions.
func (*Player) GotoProgress ¶ added in v0.10.0
GotoProgress is the same as Goto, but it allows for a progress channel to be passed in. The channel will receive progress updates as the player moves through the events.
func (*Player) Output ¶ added in v0.9.0
Output gets all of the output written in the range [start, end).
func (*Player) Preview ¶
func (p *Player) Preview( params *params.Parameters, viewport, location geom.Vec2, highlights []movement.Highlight, ) *tty.State
Preview captures a preview with the size `viewport` at `location` in the scrollback of the terminal. You may also provide `highlights` that will be passed to the Flow renderer. Returns nil if the player is "in use", which is only used by replay mode to jump back in time.