sftp

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DupPermutationsRecursive0 added in v0.6.7

func DupPermutationsRecursive0(n, k int) [][]int

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 FileInfo added in v0.6.7

type FileInfo interface {
	fs.FileInfo
}

type FileInfos

type FileInfos []sftpFileInfo

FileInfos is []os.FileInfo.

type PathSet

type PathSet struct {
	Base      string
	PathSlice []string
}

PathSet struct at path data

type RunSftp

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

	// config
	Config conf.Config

	// Client
	Client map[string]*SftpConnect

	// Complete select client
	TargetClient map[string]*SftpConnect

	// ssh Run
	Run *sshl.Run

	//
	Permission bool

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

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

RunSftp struct sftp run

func (*RunSftp) Completer

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

Completer is sftp Shell mode function TODO(blacknon): PATH補完については、flagを見て対象のコマンドラインの初回だけ行わせるようにする(プロンプトが切り替わる度にflagをfalse or trueにすることで対処?)

func (*RunSftp) CreateModeComplete added in v0.6.7

func (r *RunSftp) CreateModeComplete() (p []prompt.Suggest)

CreateModeComplete return file permission modes suggest

func (*RunSftp) CreatePrompt

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

CreatePrompt return prompt string.

func (*RunSftp) Executor

func (r *RunSftp) Executor(command string)

Executor is sftp Shell mode function.

func (*RunSftp) GetLocalComplete

func (r *RunSftp) GetLocalComplete(path string)

GetLocalComplete set r.LocalComplete

func (*RunSftp) GetRemoteComplete

func (r *RunSftp) GetRemoteComplete(ishost, ispath, useTargetmap bool, path string) (confirmRemote bool)

GetRemoteComplete set r.RemoteComplete

func (*RunSftp) PathComplete

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

PathComplete return path complete data

func (*RunSftp) SortLsData

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

SortLsData is sort []os.FileInfo.

func (*RunSftp) Start

func (r *RunSftp) Start()

Start sftp shell

type SftpConnect

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

	// Output
	Output *output.Output

	// Current Directory
	Pwd string
}

SftpConnect struct at sftp client

type TargetConnectMap added in v0.6.7

type TargetConnectMap struct {
	SftpConnect

	// Target Path list
	Path []string
}

Jump to

Keyboard shortcuts

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