funcs

package
v0.0.0-...-4cf9553 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CancelCommandTimeout = 25 * time.Second
)

Functions

func CloseAndWait

func CloseAndWait(stop, closed chan bool, timeout time.Duration) error

func Contains

func Contains(a []string, x string) bool

func CreateFileUploadRequest

func CreateFileUploadRequest(uri string, params map[string]string, paramName, path string, report func(r int64)) (*http.Request, error)

func Err

func Err(f string, args ...interface{}) error

func GetFilenameExtension

func GetFilenameExtension(path string) (ext string)

func GetPwd

func GetPwd() string

func GetTag

func GetTag() string

func GetWorkPath

func GetWorkPath() string

func Sprintf

func Sprintf(f string, args ...interface{}) string

Types

type ExecCmd

type ExecCmd struct {
	// contains filtered or unexported fields
}

func NewExecCmd

func NewExecCmd(wd string, stdout io.Writer) *ExecCmd

func (*ExecCmd) Cancel

func (e *ExecCmd) Cancel()

func (*ExecCmd) Exec

func (e *ExecCmd) Exec(args ...string) error

type LogConsole

type LogConsole struct {
	LogFile *os.File
	// contains filtered or unexported fields
}

func NewLogConsole

func NewLogConsole(write chan []byte, logPath string) *LogConsole

func (*LogConsole) Close

func (console *LogConsole) Close() error

func (*LogConsole) Write

func (console *LogConsole) Write(data []byte) (int, error)

type ProgressReader

type ProgressReader struct {
	io.Reader
	Reporter func(r int64)
}

func (*ProgressReader) Read

func (pr *ProgressReader) Read(p []byte) (n int, err error)

type ProgressWriter

type ProgressWriter struct {
	io.Writer
	Reporter func(r int64)
}

func (*ProgressWriter) Write

func (pr *ProgressWriter) Write(p []byte) (n int, err error)

type SSH

type SSH struct {
	Ip       string
	Port     int
	Username string
	Password string
	Key      string
	// contains filtered or unexported fields
}

func NewSSH

func NewSSH(ip, username, password, key string, port int, out io.Writer) (*SSH, error)

func (*SSH) Close

func (s *SSH) Close()

func (*SSH) Connect

func (s *SSH) Connect() error

func (*SSH) ExecCmd

func (s *SSH) ExecCmd(cmd string) error

func (*SSH) ExecMulti

func (s *SSH) ExecMulti(cmds ...string) error

func (*SSH) Put

func (s *SSH) Put(localFilePath string, remotePath string) error

Jump to

Keyboard shortcuts

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