connect3270

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Enter = "Enter"
	Tab   = "Tab"
	F1    = "PF(1)"
	F2    = "PF(2)"
	F3    = "PF(3)"
	F4    = "PF(4)"
	F5    = "PF(5)"
	F6    = "PF(6)"
	F7    = "PF(7)"
	F8    = "PF(8)"
	F9    = "PF(9)"
	F10   = "PF(10)"
	F11   = "PF(11)"
	F12   = "PF(12)"
)

These constants represent the keyboard keys

Variables

View Source
var (
	// Headless controls whether go3270 runs in headless mode.
	// Set this variable to true to enable headless mode.
	Headless bool

	Verbose bool
)

Functions

This section is empty.

Types

type Coordinates

type Coordinates struct {
	Row    int
	Column int
	Length int
}

Coordinates represents the screen coordinates (row and column)

type Emulator

type Emulator struct {
	Host       string
	Port       int
	ScriptPort string
}

Emulator base struct to x3270 terminal emulator

func NewEmulator

func NewEmulator(host string, port int, scriptPort string) *Emulator

NewEmulator creates a new Emulator instance. It initializes an Emulator with the given host, port, and scriptPort.

func (*Emulator) AsciiScreenGrab

func (e *Emulator) AsciiScreenGrab(filePath string, append bool) error

AsciiScreenGrab captures an ASCII screen and saves it to an HTML file with run details, with added retry logic.

func (*Emulator) Connect

func (e *Emulator) Connect() error

Connect opens a connection with x3270 or s3270 and the specified host and port.

func (*Emulator) CursorPosition

func (e *Emulator) CursorPosition() (string, error)

CursorPosition return actual position by cursor

func (*Emulator) Disconnect

func (e *Emulator) Disconnect() error

Disconnect closes the connection with x3270.

func (*Emulator) FillString

func (e *Emulator) FillString(x, y int, value string) error

FillString fills the field at the specified row (x) and column (y) with the given value

func (*Emulator) GetColumns

func (e *Emulator) GetColumns() (int, error)

GetColumns returns the number of columns in the saved screen image with retry logic.

func (*Emulator) GetRows

func (e *Emulator) GetRows() (int, error)

GetRows returns the number of rows in the saved screen image with retry logic.

func (*Emulator) GetValue

func (e *Emulator) GetValue(x, y, length int) (string, error)

GetValue returns content of a specified length at the specified row (x) and column (y) with retry logic.

func (*Emulator) InitializeHTMLFile

func (e *Emulator) InitializeHTMLFile(filePath string) error

Initialize HTML file with run details

func (*Emulator) IsConnected

func (e *Emulator) IsConnected() bool

IsConnected check if a connection with host exist

func (*Emulator) Press

func (e *Emulator) Press(key string) error

Press press a keyboard key

func (*Emulator) ReadHTMLFile added in v1.0.4

func (e *Emulator) ReadHTMLFile(filePath string) (string, error)

ReadHTMLFile reads the contents of the specified HTML file and returns it as a string.

func (*Emulator) SetString

func (e *Emulator) SetString(value string) error

SetString fills the field at the current cursor position with the given value and retries in case of failure.

func (*Emulator) WaitForField added in v1.0.4

func (e *Emulator) WaitForField(timeout time.Duration) error

WaitForField waits until the screen is ready, the cursor has been positioned on a modifiable field, and the keyboard is unlocked.

Jump to

Keyboard shortcuts

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