sshx

package
v0.0.0-...-56099e8 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CliCommands

type CliCommands struct {
	Command []string
	Timeout time.Duration
}

type Gossh

type Gossh struct {
	Option
	// contains filtered or unexported fields
}

func NewSSHClient

func NewSSHClient(host string, port int, cfg *ssh.ClientConfig, opts ...Option) *Gossh

NewSSHClient return Gossh

func (*Gossh) Close

func (g *Gossh) Close() error

Close connection

func (*Gossh) Connect

func (g *Gossh) Connect() (string, error)

Connect to the remote server return login text

func (*Gossh) Exec

func (g *Gossh) Exec(commands CliCommands) (map[string][]string, error)

Exec CLiCommands return multi result

type Option

type Option func(opt *options)

Option defines the method to customize the config options.

func UseEnv

func UseEnv() Option

UseEnv customizes the config to use environment variables.

Jump to

Keyboard shortcuts

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