sessions

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SESSION_FILE_VERSION = 1
)

Variables

This section is empty.

Functions

func EnsureDirectory added in v0.1.1

func EnsureDirectory(path string) error

EnsureDirectory creates a directory if it does not exist and checks whether other users can read and write files in it.

func GetFilename added in v0.1.1

func GetFilename(dataDir string, path string) (string, error)

func WriteAsciinema added in v0.1.10

func WriteAsciinema(filename string, events []Event) error

Write `events` to the given file with path `filename` in the Asciicast v2 format. See https://docs.asciinema.org/manual/asciicast/v2/ for more information.

Types

type Event

type Event struct {
	Stamp   time.Time
	Message P.Message
}

type Recorder

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

func NewRecorder

func NewRecorder(ctx context.Context, filename string, stream stream.Stream) (*Recorder, error)

func (*Recorder) Events

func (s *Recorder) Events() []Event

func (*Recorder) Read

func (s *Recorder) Read(p []byte) (n int, err error)

func (*Recorder) Resize

func (s *Recorder) Resize(size stream.Size) error

func (*Recorder) Write

func (s *Recorder) Write(data []byte) (n int, err error)

type SessionReader added in v0.1.1

type SessionReader interface {
	Read() (Event, error)
}

func Open added in v0.1.1

func Open(filename string) (SessionReader, error)

type SessionWriter added in v0.1.1

type SessionWriter interface {
	Write(event Event) error
	Close() error
}

func Create added in v0.1.1

func Create(filename string) (SessionWriter, error)

type Simulator added in v0.1.5

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

Simulator is a convenient way of building recorded sessions programmatically, primarily for testing.

func NewSimulator added in v0.1.5

func NewSimulator() *Simulator

func (*Simulator) Add added in v0.1.5

func (s *Simulator) Add(events ...interface{}) *Simulator

func (*Simulator) AddTime added in v0.1.5

func (s *Simulator) AddTime(delta time.Duration, event interface{}) *Simulator

func (*Simulator) Events added in v0.1.5

func (s *Simulator) Events() []Event

func (*Simulator) Resize added in v0.1.5

func (s *Simulator) Resize(size geom.Size) *Simulator

func (*Simulator) ResizeTime added in v0.1.5

func (s *Simulator) ResizeTime(delta time.Duration, size geom.Size) *Simulator

func (*Simulator) Term added in v0.1.5

func (s *Simulator) Term(i int, v ...interface{}) *Simulator

Term invokes terminfo's Printf method and adds it to the session.

func (*Simulator) TermTime added in v0.1.5

func (s *Simulator) TermTime(delta time.Duration, i int, v ...interface{}) *Simulator

func (*Simulator) Write added in v0.1.5

func (s *Simulator) Write(data []byte) *Simulator

func (*Simulator) WriteTime added in v0.1.5

func (s *Simulator) WriteTime(delta time.Duration, data []byte) *Simulator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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