gotty: github.com/yubo/gotty/rec Index | Files

package rec

import "github.com/yubo/gotty/rec"

from github.com/asciinema/asciinema/asciicast

Index

Package Files

convert.go frame.go player.go rec.go timer.go

Constants

const (
    Input          = '0'
    Ping           = '1'
    ResizeTerminal = '2'
    SysEnv         = '3'
)
const (
    Output         = '0'
    Pong           = '1'
    SetWindowTitle = '2'
    SetPreferences = '3'
    SetReconnect   = '4'
)

func Convert Uses

func Convert(src, dst string, wait int64) error

func Nanotime Uses

func Nanotime() int64

func Save Uses

func Save(asciicast *Asciicast, path string) error

type ArgEnvTerminal Uses

type ArgEnvTerminal struct {
    Term    string `json:"TERM"`
    Shell   string `json:"SHELL"`
    Command string `json:"COMMAND"`
}

type ArgResizeTerminal Uses

type ArgResizeTerminal struct {
    Columns float64
    Rows    float64
}

type Asciicast Uses

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"`
}

type Duration Uses

type Duration float64

func (Duration) MarshalJSON Uses

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

type Env Uses

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

type Frame Uses

type Frame struct {
    Delay float64
    Data  []byte
}

func (*Frame) MarshalJSON Uses

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

func (*Frame) UnmarshalJSON Uses

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

type Player Uses

type Player struct {
    FileName string
    // contains filtered or unexported fields
}

func NewPlayer Uses

func NewPlayer(filename string, speed float64, repeat bool, wait int64) (*Player, error)

func (*Player) Close Uses

func (p *Player) Close() error

func (*Player) Read Uses

func (p *Player) Read(d []byte) (n int, err error)

func (*Player) Write Uses

func (p *Player) Write(d []byte) (n int, err error)

type RecData Uses

type RecData struct {
    Time int64
    Data []byte
}

type Recorder Uses

type Recorder struct {
    FileName string
    // contains filtered or unexported fields
}

func NewRecorder Uses

func NewRecorder(term, shell, command, dir string) (*Recorder, error)

func (*Recorder) Close Uses

func (r *Recorder) Close() error

func (*Recorder) Read Uses

func (r *Recorder) Read(d []byte) (n int, err error)

func (*Recorder) Write Uses

func (r *Recorder) Write(d []byte) (n int, err error)

type Stream Uses

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

func (*Stream) Close Uses

func (s *Stream) Close()

func (*Stream) Write Uses

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

Package rec imports 9 packages (graph) and is imported by 1 packages. Updated 2017-01-26. Refresh now. Tools for package owners.