expect

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

expect is a module port from https://github.com/hymkor/expect

Index

Constants

View Source
const (
	ErrnoExpectGetRecentOutput = -1
	ErrnoExpectTimeOut         = -2
	ErrnoExpectContextDone     = -3
)

Variables

This section is empty.

Functions

func Echo

func Echo(L any)

func Kill

func Kill(pid int) error

func Send

func Send(str string, wait int)

func Shot

func Shot(n int) ([]string, error)

func Sleep

func Sleep(value int)

func Spawn

func Spawn(args ...string) (int, error)

func SpawnContext

func SpawnContext(ctx context.Context, args ...string) (int, error)

func USleep

func USleep(value int)

func Wait

func Wait(pid int) error

Types

type Matching

type Matching struct {
	Position  int
	Line      string
	Match     string
	PreMatch  string
	PostMatch string
}

func Expect

func Expect(timeout int, captureLines int, keywords ...string) (int, *Matching)

func ExpectContext

func ExpectContext(ctx context.Context, timeout int, captureLines int, keywords ...string) (rc int, info *Matching)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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