Documentation
¶
Index ¶
- func Copy(dsts []io.Writer, src io.Reader) (int64, error)
- type Endpoint
- func (ep *Endpoint) Address() string
- func (ep *Endpoint) Close() error
- func (ep *Endpoint) CmdOutBytes(cmd string) ([]byte, error)
- func (ep *Endpoint) Copy() *Endpoint
- func (ep *Endpoint) Download(src, dest string) error
- func (ep *Endpoint) Find(querys ...string) bool
- func (ep *Endpoint) FindOr(querys ...string) bool
- func (ep *Endpoint) GetPasswords() ([]string, bool)
- func (ep *Endpoint) GetUsers() ([]string, bool)
- func (ep *Endpoint) Init(filename string) error
- func (ep *Endpoint) InitSSHClient() (err error)
- func (ep *Endpoint) Mask(endpoints ...*Endpoint)
- func (ep *Endpoint) SetPasswords(passwords ...string)
- func (ep *Endpoint) SetPseudo(pseudo bool)
- func (ep *Endpoint) SetTimeout(timeout int)
- func (ep *Endpoint) SetUsers(users ...string)
- func (ep *Endpoint) SetWriters(writers ...io.Writer)
- func (ep *Endpoint) StartTerminal() error
- func (ep *Endpoint) Upload(src, dest string, mode os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Endpoint ¶
type Endpoint struct {
Name string `yaml:"name"`
Host string `yaml:"host"`
IP string `yaml:"ip"`
Port string `yaml:"port"`
User string `yaml:"user"`
Users []string `yaml:"users"` // 多个用户
Password string `yaml:"password"`
Passwords []string `yaml:"passwords"` //密码列表
Key string `yaml:"key"`
QAs map[string]string `yaml:"qas"` //questions-answers
Pseudo bool `yaml:"pseudo"` // like "ssh -tt", Force pseudo-terminal allocation.
Timeout int `yaml:"timeout"`
Labels map[string]string `yaml:"labels"`
// contains filtered or unexported fields
}
Endpoint Endpoint !! users, passwords 仅在登陆认证时当user/password字段为空时使用
func NewEndpointWithValue ¶
func NewEndpointWithValue(name, host, ip, port, user, password, key string, writers ...io.Writer) *Endpoint
NewEndpointWithValue NewEndpointWithValue
func (*Endpoint) CmdOutBytes ¶
CmdOutBytes CmdOutBytes
func (*Endpoint) GetPasswords ¶
GetPasswords get passwords list if password is not null, then return password directly
func (*Endpoint) InitSSHClient ¶
InitSSHClient InitSSHClient
func (*Endpoint) SetPasswords ¶
SetPasswords set multi-password
func (*Endpoint) SetWriters ¶
SetWriters this method is useful in StartTerminal
func (*Endpoint) StartTerminal ¶
StartTerminal StartTerminal
Click to show internal directories.
Click to hide internal directories.