Documentation ¶
Index ¶
Constants ¶
const ContentType = "application/x-asciicast"
ContentType is the asciicast v2 MIME type.
const Version = 2
Version 2 is supposed by this package.
Variables ¶
ErrVersion is returned by Decoder/Reader if the version in the header is not version 2.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder for asciicast v2 recordings.
func NewDecoder ¶
NewDecoder returns a new Decoder for the provided Reader.
func (*Decoder) DecodeEvent ¶
DecodeEvent decodes the next Event.
type Encoder ¶
type Encoder struct { // Header contains recording meta-data. Header // contains filtered or unexported fields }
func NewEncoder ¶
NewEncoder can emit an asciicast v2 stream.
func NewEncoderEx ¶
NewEncoderEx can emit an asciicast v2 stream.
func (*Encoder) Write ¶
Write writes output. If WriteHeader wasn't called, it will be called first.
func (*Encoder) WriteEvent ¶
WriteEvent writes an event. If WriteHeader wasn't called, it will be called first.
func (*Encoder) WriteHeader ¶
WriteHeader writes the recording meta-data.
func (*Encoder) WriteInput ¶
WriteInput writes input. If WriteHeader wasn't called, it will be called first.
type Event ¶
type Header ¶
type Header struct { Version int `json:"version"` Width int `json:"width"` Height int `json:"height"` Timestamp int64 `json:"timestamp,omitempty"` Duration float64 `json:"duration,omitempty"` IdleTimeLimit float64 `json:"idle_time_limit,omitempty"` Command string `json:"command,omitempty"` Title string `json:"title,omitempty"` Env map[string]string `json:"env,omitempty"` Theme *Theme `json:"theme,omitempty"` }
Header contains contains recording meta-data.