sftp

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientReadFile added in v1.0.0

func ClientReadFile(client *Connect, file string) (string, error)

ClientReadFile read file from client.

Types

type ByName

type ByName struct{ FileInfos }

ByName is sort by name.

func (ByName) Len

func (fi ByName) Len() int

func (ByName) Less

func (fi ByName) Less(i, j int) bool

func (ByName) Swap

func (fi ByName) Swap(i, j int)

type BySize

type BySize struct{ FileInfos }

BySize is sort by size.

func (BySize) Len

func (fi BySize) Len() int

func (BySize) Less

func (fi BySize) Less(i, j int) bool

func (BySize) Swap

func (fi BySize) Swap(i, j int)

type ByTime

type ByTime struct{ FileInfos }

ByTime is sort by time.

func (ByTime) Len

func (fi ByTime) Len() int

func (ByTime) Less

func (fi ByTime) Less(i, j int) bool

func (ByTime) Swap

func (fi ByTime) Swap(i, j int)

type Connect

type Connect struct {
	// ssh connect
	Connect *sftp.Client

	// Output
	Output *output.Output

	// Current Directory
	Pwd string
}

Connect ...

type FileInfos

type FileInfos []os.FileInfo

FileInfos is []os.FileInfo.

type PathSet

type PathSet struct {
	Base      string
	PathSlice []string
}

PathSet ...

type RunSftp

type RunSftp struct {
	// select server
	SelectServer []string

	// config
	Config conf.Config

	// Client
	Client map[string]*Connect

	// ssh Run
	Run *sshl.Run

	// now not use. delete at 0.6.1
	Permission bool

	// progress bar
	Progress   *mpb.Progress
	ProgressWG *sync.WaitGroup

	// PathComplete
	RemoteComplete []prompt.Suggest
	LocalComplete  []prompt.Suggest
}

RunSftp ...

func (*RunSftp) Completer

func (r *RunSftp) Completer(t prompt.Document) []prompt.Suggest

Completer sftp Shell mode function.

func (*RunSftp) CreatePrompt

func (r *RunSftp) CreatePrompt() (p string, result bool)

CreatePrompt creates prompt.

func (*RunSftp) Executor

func (r *RunSftp) Executor(command string)

Executor sftp Shell mode function.

func (*RunSftp) GetLocalComplete

func (r *RunSftp) GetLocalComplete(path string)

GetLocalComplete ...

func (*RunSftp) GetRemoteComplete

func (r *RunSftp) GetRemoteComplete(path string)

GetRemoteComplete ...

func (*RunSftp) PathComplete

func (r *RunSftp) PathComplete(remote bool, num int, t prompt.Document) []prompt.Suggest

PathComplete ...

func (*RunSftp) SortLsData

func (r *RunSftp) SortLsData(c *cli.Context, files []os.FileInfo)

SortLsData sorts ...

func (*RunSftp) Start

func (r *RunSftp) Start(confpath string)

Start starts the sftp app.

Jump to

Keyboard shortcuts

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