mirror of
https://github.com/restic/restic.git
synced 2025-12-08 06:09:56 +00:00
Update vendored library github.com/pkg/sftp
This commit is contained in:
parent
d9ba9279e0
commit
19035e977b
27 changed files with 494 additions and 240 deletions
42
vendor/github.com/pkg/sftp/request-errors.go
generated
vendored
Normal file
42
vendor/github.com/pkg/sftp/request-errors.go
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package sftp
|
||||
|
||||
// Error types that match the SFTP's SSH_FXP_STATUS codes. Gives you more
|
||||
// direct control of the errors being sent vs. letting the library work them
|
||||
// out from the standard os/io errors.
|
||||
|
||||
type fxerr uint32
|
||||
|
||||
const (
|
||||
ErrSshFxOk = fxerr(ssh_FX_OK)
|
||||
ErrSshFxEof = fxerr(ssh_FX_EOF)
|
||||
ErrSshFxNoSuchFile = fxerr(ssh_FX_NO_SUCH_FILE)
|
||||
ErrSshFxPermissionDenied = fxerr(ssh_FX_PERMISSION_DENIED)
|
||||
ErrSshFxFailure = fxerr(ssh_FX_FAILURE)
|
||||
ErrSshFxBadMessage = fxerr(ssh_FX_BAD_MESSAGE)
|
||||
ErrSshFxNoConnection = fxerr(ssh_FX_NO_CONNECTION)
|
||||
ErrSshFxConnectionLost = fxerr(ssh_FX_CONNECTION_LOST)
|
||||
ErrSshFxOpUnsupported = fxerr(ssh_FX_OP_UNSUPPORTED)
|
||||
)
|
||||
|
||||
func (e fxerr) Error() string {
|
||||
switch e {
|
||||
case ErrSshFxOk:
|
||||
return "OK"
|
||||
case ErrSshFxEof:
|
||||
return "EOF"
|
||||
case ErrSshFxNoSuchFile:
|
||||
return "No Such File"
|
||||
case ErrSshFxPermissionDenied:
|
||||
return "Permission Denied"
|
||||
case ErrSshFxBadMessage:
|
||||
return "Bad Message"
|
||||
case ErrSshFxNoConnection:
|
||||
return "No Connection"
|
||||
case ErrSshFxConnectionLost:
|
||||
return "Connection Lost"
|
||||
case ErrSshFxOpUnsupported:
|
||||
return "Operation Unsupported"
|
||||
default:
|
||||
return "Failure"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue