console

package
v1.0.53 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsolePortDownError

func NewConsolePortDownError() error

func ThrowBadConsolePortException

func ThrowBadConsolePortException(lastRead []byte) error

func ThrowConsoleException

func ThrowConsoleException(lastRead []byte) error

func ThrowConsolePortIsBusyException

func ThrowConsolePortIsBusyException(lastRead []byte) error

func ThrowConsolePortIsLockedException

func ThrowConsolePortIsLockedException(lastRead []byte) error

Types

type BadConsolePortException

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

func (*BadConsolePortException) Error

func (e *BadConsolePortException) Error() string

type CommandInfoPort

type CommandInfoPort interface {
	GetPort() int
	GetSpeed() int
	GetPCLwr() string
}

type CommandInfoResult

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

func (CommandInfoResult) GetPCLwr

func (m CommandInfoResult) GetPCLwr() string

func (CommandInfoResult) GetPort

func (m CommandInfoResult) GetPort() int

func (CommandInfoResult) GetPortName

func (m CommandInfoResult) GetPortName() string

func (CommandInfoResult) GetSpeed

func (m CommandInfoResult) GetSpeed() int

type CommandsInfoResult

type CommandsInfoResult map[string]CommandInfoPort

type ConsoleException

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

func (*ConsoleException) Error

func (e *ConsoleException) Error() string

type ConsolePortDownError

type ConsolePortDownError struct {
}

func (*ConsolePortDownError) Error

func (e *ConsolePortDownError) Error() string

type ConsolePortIsBusyException

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

func (*ConsolePortIsBusyException) Error

type ConsolePortIsLockedException

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

func (*ConsolePortIsLockedException) Error

func (*ConsolePortIsLockedException) Is

func (m *ConsolePortIsLockedException) Is(target error) bool

type Streamer

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

func NewStreamer

func NewStreamer(host, consolePort string, credentials credentials.Credentials, portCredentials credentials.Credentials, opts ...StreamerOption) *Streamer

func (*Streamer) CheckConsoleError

func (m *Streamer) CheckConsoleError(readRes streamer.ReadRes) error

func (*Streamer) Close

func (m *Streamer) Close()

func (*Streamer) Cmd

func (m *Streamer) Cmd(ctx context.Context, str string) (cmd.CmdRes, error)

func (*Streamer) ConsoleCmd

func (m *Streamer) ConsoleCmd(ctx context.Context, command string, sendNewLine bool) ([]byte, error)

func (*Streamer) DiscoveryAllPorts

func (m *Streamer) DiscoveryAllPorts(ctx context.Context) (CommandsInfoResult, error)

func (*Streamer) Download

func (m *Streamer) Download(paths []string, recurse bool) (map[string]streamer.File, error)

func (*Streamer) FlushBuffer

func (m *Streamer) FlushBuffer()

func (*Streamer) GetBuffer

func (m *Streamer) GetBuffer() []byte

func (*Streamer) GetCredentials

func (m *Streamer) GetCredentials() credentials.Credentials

func (*Streamer) HasFeature

func (m *Streamer) HasFeature(feature streamer.Const) bool

func (*Streamer) Init

func (m *Streamer) Init(ctx context.Context) error

func (*Streamer) InitAgentForward

func (m *Streamer) InitAgentForward() error

func (*Streamer) Read

func (m *Streamer) Read(ctx context.Context, size int) ([]byte, error)

func (*Streamer) ReadTo

func (m *Streamer) ReadTo(ctx context.Context, exp expr.Expr) (streamer.ReadRes, error)

func (*Streamer) SendCharacter

func (m *Streamer) SendCharacter(ctx context.Context, char byte) ([]byte, error)

func (*Streamer) SetCredentialsInterceptor

func (m *Streamer) SetCredentialsInterceptor(inter func(credentials.Credentials) credentials.Credentials)

func (*Streamer) SetReadTimeout

func (m *Streamer) SetReadTimeout(readTimeout time.Duration) time.Duration

func (*Streamer) SetTrace

func (m *Streamer) SetTrace(cb trace.CB)

func (*Streamer) Upload

func (m *Streamer) Upload(m2 map[string]streamer.File) error

func (*Streamer) Write

func (m *Streamer) Write(text []byte) error

func (*Streamer) XRead

func (m *Streamer) XRead(ctx context.Context, size int, duration time.Duration, expr expr.Expr) (*streamer.ReadXRes, error)

type StreamerOption

type StreamerOption func(*Streamer)

func WithConsolePort

func WithConsolePort(port int) StreamerOption

func WithForceAttache

func WithForceAttache() StreamerOption

func WithHackedSSL

func WithHackedSSL() StreamerOption

func WithLogger

func WithLogger(log *zap.Logger) StreamerOption

func WithPort

func WithPort(port int) StreamerOption

func WithSSHTunnel

func WithSSHTunnel(tunnelHost string) StreamerOption

func WithSSHTunnelConn

func WithSSHTunnelConn(tunnel *sshtunnel.SSHTunnel) StreamerOption

func WithSpeed

func WithSpeed(speed int) StreamerOption

func WithTrace

func WithTrace(trace trace.CB) StreamerOption

Jump to

Keyboard shortcuts

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