ssh

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient added in v0.6.0

func NewClient() *Client

func NewClientWithKey added in v0.6.0

func NewClientWithKey(username string, rsaKeyPair RsaKeyPair, host string) *Client

func (*Client) ClearConnectionData added in v0.6.0

func (p *Client) ClearConnectionData()

func (*Client) Execute

func (p *Client) Execute(command string) (ExecutionResult, error)

func (*Client) Executef

func (p *Client) Executef(command string, a ...any) (ExecutionResult, error)

func (*Client) SetConnectionData

func (p *Client) SetConnectionData(username string, password string, host string)

type CryptoBytes

type CryptoBytes []byte

func (CryptoBytes) MarshalYAML

func (c CryptoBytes) MarshalYAML() (interface{}, error)

func (*CryptoBytes) UnmarshalYAML

func (c *CryptoBytes) UnmarshalYAML(unmarshal func(interface{}) error) error

type ExecutionError

type ExecutionError struct {
	Output string
	Code   int
}

func (*ExecutionError) ToError

func (e *ExecutionError) ToError() error

type ExecutionResult

type ExecutionResult struct {
	Output string
	// contains filtered or unexported fields
}

func (ExecutionResult) Code

func (r ExecutionResult) Code() int

func (ExecutionResult) Error

func (r ExecutionResult) Error() error

func (ExecutionResult) IsError

func (r ExecutionResult) IsError() bool

type RsaKeyPair

type RsaKeyPair struct {
	PrivateKey CryptoBytes `json:"privateKey" yaml:"privateKey"`
	PublicKey  CryptoBytes `json:"publicKey" yaml:"publicKey"`
}

func GenerateRsaKeyPair

func GenerateRsaKeyPair() (RsaKeyPair, error)

func (RsaKeyPair) Empty

func (r RsaKeyPair) Empty() bool

Jump to

Keyboard shortcuts

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