gossh

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Conf = &Config{}
)

Functions

func Init

func Init() (err error)

Types

type Client

type Client struct {
	SshConf *ssh.ClientConfig
	Infos   []*Info
	Modes   *ssh.TerminalModes
	Ch      chan *EchoMsg
	// contains filtered or unexported fields
}

func NewSshClient

func NewSshClient(conf *Config) (*Client, error)

func (*Client) Close

func (cli *Client) Close()

func (*Client) Connect

func (cli *Client) Connect()

func (*Client) MultiRun

func (cli *Client) MultiRun(cmd string, out chan<- *EchoMsg)

func (*Client) RegInfoHostsSlice

func (cli *Client) RegInfoHostsSlice(cmd string, remoteHosts ...string)

call RegInfoHostsSlice,RegInfoHostsStr before Connect

func (*Client) RegInfoHostsStr

func (cli *Client) RegInfoHostsStr(cmd string, remoteHosts string)

func (*Client) Run

func (cli *Client) Run(cmd string)

type CommaStrSlice

type CommaStrSlice []string

func (*CommaStrSlice) Set

func (c *CommaStrSlice) Set(value string) error

func (*CommaStrSlice) String

func (c *CommaStrSlice) String() string

type Config

type Config struct {
	User        string
	Password    string
	PrivateKey  string
	Timeout     int64
	Ciphers     []string
	RemoteHosts string
	Cmd         string
	EchoIp      bool
	IdRsa       string
}

func Init2

func Init2(path string) (conf *Config, err error)

type EchoMsg

type EchoMsg struct {
	Addr    string
	Content string
	// contains filtered or unexported fields
}

type Info

type Info struct {
	Addr    string
	Port    int
	Client  *ssh.Client
	Session *ssh.Session
	Cmd     string
}

type RemoteHost

type RemoteHost struct {
	Addr string
	Port int
}

type RemoteHostFlag

type RemoteHostFlag []RemoteHost

func (*RemoteHostFlag) Set

func (rhf *RemoteHostFlag) Set(value string) error

func (*RemoteHostFlag) String

func (rhf *RemoteHostFlag) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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