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 Option
- type Path
- type Response
- type ResponseType
- type Result
- type Scp
- func (scp *Scp) Close()
- func (scp *Scp) ReceiveFrom(opt *Option) error
- func (scp *Scp) ReceiveFromByWriter(dst io.Writer, opt *Option) error
- func (scp *Scp) SendTo(id int, opt *Option) *Result
- func (scp *Scp) SendToByReader(src io.Reader, size int64, opt *Option, remoteFilename string) error
- func (scp *Scp) WithCmd(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) ReceiveFrom ¶ added in v1.1.11
func (*Scp) ReceiveFromByWriter ¶ added in v1.1.11
ReceiveFromByWriter 下载
func (*Scp) SendToByReader ¶ added in v1.1.11
Click to show internal directories.
Click to hide internal directories.