cmd

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright © 2020 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	SSHConfig SSH
	// shell cmd
	CMDS string

	// cpoy path
	SourcePath string
	RemotePath string
	// fetch ; localpath
	DestPath string
)
View Source
var (
	Version    = "v1.1.0"
	Build      = ""
	VersionStr = fmt.Sprintf("sshrc version %v, build %v %v", Version, Build, runtime.Version())
)

Functions

func AddrReformat

func AddrReformat(host string) string

func Execute

func Execute()

Types

type SSH

type SSH struct {
	Host     []string
	User     string
	Password string
	PkFile   string
}

type SSHRConfig

type SSHRConfig struct {
	//sshconfig
	Host     []string
	User     string
	Password string
	PkFile   string
	Timeout  *time.Duration
}

func BuildInit

func BuildInit() *SSHRConfig

实例初始化,赋值

func (*SSHRConfig) Cmd

func (s *SSHRConfig) Cmd(host string) []byte

远程执行命令

func (*SSHRConfig) Connect

func (s *SSHRConfig) Connect(host string) (*ssh.Session, error)

func (*SSHRConfig) Copy

func (s *SSHRConfig) Copy(host string)

拷贝本地主机文件到远程主机

func (*SSHRConfig) Fetch

func (s *SSHRConfig) Fetch(host string)

拷贝远程主机文件到本地主机

Jump to

Keyboard shortcuts

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