target

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHostKeyVerification   = errors.New("ssh host key verification failed")
	ErrAuthenticationFailure = errors.New("ssh authentication failed")
)
View Source
var ErrPasswordAuthentication = errors.New("key-based SSH authentication is not setup")

Functions

func FindKeyValueInString

func FindKeyValueInString(key string, text string) (int64, error)

Types

type Connection

type Connection struct {
	SSHTarget ssh.Host
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(sshTarget string, opts ConnectionOptions) Connection

func (*Connection) BinaryExists

func (c *Connection) BinaryExists(bin string) error

func (*Connection) DryRun

func (c *Connection) DryRun(command string, output io.Writer) error

func (*Connection) ProbeAuthentication

func (c *Connection) ProbeAuthentication() error

func (*Connection) ProbeHardware

func (c *Connection) ProbeHardware() (HardwareProfile, error)

func (*Connection) ProbeRemoteproc

func (c *Connection) ProbeRemoteproc() ([]RemoteprocCPU, error)

func (*Connection) Run

func (c *Connection) Run(command string) (string, error)

type ConnectionOptions

type ConnectionOptions struct {
	AcceptNewHostKeys bool
	AuthProbeInput    io.Reader
	AuthProbeOutput   io.Writer
	WithLoginShell    bool
	WithStdin         []byte
	Multiplex         bool
	WithMockExec      ExecSSH
}

type ExecSSH

type ExecSSH func(target ssh.Host, command string, stdin []byte, sshArgs ...string) *exec.Cmd

type HardwareProfile

type HardwareProfile struct {
	HostProcessor []HostProcessor `yaml:"host"`
	RemoteCPU     []RemoteprocCPU `yaml:"remoteprocs"`
	TotalMemoryKb int64           `yaml:"totalmemory_kb"`
}

type HostProcessor

type HostProcessor struct {
	Model    string   `yaml:"model"`
	Cores    int      `yaml:"cores"`
	Features []string `yaml:"features"`
}

func CreateCPUProfile

func CreateCPUProfile(fields []LscpuOutputField) ([]HostProcessor, error)

func (*HostProcessor) ExtractArmFeatures

func (proc *HostProcessor) ExtractArmFeatures() []string

type LscpuOutputField

type LscpuOutputField struct {
	Field    string             `json:"field"`
	Data     string             `json:"data"`
	Children []LscpuOutputField `json:"children,omitempty"`
}

type RemoteprocCPU

type RemoteprocCPU struct {
	Name string `yaml:"name"`
}

Jump to

Keyboard shortcuts

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