Documentation
¶
Overview ¶
Package asciicast provides methods for working with asciinema's file format asciicast v2.
Refer to the official documentation about asciicast v2 format here: https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md
Index ¶
Constants ¶
const ( Input eventType = "i" // Data read from stdin. Output eventType = "o" // Data writed to stdout. )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cast ¶
type Cast struct { Header header Events []Event }
Cast contains asciicast file data
func New ¶ added in v0.3.0
func New() *Cast
New will instantiate new Cast with basic medatada (version, timestamp and environment).
func (*Cast) AdjustSpeed ¶
AdjustSpeed changes the time of each event. Slower < 1.0 > Faster.
func (*Cast) CapRelativeTime ¶
CapRelativeTime limits the amount of time between each event
func (*Cast) Compress ¶ added in v0.2.0
func (c *Cast) Compress()
Compress chains together events with the same time.
func (*Cast) ToAbsoluteTime ¶
func (c *Cast) ToAbsoluteTime()
ToAbsoluteTime converts event time to the absolute difference from the start. This is the default time format.
func (*Cast) ToRelativeTime ¶
func (c *Cast) ToRelativeTime()
ToRelativeTime converts event time to the difference between each event.
type Event ¶
type Event struct { Time float64 `json:"time"` EventType eventType `json:"event-type"` EventData string `json:"event-data"` }
Event is a 3-tuple encoded as JSON array.
func (*Event) MarshalJSON ¶
MarshalJSON reads json list as Event fields.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON reads json list as Event fields.