2025-10-24 04:55:10 +01:00
|
|
|
package sftp
|
|
|
|
|
|
|
|
|
|
import (
|
2025-10-30 14:18:37 +00:00
|
|
|
"time"
|
|
|
|
|
|
2025-10-24 04:55:10 +01:00
|
|
|
"github.com/pkg/sftp"
|
|
|
|
|
)
|
|
|
|
|
|
2025-10-25 09:24:50 +01:00
|
|
|
// Medium implements the io.Medium interface for the SFTP protocol.
|
2025-10-24 04:55:10 +01:00
|
|
|
type Medium struct {
|
|
|
|
|
client *sftp.Client
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ConnectionConfig holds the necessary details to connect to an SFTP server.
|
|
|
|
|
type ConnectionConfig struct {
|
|
|
|
|
Host string
|
|
|
|
|
Port string
|
|
|
|
|
User string
|
|
|
|
|
Password string // For password-based auth
|
|
|
|
|
KeyFile string // Path to a private key for key-based auth
|
2025-10-30 14:18:37 +00:00
|
|
|
|
|
|
|
|
// Timeout specifies the duration for the network connection. If set to 0,
|
|
|
|
|
// a default timeout of 30 seconds will be used.
|
|
|
|
|
Timeout time.Duration
|
2025-10-24 04:55:10 +01:00
|
|
|
}
|