Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateConfCmd = &cobra.Command{ Use: "cliconf", GroupID: "exec", Short: "生成主机端的默认yaml配置文件", Run: func(cmd *cobra.Command, args []string) { CreateConfigFile(path) }, Example: "portmap_linux_amd64 cliconf -p config.yaml", }
View Source
var RunCmd = &cobra.Command{ Use: "clirun", GroupID: "exec", Short: "执行主机端端口映射程序", Run: func(cmd *cobra.Command, args []string) { LoadConfigFromFile(confPath) instance := NewInstance(config) instance.Run() }, Example: "portmap_linux_amd64 clirun -c config.yaml", }
Functions ¶
func CreateConfigFile ¶
func CreateConfigFile(path string)
func LoadConfigFromFile ¶
func LoadConfigFromFile(path string)
Types ¶
type Instance ¶
func NewInstance ¶
func NewInstance(config InstanceConfig) *Instance
func (*Instance) ConnectToServer ¶
func (i *Instance) ConnectToServer()
ConnectToServer 向服务器发起连接,并发送新主机密文 如果未能连接,将会不断重试,重试时间由配置文件指明
Click to show internal directories.
Click to hide internal directories.