convert

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

convert stream rec format to github.com/asciinema/asciinema format

from github.com/yubo/gotty/rec

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(src, dst string, wait time.Duration) error

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

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 Stream

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

func (*Stream) Close

func (s *Stream) Close()

func (*Stream) Write

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

Jump to

Keyboard shortcuts

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