Documentation ¶
Index ¶
- Constants
- Variables
- type Coordinates
- type Emulator
- func (e *Emulator) AsciiScreenGrab(filePath string, apiMode bool) error
- func (e *Emulator) Connect() error
- func (e *Emulator) CursorPosition() (string, error)
- func (e *Emulator) Disconnect() error
- func (e *Emulator) FillString(x, y int, value string) error
- func (e *Emulator) GetColumns() (int, error)
- func (e *Emulator) GetRows() (int, error)
- func (e *Emulator) GetValue(x, y, length int) (string, error)
- func (e *Emulator) InitializeOutput(filePath string, runAPI bool) error
- func (e *Emulator) IsConnected() bool
- func (e *Emulator) Press(key string) error
- func (e *Emulator) ReadOutputFile(tempFilePath string) (string, error)
- func (e *Emulator) SetString(value string) error
- func (e *Emulator) WaitForField(timeout time.Duration) error
Constants ¶
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 ¶
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 ¶
Coordinates represents the screen coordinates (row and column)
type Emulator ¶
Emulator base struct to x3270 terminal emulator
func NewEmulator ¶
NewEmulator creates a new Emulator instance. It initializes an Emulator with the given host, port, and scriptPort.
func (*Emulator) AsciiScreenGrab ¶
AsciiScreenGrab captures an ASCII screen and saves it to a file. If apiMode is true, it saves plain ASCII text. Otherwise, it formats the output as output.
func (*Emulator) Connect ¶
Connect opens a connection with x3270 or s3270 and the specified host and port.
func (*Emulator) CursorPosition ¶
CursorPosition return actual position by cursor
func (*Emulator) Disconnect ¶
Disconnect closes the connection with x3270.
func (*Emulator) FillString ¶
FillString fills the field at the specified row (x) and column (y) with the given value
func (*Emulator) GetColumns ¶
GetColumns returns the number of columns in the saved screen image with retry logic.
func (*Emulator) GetRows ¶
GetRows returns the number of rows in the saved screen image with retry logic.
func (*Emulator) GetValue ¶
GetValue returns content of a specified length at the specified row (x) and column (y) with retry logic.
func (*Emulator) InitializeOutput ¶ added in v1.0.6
InitializeOutput initializes the output file with run details
func (*Emulator) IsConnected ¶
IsConnected check if a connection with host exist
func (*Emulator) ReadOutputFile ¶ added in v1.0.6
ReadOutputFile reads the contents of the specified HTML file and returns it as a string.