Documentation ¶
Index ¶
Constants ¶
View Source
const ( EventTypeUnknown = "" EventTypeOutput = "o" EventTypeInput = "i" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsciiCastV1 ¶
type AsciiCastV1 struct { Version Version `json:"version"` Width uint `json:"width" yaml:"width" mapstructure:"width"` Height uint `json:"height" yaml:"height" mapstructure:"height"` Duration float64 `json:"duration" yaml:"duration" mapstructure:"duration"` Command string `json:"command" yaml:"command" mapstructure:"command"` Title string `json:"title" yaml:"title" mapstructure:"title"` Env map[string]string `json:"env" yaml:"env" mapstructure:"env"` StdoutFrames []Frame `json:"stdout" yaml:"stdout" mapstructure:"stdout"` }
AsciiCastV1 v1格式的规范文档: https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v1.md
func ParseV1 ¶
func ParseV1(ctx context.Context, asciiCastV1Bytes []byte) (*AsciiCastV1, error)
ParseV1 解析V1版本的Ascii Cast 文件 https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v1.md
func (*AsciiCastV1) Check ¶
func (x *AsciiCastV1) Check() error
type AsciiCastV2 ¶
type AsciiCastV2 struct { // 表示文件的格式版本 Version Version `json:"version" yaml:"version" mapstructure:"version"` // 屏幕的宽度,但是是列 Width uint `json:"width" yaml:"width" mapstructure:"width"` // 屏幕的高度,但是是行 Height uint `json:"height" yaml:"height" mapstructure:"height"` // 录制开始时间 Timestamp uint64 `json:"timestamp" yaml:"timestamp" mapstructure:"timestamp"` // 录制持续时间 Duration float64 `json:"duration" yaml:"duration" mapstructure:"duration"` Command string `json:"command" yaml:"command" mapstructure:"command"` Title string `json:"title" yaml:"title" mapstructure:"title"` Theme *Theme `json:"theme" yaml:"theme" mapstructure:"theme"` // IdleTimeLimit float64 `json:"idle_time_limit" yaml:"idle_time_limit" mapstructure:"idle_time_limit"` // 相关环境变量 EnvMap map[string]string `json:"env" yaml:"env" mapstructure:"env"` EventStream []*Event `json:"event_stream" yaml:"event_stream" mapstructure:"event_stream"` // contains filtered or unexported fields }
格式规范文档: https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md
func ParseV2 ¶
func ParseV2(ctx context.Context, asciiCastV2Bytes []byte) (*AsciiCastV2, error)
ParseV2 解析V2版本的Ascii Cast文件 v2格式规范的文档: https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md
func (*AsciiCastV2) GetTime ¶
func (x *AsciiCastV2) GetTime() time.Time
type Event ¶
type Event struct { // 时间发生的时间距开始时间的偏移 Delay float64 `json:"delay" yaml:"delay" mapstructure:"delay"` // 事件的类型,v2的话是有output和input EventType EventType `json:"event_type" yaml:"event_type" mapstructure:"event_type"` // 事件的数据,通常是显示的内容 EventData string `json:"event_data" yaml:"event_data" mapstructure:"event_data"` // contains filtered or unexported fields }
Event 事件流中的某一个事件
func (*Event) GetAsciiCast ¶
func (x *Event) GetAsciiCast() *AsciiCastV2
func (*Event) GetEventTime ¶
Click to show internal directories.
Click to hide internal directories.