termshare

package
v0.0.0-...-28f6320 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CastRecorder

type CastRecorder struct {
	Command            string
	IdleTimeLimit      time.Duration
	CaptureStdin       bool
	Title              string
	Environment        []string
	CaptureEnvironment []string
}

func (*CastRecorder) Record

func (r *CastRecorder) Record(w io.Writer) error

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error
type Header struct {
	Version       int               `json:"version"`
	Width         int               `json:"width"`
	Height        int               `json:"height"`
	Timestamp     Time              `json:"timestamp,omitempty"`
	IdleTimeLimit Duration          `json:"idle_time_limit,omitempty"`
	Environment   map[string]string `json:"env,omitempty"`
	Title         string            `json:"title,omitempty"`
}

type Message

type Message struct {
	Offset      Duration
	MessageType MessageType
	Message     string
}

func (Message) MarshalJSON

func (m Message) MarshalJSON() ([]byte, error)

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(data []byte) error

type MessageType

type MessageType string
const (
	StdinMessage  MessageType = "i"
	StdoutMessage MessageType = "o"
)

type Player

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

func NewPlayer

func NewPlayer(input io.Reader, idleTimeLimit time.Duration) (*Player, error)

func (*Player) Next

func (r *Player) Next()

func (*Player) Pause

func (r *Player) Pause()

func (*Player) Play

func (r *Player) Play(ctx context.Context, w io.Writer, speed float64) error

func (*Player) Unpause

func (r *Player) Unpause()

type Processor

type Processor func(message Message) (Message, error)

func AdjustSpeed

func AdjustSpeed(speed float64) Processor

func CapRelativeTime

func CapRelativeTime(limit Duration) Processor

func ToAbsoluteTime

func ToAbsoluteTime() Processor

func ToRelativeTime

func ToRelativeTime() Processor

type Processors

type Processors []Processor

func (Processors) Apply

func (p Processors) Apply(msg Message) (Message, error)

type RawRecorder

type RawRecorder struct {
	Command string
}

func (*RawRecorder) Record

func (r *RawRecorder) Record(w io.Writer) error

type Recorder

type Recorder interface {
	Record(w io.Writer) error
}

type Time

type Time struct {
	time.Time
}

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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