Documentation
¶
Overview ¶
NOTE:
Index ¶
- func CheckIsDirPath(path string) (result bool, dir, base string)
- func DupPermutationsRecursive0(n, k int) [][]int
- func ExpandLocalPath(path string) (expandPaths []string, err error)
- func ExpandRemotePath(client *TargetConnectMap, path string) (expandPaths []string, err error)
- func GeneratePermWithUmask(defaultPerm, umask []string) fs.FileMode
- type ByName
- type BySize
- type ByTime
- type FileInfo
- type FileInfos
- type PathSet
- type RunSftp
- func (r *RunSftp) Completer(t prompt.Document) []prompt.Suggest
- func (r *RunSftp) CopyPathComplete(t prompt.Document) []prompt.Suggest
- func (r *RunSftp) CreateModeComplete() (p []prompt.Suggest)
- func (r *RunSftp) CreatePrompt() (p string, result bool)
- func (r *RunSftp) CreateSyncPrefixComplete() []prompt.Suggest
- func (r *RunSftp) Executor(command string)
- func (r *RunSftp) GetLocalComplete(path string)
- func (r *RunSftp) GetRemoteComplete(ishost, ispath, useTargetmap bool, path string) (confirmRemote bool)
- func (r *RunSftp) PathComplete(remote, local, useTargetmap bool, t prompt.Document) []prompt.Suggest
- func (r *RunSftp) SortLsData(c *cli.Context, files []sftpFileInfo)
- func (r *RunSftp) Start()
- type SftpConnect
- type TargetConnectMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIsDirPath ¶
CheckIsDirPath return path specifies a directory. This function working only local machine.
func ExpandLocalPath ¶
Pass path including tilde etc., expand it as local machine PATH and return
func ExpandRemotePath ¶
func ExpandRemotePath(client *TargetConnectMap, path string) (expandPaths []string, err error)
Pass path including tilde etc., expand it as local machine PATH and return
func GeneratePermWithUmask ¶
A function that returns the value of fs.Filemode from the permissions and umask passed in an array. ex)
defaultPerm ... [0,7,7,7] umask ... [0,2,2]
Types ¶
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
// ControlMasterOverride temporarily overrides the config value for this
// command execution.
ControlMasterOverride *bool
DryRun bool
AutoReconnect bool
//
Permission bool
// local umask. [000-777]
LocalUmask []string
// progress bar
Progress *mpb.Progress
ProgressWG *sync.WaitGroup
// PathComplete
RemoteComplete []prompt.Suggest
LocalComplete []prompt.Suggest
// contains filtered or unexported fields
}
RunSftp struct sftp run
func (*RunSftp) Completer ¶
Completer is sftp Shell mode function TODO(blacknon): PATH補完については、flagを見て対象のコマンドラインの初回だけ行わせるようにする(プロンプトが切り替わる度にflagをfalse or trueにすることで対処?)
func (*RunSftp) CopyPathComplete ¶
func (*RunSftp) CreateModeComplete ¶
CreateModeComplete return file permission modes suggest
func (*RunSftp) CreatePrompt ¶
CreatePrompt return prompt string.
func (*RunSftp) CreateSyncPrefixComplete ¶ added in v0.8.0
func (*RunSftp) GetLocalComplete ¶
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 ¶
SortLsData is sort []os.FileInfo.
type SftpConnect ¶
type SftpConnect struct {
Server string
// ssh connect
SshConnect *sshlib.Connect
// sftp connect
Connect *sftp.Client
// Output
Output *output.Output
// Current Directory
Pwd string
Connected bool
LastError string
}
SftpConnect struct at sftp client
type TargetConnectMap ¶
type TargetConnectMap struct {
SftpConnect
// Target Path list
Path []string
}
Source Files
¶
- cmd.go
- cmd_cat.go
- cmd_cd.go
- cmd_chgrp.go
- cmd_chmod.go
- cmd_chown.go
- cmd_copy.go
- cmd_df.go
- cmd_get.go
- cmd_lls.go
- cmd_ln.go
- cmd_ls.go
- cmd_ltree.go
- cmd_lumask.go
- cmd_mkdir.go
- cmd_put.go
- cmd_pwd.go
- cmd_rename.go
- cmd_rm.go
- cmd_rmdir.go
- cmd_symlink.go
- cmd_sync.go
- cmd_tree.go
- common.go
- common_unix.go
- main.go
- path_resolution.go
- shell.go