ssh

package
v0.0.0-...-b4442d7 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandSuccess = "success"
	CommandFailed  = "failed"
)
View Source
const (
	StateSuccess = 1
	StateFailed  = 0
	StateRun     = 2
)

Variables

This section is empty.

Functions

func WriteFile

func WriteFile(filePath string, data string)

Types

type SSHManager

type SSHManager struct {
	CurCommandIndex string
	CurCommand      string
	File            string
	PrivateKey      []byte
	// contains filtered or unexported fields
}

func NewSSH

func NewSSH(File string, PrivateKey []byte) *SSHManager

func (*SSHManager) Close

func (s *SSHManager) Close()

func (*SSHManager) Connect

func (s *SSHManager) Connect(user string, address string)

address ip+":22"

func (*SSHManager) WaitFinish

func (s *SSHManager) WaitFinish() error

func (*SSHManager) Write

func (s *SSHManager) Write(cmd string) string

Jump to

Keyboard shortcuts

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