asciicast

package
v0.0.0-...-a4160af Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cast

type Cast struct {
	Header *Header
	Frames []*Frame
}

Cast is the base of the asciicast formate

func UnmarshalCast

func UnmarshalCast(data string) (*Cast, error)

UnmarshalCast handles formatting a Cast JSON into the Cast

func (*Cast) Marshal

func (cast *Cast) Marshal() (string, error)

Marshal handles formatting a Cast as a JSON file to be read by the asciicast readers

type Frame

type Frame struct {
	Time   float64
	Event  string
	Data   string
	Author string
}

Frame is the base frame from an asciicast

func (*Frame) Marshal

func (frame *Frame) Marshal() ([]byte, error)

Marshal handles formatting a frame as a JSON line to be read by the asciicast readers

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         map[string]string `json:"theme,omitempty"`
}

Header corresponds to the asciicast v2 header protocol

func (*Header) Marshal

func (header *Header) Marshal() ([]byte, error)

Marshal handles formatting a header as a JSON line to be read by the asciicast readers

Jump to

Keyboard shortcuts

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