target

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 14 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.Destination
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(dest ssh.Destination, opts ConnectionOptions) Connection

func (*Connection) BinaryExists

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

func (*Connection) DryRun

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

func (*Connection) ProbeAuthentication

func (c *Connection) ProbeAuthentication() error

func (*Connection) Run

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

type ConnectionOptions

type ConnectionOptions struct {
	AcceptNewHostKeys bool
	WithLoginShell    bool
	WithStdin         []byte
	Multiplex         bool
	WithMockExec      ExecSSH
	ConnectTimeout    time.Duration
}

type ConnectionTimeoutError added in v1.4.0

type ConnectionTimeoutError struct {
	Timeout time.Duration
}

func (ConnectionTimeoutError) Error added in v1.4.0

func (e ConnectionTimeoutError) Error() string

type ExecSSH

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

type HardwareProbe added in v1.4.0

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

func NewHardwareProbe added in v1.4.0

func NewHardwareProbe(r Runner) HardwareProbe

func (*HardwareProbe) Probe added in v1.4.0

func (p *HardwareProbe) Probe() (HardwareProfile, error)

func (*HardwareProbe) ProbeRemoteproc added in v1.4.0

func (p *HardwareProbe) ProbeRemoteproc() ([]RemoteprocCPU, error)

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"`
}

type Runner added in v1.4.0

type Runner interface {
	Run(command string) (string, error)
	BinaryExists(bin string) error
}

Jump to

Keyboard shortcuts

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