utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PayloadToHash

func PayloadToHash(payload string) string

Types

type ASCIICastV2

type ASCIICastV2 struct {
	Header      ASCIICastV2Header
	EventStream []ASCIICastV2Event
}

func NewASCIICastV2

func NewASCIICastV2(width int, height int) *ASCIICastV2

func (*ASCIICastV2) AddInputEvent

func (ac2 *ASCIICastV2) AddInputEvent(data string)

func (*ASCIICastV2) AddOutputEvent

func (ac2 *ASCIICastV2) AddOutputEvent(data string)

func (*ASCIICastV2) Load

func (ac2 *ASCIICastV2) Load(file string) error

func (*ASCIICastV2) Save

func (ac2 *ASCIICastV2) Save(file string) error

func (*ASCIICastV2) String

func (ac2 *ASCIICastV2) String() string

type ASCIICastV2Event

type ASCIICastV2Event struct {
	Time float64
	Type string // either "o" (stdout) or "i" (stdin)
	Data string // UTF-8 encoded JSON string
}

func (*ASCIICastV2Event) String

func (ac2e *ASCIICastV2Event) String() string

type ASCIICastV2Header

type ASCIICastV2Header struct {
	Version       int               `json:"version"`                   // (required) must be 2
	Width         int               `json:"width"`                     // (required) in columns
	Height        int               `json:"height"`                    // (required) in rows
	Timestamp     int               `json:"timestamp,omitempty"`       // (optional) unix epoch
	Duration      float64           `json:"duration,omitempty"`        // (optional) in seconds
	IdleTimeLimit float64           `json:"idle_time_limit,omitempty"` // (optional) in seconds
	Command       string            `json:"command,omitempty"`         // (optional) name of the command that was recorded
	Title         string            `json:"title,omitempty"`           // (optional) name of the asciicast
	Env           map[string]string `json:"env,omitempty"`             // (optional) key-value pair
	Theme         ASCIICastV2Theme  `json:"theme,omitempty"`           // (optional) color scheme of recorded terminal
}

func (*ASCIICastV2Header) String

func (ac2h *ASCIICastV2Header) String() string

type ASCIICastV2Theme

type ASCIICastV2Theme struct {
	FG      string `json:"fg"`      // text color
	BG      string `json:"bg"`      // background color
	Palette string `json:"palette"` // list of 8 or 16 colors, separated by colon character
}

type SlowWriter

type SlowWriter struct {
	// contains filtered or unexported fields
}

func NewSlowWriter

func NewSlowWriter(ratelimit float64, w io.Writer) *SlowWriter

func (*SlowWriter) SetRatelimit

func (sw *SlowWriter) SetRatelimit(ratelimit float64)

func (*SlowWriter) Write

func (sw *SlowWriter) Write(str string)

func (*SlowWriter) WriteLn

func (sw *SlowWriter) WriteLn(str string)

func (*SlowWriter) WriteLnUnlimited

func (sw *SlowWriter) WriteLnUnlimited(str string)

Jump to

Keyboard shortcuts

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