ssh

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 13 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
}

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

type LocalSession

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

func (*LocalSession) CombinedOutput

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

func (*LocalSession) Create

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

func (*LocalSession) Exists

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

func (*LocalSession) MakeDirAll

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

func (*LocalSession) Output

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

func (*LocalSession) OutputGrep

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

func (*LocalSession) ReadDir

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

func (*LocalSession) ReadFile

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

func (*LocalSession) Remove

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

func (*LocalSession) RemoveAll

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

func (*LocalSession) Run

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

func (*LocalSession) WriteString

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

type RemoteSession

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

func (*RemoteSession) Close

func (s *RemoteSession) Close() error

func (*RemoteSession) CombinedOutput

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

func (*RemoteSession) Connect

func (s *RemoteSession) Connect() error

func (*RemoteSession) Create

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

func (*RemoteSession) Exists

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

func (*RemoteSession) MakeDirAll

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

func (*RemoteSession) Output

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

func (*RemoteSession) OutputGrep

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

func (*RemoteSession) ReadDir

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

func (*RemoteSession) ReadFile

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

func (*RemoteSession) Reconnect

func (s *RemoteSession) Reconnect() error

func (*RemoteSession) Remove

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

func (*RemoteSession) RemoveAll

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

func (*RemoteSession) Run

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

func (*RemoteSession) WriteString

func (s *RemoteSession) 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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