Documentation ¶
Index ¶
- Constants
- func AuthKey(username string, auths []ssh.AuthMethod, keyCallBack ssh.HostKeyCallback) (ssh.ClientConfig, error)
- func PublicKey(file string) ssh.AuthMethod
- func PublicKeys(filenames []string) []ssh.AuthMethod
- func WithAgent(username string, keyCallBack ssh.HostKeyCallback) (ssh.ClientConfig, error)
- func WithKey(username string, path string, keyCallBack ssh.HostKeyCallback) (ssh.ClientConfig, error)
- func WithPassphrase(path string, passpharase []byte, username string, ...) (ssh.ClientConfig, error)
- func WithPassword(username string, password string, keyCallBack ssh.HostKeyCallback) (ssh.ClientConfig, error)
- type FileInfos
- type Response
- type ResponseType
- type Result
- type Scp
- func (scp *Scp) CopyFromRemote(localPath string, remotePath string) error
- func (scp *Scp) CopyFromRemoteByWriter(w io.Writer, remotePath string) error
- func (scp *Scp) CopyToRemote(id int, localPath string, remotePath string, permissions string) *Result
- func (scp *Scp) CopyToRemoteByReader(r io.Reader, size int64, remotePath string, permissions string) error
- func (scp *Scp) Session() (*ssh.Session, error)
- func (scp *Scp) WithRemoteCmd(cmd string) *Scp
- type Session
- type Sftp
Constants ¶
View Source
const KRemoteCmd = "scp"
Variables ¶
This section is empty.
Functions ¶
func AuthKey ¶
func AuthKey(username string, auths []ssh.AuthMethod, keyCallBack ssh.HostKeyCallback) (ssh.ClientConfig, error)
func PublicKey ¶
func PublicKey(file string) ssh.AuthMethod
func PublicKeys ¶
func PublicKeys(filenames []string) []ssh.AuthMethod
func WithAgent ¶
func WithAgent(username string, keyCallBack ssh.HostKeyCallback) (ssh.ClientConfig, error)
func WithKey ¶
func WithKey(username string, path string, keyCallBack ssh.HostKeyCallback) (ssh.ClientConfig, error)
func WithPassphrase ¶
func WithPassphrase(path string, passpharase []byte, username string, keyCallBack ssh.HostKeyCallback) (ssh.ClientConfig, error)
func WithPassword ¶
func WithPassword(username string, password string, keyCallBack ssh.HostKeyCallback) (ssh.ClientConfig, error)
Types ¶
type Response ¶
type Response struct { Type ResponseType Message string }
func (*Response) GetMessage ¶
GetMessage returns the message the remote sent back.
func (*Response) IsFailure ¶
IsFailure returns true when the remote answered with a warning or an error.
func (*Response) ParseFileInfos ¶
type ResponseType ¶
type ResponseType = uint8
const ( Ok ResponseType = 0 Warning ResponseType = 1 Error ResponseType = 2 )
type Scp ¶
type Scp struct {
// contains filtered or unexported fields
}
func (*Scp) CopyFromRemote ¶
func (*Scp) CopyFromRemoteByWriter ¶
CopyFromRemoteByWriter 下载
func (*Scp) CopyToRemote ¶
func (scp *Scp) CopyToRemote(id int, localPath string, remotePath string, permissions string) *Result
CopyToRemote 上传
func (*Scp) CopyToRemoteByReader ¶
func (*Scp) WithRemoteCmd ¶
Click to show internal directories.
Click to hide internal directories.