ssh

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProcessManager

func NewProcessManager(pool *Pool, machine domain.Machine) provider.AgentCLIProcessManager

func ShellQuote

func ShellQuote(raw string) string

ShellQuote escapes a raw argument for POSIX shell evaluation.

Types

type Client

type Client interface {
	NewSession() (Session, error)
	SendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error)
	Close() error
}

type DialConfig

type DialConfig struct {
	Address         string
	User            string
	KeyBytes        []byte
	Timeout         time.Duration
	HostKeyCallback gossh.HostKeyCallback
}

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, cfg DialConfig) (Client, error)
}

type MonitorCollector

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

func NewMonitorCollector

func NewMonitorCollector(pool *Pool) *MonitorCollector

func (*MonitorCollector) CollectAgentEnvironment

func (c *MonitorCollector) CollectAgentEnvironment(ctx context.Context, machine domain.Machine) (domain.MachineAgentEnvironment, error)

func (*MonitorCollector) CollectFullAudit

func (c *MonitorCollector) CollectFullAudit(ctx context.Context, machine domain.Machine) (domain.MachineFullAudit, error)

func (*MonitorCollector) CollectGPUResources

func (c *MonitorCollector) CollectGPUResources(ctx context.Context, machine domain.Machine) (domain.MachineGPUResources, error)

func (*MonitorCollector) CollectReachability

func (c *MonitorCollector) CollectReachability(ctx context.Context, machine domain.Machine) (domain.MachineReachability, error)

func (*MonitorCollector) CollectSystemResources

func (c *MonitorCollector) CollectSystemResources(ctx context.Context, machine domain.Machine) (domain.MachineSystemResources, error)

type Pool

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

func NewPool

func NewPool(openASEHomeDir string, opts ...PoolOption) *Pool

func (*Pool) Close

func (p *Pool) Close() error

func (*Pool) Get

func (p *Pool) Get(ctx context.Context, machine domain.Machine) (Client, error)

type PoolOption

type PoolOption func(*Pool)

func WithDialer

func WithDialer(dialer Dialer) PoolOption

func WithHostKeyCallback

func WithHostKeyCallback(callback gossh.HostKeyCallback) PoolOption

func WithReadFile

func WithReadFile(readFile func(string) ([]byte, error)) PoolOption

func WithTimeout

func WithTimeout(timeout time.Duration) PoolOption

type ProcessManager

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

func (*ProcessManager) Start

type Session

type Session interface {
	CombinedOutput(cmd string) ([]byte, error)
	StdinPipe() (io.WriteCloser, error)
	StdoutPipe() (io.Reader, error)
	StderrPipe() (io.Reader, error)
	Start(cmd string) error
	Signal(signal string) error
	Wait() error
	Close() error
}

type Tester

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

func NewTester

func NewTester(pool *Pool) *Tester

func (*Tester) TestConnection

func (t *Tester) TestConnection(ctx context.Context, machine domain.Machine) (domain.MachineProbe, error)

Jump to

Keyboard shortcuts

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