dialer

package module
v0.0.0-...-df0c5a5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 7 Imported by: 0

README

dialer

一些常用的 Dialer (内部实现确定了是 tcp 还是 udp)

接口:

type Dialer interface {
	Dial(string) (net.Conn, error)
}

type ContextDialer interface {
	Dialer
	DialContext(context.Context, string) (net.Conn, error)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextDialer

type ContextDialer interface {
	Dialer
	DialContext(context.Context, string) (net.Conn, error)
}

func SSH

func SSH(uri, keyfile string) (dl ContextDialer, er error)

SSH 根据 ssh 连接和密钥文件路径, 创建 dialer

	登录模式:
		password - uri: "ssh://[user]:pass@host:[port]"
         user 默认为 `root`, port 默认为 `22`
     keypair  - uri: "ssh://[user]:[pass]@host:[port]"
         user 默认为 `root`, pass 是密钥的密码, port 默认为 `22`

type Dialer

type Dialer interface {
	Dial(string) (net.Conn, error)
}

Jump to

Keyboard shortcuts

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