Documentation ¶
Index ¶
- Constants
- type Forward
- func NewForward(httpCtx *hfw.HTTPContext, t ForwardType, forwardConfig ForwardConfig) (l *Forward, err error)
- func NewLocalForward(httpCtx *hfw.HTTPContext, forwardConfig ForwardConfig) (l *Forward, err error)
- func NewRemoteForward(httpCtx *hfw.HTTPContext, forwardConfig ForwardConfig) (l *Forward, err error)
- type ForwardConfig
- type ForwardIni
- type ForwardType
- type Proxy
- type ProxyIni
- type SSH
- func (this *SSH) Check() (err error)
- func (this *SSH) Close()
- func (this *SSH) Config() SSHConfig
- func (this *SSH) Connect(addr string) (conn net.Conn, err error)
- func (this *SSH) Dial() (err error)
- func (this *SSH) DialRemote(sshConfig SSHConfig) (ins *SSH, err error)
- func (this *SSH) Exec(cmd string) (string, error)
- func (this *SSH) ExecWithPty(cmd string, timeout time.Duration) error
- func (this *SSH) GetReconnectionTime() int
- func (this *SSH) Listen(addr string) (l net.Listener, err error)
- func (this *SSH) ListenTCP(addr string) (l net.Listener, err error)
- func (this *SSH) Scp(src, des, exclude string) (err error)
- func (this *SSH) SetConfig(sshConfig SSHConfig)
- func (this *SSH) Shell() error
- type SSHConfig
Constants ¶
View Source
const ( //直连 NormalSSHMode sshMode = iota //通过跳板机 RemoteSSHMode )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Forward ¶
type Forward struct {
// contains filtered or unexported fields
}
func NewForward ¶
func NewForward(httpCtx *hfw.HTTPContext, t ForwardType, forwardConfig ForwardConfig) (l *Forward, err error)
func NewLocalForward ¶
func NewLocalForward(httpCtx *hfw.HTTPContext, forwardConfig ForwardConfig) (l *Forward, err error)
func NewRemoteForward ¶
func NewRemoteForward(httpCtx *hfw.HTTPContext, forwardConfig ForwardConfig) (l *Forward, err error)
func (*Forward) BindAndAccept ¶
func (l *Forward) BindAndAccept(c *SSH, fi ForwardIni)
type ForwardConfig ¶
type ForwardConfig struct { SSHConfig Inner map[string]ForwardIni Indirect map[string]ForwardConfig }
type ForwardIni ¶
type SSH ¶
type SSH struct {
// contains filtered or unexported fields
}
SSH ..
func (*SSH) DialRemote ¶
DialRemote 通过跳板连接其他服务器
func (*SSH) ExecWithPty ¶
一个Session只能执行一次,直接把结果输出到终端 不允许超过3s
func (*SSH) GetReconnectionTime ¶
type SSHConfig ¶
type SSHConfig struct { Id string `toml:"id"` Addr string `toml:"addr"` User string `toml:"user"` //证书和密码,可以共存 Certs []string `toml:"certs"` Passwords []string `toml:"passwords"` Timeout time.Duration `toml:"timeout"` SkipKeep bool `toml:"skipKeep"` //以下两个是兼容 Auth string `toml:"auth"` Phrase string `toml:"phrase"` }
SSHConfig ..
Click to show internal directories.
Click to hide internal directories.