Documentation
¶
Index ¶
- func NewMultiKeyCallback(keys []string) (ssh.HostKeyCallback, error)
- type Client
- type ClientConfig
- type File
- type MockClient
- func (c *MockClient) Close() error
- func (c *MockClient) Delete(path string) error
- func (c *MockClient) Dir() string
- func (c *MockClient) ListFiles(dir string) ([]string, error)
- func (c *MockClient) Open(path string) (*File, error)
- func (c *MockClient) Ping() error
- func (c *MockClient) Reader(path string) (*File, error)
- func (c *MockClient) UploadFile(path string, contents io.ReadCloser) error
- func (c *MockClient) Walk(dir string, fn fs.WalkDirFunc) error
- type MultiKeyCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMultiKeyCallback ¶ added in v0.14.0
func NewMultiKeyCallback(keys []string) (ssh.HostKeyCallback, error)
Types ¶
type Client ¶
type ClientConfig ¶
type ClientConfig struct {
Hostname string
Username string
Password string
Timeout time.Duration
MaxConnections int
PacketSize int
// HostPublicKey configures an SSH public key to validate the remote server's host key.
// If provided, this key will be merged into HostPublicKeys.
// Deprecated: Use HostPublicKeys instead.
HostPublicKey string
// HostPublicKeys configures multiple SSH public keys to validate the remote server's host key.
// Any key provided in HostPublicKey will be appended to this list.
HostPublicKeys []string
// ClientPrivateKey must be a base64 encoded string
ClientPrivateKey string
ClientPrivateKeyPassword string // not base64 encoded
SkipChmodAfterUpload bool
SkipDirectoryCreation bool
SkipSyncAfterUpload bool
}
func (ClientConfig) HostKeys ¶ added in v0.14.0
func (cfg ClientConfig) HostKeys() []string
HostKeys returns the list of configured public keys to use for host key verification.
type File ¶
type File struct {
Filename string
Contents io.ReadCloser
// ModTime is a timestamp of when the last modification occurred
// to this file. The default will be the current UTC time.
ModTime time.Time
// contains filtered or unexported fields
}
File represents a fs.File object of a location on a SFTP server.
type MockClient ¶
type MockClient struct {
Err error
// contains filtered or unexported fields
}
func NewMockClient ¶
func NewMockClient(t *testing.T) *MockClient
func (*MockClient) Close ¶
func (c *MockClient) Close() error
func (*MockClient) Delete ¶
func (c *MockClient) Delete(path string) error
func (*MockClient) Dir ¶
func (c *MockClient) Dir() string
func (*MockClient) Ping ¶
func (c *MockClient) Ping() error
func (*MockClient) UploadFile ¶
func (c *MockClient) UploadFile(path string, contents io.ReadCloser) error
func (*MockClient) Walk ¶ added in v0.9.0
func (c *MockClient) Walk(dir string, fn fs.WalkDirFunc) error
type MultiKeyCallback ¶ added in v0.14.0
type MultiKeyCallback struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.
