asciinema

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEncoder

func NewEncoder(logger log.Logger, geoIPProvider geoipprovider.LookupProvider) codec.Encoder

NewEncoder Creates an encoder that writes in the Asciicast v2 format (see https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md)

Types

type EventType

type EventType string

EventType is the type of event (input or output) in an Asciicast v2 line

const (
	// EventTypeOutput is a captured set of bytes sent to the output
	EventTypeOutput EventType = "o"
	// EventTypeInput is a captured input from the user
	EventTypeInput EventType = "i"
)

type Frame

type Frame struct {
	Time      float64
	EventType EventType
	Data      string
}

Frame is a single line in an Asciicast v2 file

func (*Frame) MarshalJSON

func (f *Frame) MarshalJSON() ([]byte, error)

MarshalJSON converts a frame into its JSON representation

func (*Frame) UnmarshalJSON

func (f *Frame) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a JSON byte array back into a frame

type Header struct {
	Version   uint              `json:"version"`
	Width     uint              `json:"width"`
	Height    uint              `json:"height"`
	Timestamp int               `json:"timestamp"`
	Command   string            `json:"command"`
	Title     string            `json:"title"`
	Env       map[string]string `json:"env"`
}

Header is an Asciicast v2 header line.

Jump to

Keyboard shortcuts

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