core

package
v0.0.0-...-c56a8a1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

func (*Checker) CheckTranscript

func (ckr *Checker) CheckTranscript(ctx context.Context, r io.Reader) error

type CommandCheckError

type CommandCheckError struct {
	Command string
	Lineno  int
	Err     error
}

func (CommandCheckError) Error

func (err CommandCheckError) Error() string

func (CommandCheckError) Unwrap

func (err CommandCheckError) Unwrap() error

type CommandResult

type CommandResult struct {
	Output   []byte
	ExitCode int
}

type DiffError

type DiffError struct {
	Expected string
	Actual   string
}

func (DiffError) Color

func (err DiffError) Color() string

func (DiffError) Error

func (err DiffError) Error() string

func (DiffError) Plain

func (err DiffError) Plain() string

type Handler

type Handler interface {
	HandleComment(ctx context.Context, text string) error
	HandleRun(ctx context.Context, command string) error
	HandleOutput(ctx context.Context, fd int, line string) error
	HandleExitCode(ctx context.Context, exitCode int) error
}

type Interpreter

type Interpreter struct {
	// Input parameters.
	Handler Handler

	// Exposed state.
	Lineno        int
	Command       string
	CommandLineno int
	// contains filtered or unexported fields
}

Interprets a transcript file.

func (*Interpreter) ExecLine

func (t *Interpreter) ExecLine(ctx context.Context, text string) error

func (*Interpreter) ExecTranscript

func (t *Interpreter) ExecTranscript(ctx context.Context, r io.Reader) error

type Recorder

type Recorder struct {
	Stdout io.Writer
	Stderr io.Writer

	Transcript bytes.Buffer
	// contains filtered or unexported fields
}

func (*Recorder) Exited

func (rec *Recorder) Exited() bool

func (*Recorder) Init

func (rec *Recorder) Init() error

func (*Recorder) RecordComment

func (rec *Recorder) RecordComment(text string)

func (*Recorder) RunCommand

func (rec *Recorder) RunCommand(ctx context.Context, command string) (*CommandResult, error)

type Updater

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

func (*Updater) UpdateTranscript

func (upr *Updater) UpdateTranscript(ctx context.Context, r io.Reader) (transcript *bytes.Buffer, err error)

Jump to

Keyboard shortcuts

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