ssh

package
v0.0.0-...-e90a610 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 5 Imported by: 0

README

ssh

SSH client for remote command execution.

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
}

Client SSH Client

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient Factory

func (*Client) Exec

func (c *Client) Exec(command string) (stdout string, stderr string, err error)

Exec execute a command

type Config

type Config struct {
	IP       string `json:"ip"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password,omitempty"`
	Key      string `json:"key,omitempty"`
	Timeout  int    `json:"timeout"`
}

Config SSH Config

func (*Config) Check

func (c *Config) Check() error

Check config

Jump to

Keyboard shortcuts

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