asciicast

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2016 License: GPL-3.0 Imports: 11 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(asciicast *Asciicast, path string) error

Types

type Asciicast

type Asciicast struct {
	Version  int      `json:"version"`
	Width    int      `json:"width"`
	Height   int      `json:"height"`
	Duration Duration `json:"duration"`
	Command  string   `json:"command"`
	Title    string   `json:"title"`
	Env      *Env     `json:"env"`
	Stdout   []Frame  `json:"stdout"`
}

func Load

func Load(url string) (*Asciicast, error)

func NewAsciicast

func NewAsciicast(width, height int, duration float64, command, title string, frames []Frame, env map[string]string) *Asciicast

type AsciicastPlayer

type AsciicastPlayer struct {
	Terminal terminal.Terminal
}

func (*AsciicastPlayer) Play

func (r *AsciicastPlayer) Play(asciicast *Asciicast, maxWait uint) error

type AsciicastRecorder

type AsciicastRecorder struct {
	Terminal terminal.Terminal
}

func (*AsciicastRecorder) Record

func (r *AsciicastRecorder) Record(path, command, title string, maxWait uint, assumeYes bool, env map[string]string) error

type Duration

type Duration float64

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

type Env

type Env struct {
	Term  string `json:"TERM"`
	Shell string `json:"SHELL"`
}

type Frame

type Frame struct {
	Delay float64
	Data  []byte
}

func (*Frame) MarshalJSON

func (f *Frame) MarshalJSON() ([]byte, error)

func (*Frame) UnmarshalJSON

func (f *Frame) UnmarshalJSON(data []byte) error

type Player

type Player interface {
	Play(*Asciicast, uint) error
}

func NewPlayer

func NewPlayer() Player

type Recorder

type Recorder interface {
	Record(string, string, string, uint, bool, map[string]string) error
}

func NewRecorder

func NewRecorder() Recorder

type Stream

type Stream struct {
	Frames []Frame
	// contains filtered or unexported fields
}

func NewStream

func NewStream(maxWait uint) *Stream

func (*Stream) Close

func (s *Stream) Close()

func (*Stream) Duration

func (s *Stream) Duration() time.Duration

func (*Stream) Write

func (s *Stream) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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