ssh

package module
v0.0.0-...-2f5e82f Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

README

ssh

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 client

func New

func New(opts ...Option) *Client

New new service

func (*Client) Close

func (c *Client) Close() error

Close close

func (*Client) CmdOutBytes

func (c *Client) CmdOutBytes(cmd string) ([]byte, error)

CmdOutBytes cmd out bytes

func (*Client) Connect

func (c *Client) Connect() error

Connect dail connect

func (*Client) FastConnect

func (c *Client) FastConnect() error

FastConnect connect2

func (*Client) GetprobePasswd

func (c *Client) GetprobePasswd() string

GetprobePasswd 获取探测到的密码

func (*Client) Init

func (c *Client) Init(opts ...Option)

Init initialises options.

func (*Client) LoadConfig

func (c *Client) LoadConfig(v interface{}) error

LoadConfig load config

func (*Client) StartTerminal

func (c *Client) StartTerminal() error

StartTerminal StartTerminal

func (*Client) Upload

func (c *Client) Upload(src, dest string, mode os.FileMode) error

Upload upload

type Group

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

func WithContext

func WithContext() *Group

func (*Group) Error

func (g *Group) Error() error

func (*Group) Go

func (g *Group) Go(f func() error)

func (*Group) Wait

func (g *Group) Wait()

type Option

type Option func(*Options)

Option func

func Env

func Env(k, v string) Option

func Hostname

func Hostname(hostname string) Option

Hostname set hostname

func IP

func IP(ip string) Option

IP set ip

func Key

func Key(key string) Option

Key set key

func Name

func Name(name string) Option

Name set name

func Password

func Password(password string) Option

Password set password

func Passwords

func Passwords(passwords ...string) Option

Passwords set passwords

func Port

func Port(port int) Option

Port set port

func Pseudo

func Pseudo(pseudo bool) Option

Pseudo set pseudo

func QA

func QA(key, value string) Option

QA set QA

func Timeout

func Timeout(timeout int) Option

Timeout set timeout

func Username

func Username(username string) Option

Username set username

type Options

type Options struct {
	Name      string            `json:"name" yaml:"name"`
	Hotname   string            `json:"hostname" yaml:"hostname"`
	IP        string            `json:"ip" yaml:"ip"`
	Port      int               `json:"port" yaml:"port"`
	Username  string            `json:"username" yaml:"username"`
	Password  string            `json:"password" yaml:"password"`
	Passwords []string          `json:"passwords" yaml:"passwords"`
	Key       string            `json:"key" yaml:"key"`
	QAs       map[string]string `json:"qas" yaml:"qas"`
	Pseudo    bool              `json:"pseudo" yaml:"pseudo"` // like "ssh -tt", Force pseudo-terminal allocation.
	Timeout   int               `json:"timeout" yaml:"timeout"`
	Env       map[string]string `json:"env" yaml:"env"`
}

Options options

Jump to

Keyboard shortcuts

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