ssh

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(name string, arg ...string) string

func Dir

func Dir(path string) string

func Exists

func Exists(path string) bool

func FileName

func FileName(path string) string

Types

type Cmd

type Cmd struct {
	Name string
	Arg  []string
}

type FileInfo

type FileInfo struct {
	Name string
	Path string
	// contains filtered or unexported fields
}

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

type LinuxLocalSession added in v1.0.3

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

func (*LinuxLocalSession) CombinedOutput added in v1.0.3

func (s *LinuxLocalSession) CombinedOutput(name string, arg ...string) ([]byte, error)

func (*LinuxLocalSession) Create added in v1.0.3

func (s *LinuxLocalSession) Create(name string) error

func (*LinuxLocalSession) Exists added in v1.0.3

func (s *LinuxLocalSession) Exists(path string) (bool, error)

func (*LinuxLocalSession) MakeDirAll added in v1.0.3

func (s *LinuxLocalSession) MakeDirAll(path string, perm os.FileMode) error

func (*LinuxLocalSession) Output added in v1.0.3

func (s *LinuxLocalSession) Output(name string, arg ...string) ([]byte, error)

func (*LinuxLocalSession) OutputGrep added in v1.0.3

func (s *LinuxLocalSession) OutputGrep(cmdList []Cmd) ([]byte, error)

func (*LinuxLocalSession) ReadDir added in v1.0.3

func (s *LinuxLocalSession) ReadDir(dir string) ([]FileInfo, error)

func (*LinuxLocalSession) ReadFile added in v1.0.3

func (s *LinuxLocalSession) ReadFile(fileName string) ([]byte, error)

func (*LinuxLocalSession) Remove added in v1.0.3

func (s *LinuxLocalSession) Remove(name string) error

func (*LinuxLocalSession) RemoveAll added in v1.0.3

func (s *LinuxLocalSession) RemoveAll(path string) error

func (*LinuxLocalSession) Run added in v1.0.3

func (s *LinuxLocalSession) Run(name string, arg ...string) error

func (*LinuxLocalSession) WriteString added in v1.0.3

func (s *LinuxLocalSession) WriteString(name string, data string, mode ...string) error

type LinuxRemoteSession added in v1.0.3

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

func (*LinuxRemoteSession) Close added in v1.0.3

func (s *LinuxRemoteSession) Close() error

func (*LinuxRemoteSession) CombinedOutput added in v1.0.3

func (s *LinuxRemoteSession) CombinedOutput(name string, arg ...string) ([]byte, error)

func (*LinuxRemoteSession) Connect added in v1.0.3

func (s *LinuxRemoteSession) Connect() error

func (*LinuxRemoteSession) Create added in v1.0.3

func (s *LinuxRemoteSession) Create(name string) error

func (*LinuxRemoteSession) Exists added in v1.0.3

func (s *LinuxRemoteSession) Exists(path string) (bool, error)

func (*LinuxRemoteSession) MakeDirAll added in v1.0.3

func (s *LinuxRemoteSession) MakeDirAll(path string, perm os.FileMode) error

func (*LinuxRemoteSession) Output added in v1.0.3

func (s *LinuxRemoteSession) Output(name string, arg ...string) ([]byte, error)

func (*LinuxRemoteSession) OutputGrep added in v1.0.3

func (s *LinuxRemoteSession) OutputGrep(cmdList []Cmd) ([]byte, error)

func (*LinuxRemoteSession) ReadDir added in v1.0.3

func (s *LinuxRemoteSession) ReadDir(dir string) ([]FileInfo, error)

func (*LinuxRemoteSession) ReadFile added in v1.0.3

func (s *LinuxRemoteSession) ReadFile(fileName string) ([]byte, error)

func (*LinuxRemoteSession) Reconnect added in v1.0.3

func (s *LinuxRemoteSession) Reconnect() error

func (*LinuxRemoteSession) Remove added in v1.0.3

func (s *LinuxRemoteSession) Remove(name string) error

func (*LinuxRemoteSession) RemoveAll added in v1.0.3

func (s *LinuxRemoteSession) RemoveAll(path string) error

func (*LinuxRemoteSession) Run added in v1.0.3

func (s *LinuxRemoteSession) Run(name string, arg ...string) error

func (*LinuxRemoteSession) WriteString added in v1.0.3

func (s *LinuxRemoteSession) WriteString(name string, data string, mode ...string) error

type Session

type Session interface {
	Run(name string, arg ...string) error
	Output(name string, arg ...string) ([]byte, error)
	CombinedOutput(name string, arg ...string) ([]byte, error)
	OutputGrep(cmdList []Cmd) ([]byte, error)
	Exists(path string) (bool, error)
	ReadFile(fileName string) ([]byte, error)
	ReadDir(dir string) ([]FileInfo, error)
	MakeDirAll(path string, perm os.FileMode) error
	Remove(name string) error
	RemoveAll(path string) error
	Create(name string) error
	WriteString(name string, data string, mode ...string) error
}

func NewSession

func NewSession(opt ...options.Option) (Session, error)

type SingleSession

type SingleSession struct {
	Session
	// contains filtered or unexported fields
}

func (SingleSession) CombinedOutput

func (s SingleSession) CombinedOutput(name string, arg ...string) ([]byte, error)

func (SingleSession) Create

func (s SingleSession) Create(name string) error

func (SingleSession) Exists

func (s SingleSession) Exists(path string) (bool, error)

func (SingleSession) MakeDirAll

func (s SingleSession) MakeDirAll(path string, perm os.FileMode) error

func (SingleSession) Output

func (s SingleSession) Output(name string, arg ...string) ([]byte, error)

func (SingleSession) OutputGrep

func (s SingleSession) OutputGrep(cmdList []Cmd) ([]byte, error)

func (SingleSession) ReadDir

func (s SingleSession) ReadDir(dir string) ([]FileInfo, error)

func (SingleSession) ReadFile

func (s SingleSession) ReadFile(fileName string) ([]byte, error)

func (SingleSession) Remove

func (s SingleSession) Remove(name string) error

func (SingleSession) RemoveAll

func (s SingleSession) RemoveAll(path string) error

func (SingleSession) Run

func (s SingleSession) Run(name string, arg ...string) error

func (SingleSession) WriteString

func (s SingleSession) WriteString(name string, data string, mode ...string) error

type WindowsLocalSession added in v1.1.1

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

func (*WindowsLocalSession) CombinedOutput added in v1.1.1

func (s *WindowsLocalSession) CombinedOutput(name string, arg ...string) ([]byte, error)

func (*WindowsLocalSession) Create added in v1.1.1

func (s *WindowsLocalSession) Create(name string) error

func (*WindowsLocalSession) Exists added in v1.1.1

func (s *WindowsLocalSession) Exists(path string) (bool, error)

func (*WindowsLocalSession) MakeDirAll added in v1.1.1

func (s *WindowsLocalSession) MakeDirAll(path string, perm os.FileMode) error

func (*WindowsLocalSession) Output added in v1.1.1

func (s *WindowsLocalSession) Output(name string, arg ...string) ([]byte, error)

func (*WindowsLocalSession) OutputGrep added in v1.1.1

func (s *WindowsLocalSession) OutputGrep(cmdList []Cmd) ([]byte, error)

func (*WindowsLocalSession) ReadDir added in v1.1.1

func (s *WindowsLocalSession) ReadDir(dir string) ([]FileInfo, error)

func (*WindowsLocalSession) ReadFile added in v1.1.1

func (s *WindowsLocalSession) ReadFile(fileName string) ([]byte, error)

func (*WindowsLocalSession) Remove added in v1.1.1

func (s *WindowsLocalSession) Remove(name string) error

func (*WindowsLocalSession) RemoveAll added in v1.1.1

func (s *WindowsLocalSession) RemoveAll(path string) error

func (*WindowsLocalSession) Run added in v1.1.1

func (s *WindowsLocalSession) Run(name string, arg ...string) error

func (*WindowsLocalSession) WriteString added in v1.1.1

func (s *WindowsLocalSession) WriteString(name string, data string, mode ...string) error

type WindowsRemoteSession added in v1.0.3

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

func (*WindowsRemoteSession) Close added in v1.0.3

func (s *WindowsRemoteSession) Close() error

func (*WindowsRemoteSession) CombinedOutput added in v1.0.3

func (s *WindowsRemoteSession) CombinedOutput(name string, arg ...string) ([]byte, error)

func (*WindowsRemoteSession) Connect added in v1.0.3

func (s *WindowsRemoteSession) Connect() error

func (*WindowsRemoteSession) Create added in v1.0.3

func (s *WindowsRemoteSession) Create(name string) error

func (*WindowsRemoteSession) Exists added in v1.0.3

func (s *WindowsRemoteSession) Exists(path string) (bool, error)

func (*WindowsRemoteSession) MakeDirAll added in v1.0.3

func (s *WindowsRemoteSession) MakeDirAll(path string, perm os.FileMode) error

func (*WindowsRemoteSession) Output added in v1.0.3

func (s *WindowsRemoteSession) Output(name string, arg ...string) ([]byte, error)

func (*WindowsRemoteSession) OutputGrep added in v1.0.3

func (s *WindowsRemoteSession) OutputGrep(cmdList []Cmd) ([]byte, error)

func (*WindowsRemoteSession) ReadDir added in v1.0.3

func (s *WindowsRemoteSession) ReadDir(dir string) ([]FileInfo, error)

func (*WindowsRemoteSession) ReadFile added in v1.0.3

func (s *WindowsRemoteSession) ReadFile(fileName string) ([]byte, error)

func (*WindowsRemoteSession) Reconnect added in v1.0.3

func (s *WindowsRemoteSession) Reconnect() error

func (*WindowsRemoteSession) Remove added in v1.0.3

func (s *WindowsRemoteSession) Remove(name string) error

func (*WindowsRemoteSession) RemoveAll added in v1.0.3

func (s *WindowsRemoteSession) RemoveAll(path string) error

func (*WindowsRemoteSession) Run added in v1.0.3

func (s *WindowsRemoteSession) Run(name string, arg ...string) error

func (*WindowsRemoteSession) WriteString added in v1.0.3

func (s *WindowsRemoteSession) WriteString(name string, data string, mode ...string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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