Documentation
¶
Index ¶
- Variables
- func NewAuthMethodFromPrivateKey(privateKey []byte) (ssh.AuthMethod, error)
- func NewAuthMethodFromPrivateKeyFile(privateKeyFile string) (ssh.AuthMethod, error)
- type HTTPInterceptor
- type HTTPResource
- type ISftpClient
- type LocalResource
- func (r *LocalResource) Close(_ context.Context) error
- func (r *LocalResource) GetID() string
- func (r *LocalResource) Open(_ context.Context) error
- func (r *LocalResource) Read(p []byte) (n int, err error)
- func (r *LocalResource) WithDefaultFileMode() *LocalResource
- func (r *LocalResource) WithFileMode(fileMode fs.FileMode) *LocalResource
- func (r *LocalResource) WithFlag(flag int) *LocalResource
- func (r *LocalResource) WithWriteFlag() *LocalResource
- func (r *LocalResource) Write(p []byte) (n int, err error)
- type MemoryResource
- func (r *MemoryResource) Close(_ context.Context) error
- func (r *MemoryResource) GetData() []byte
- func (r *MemoryResource) GetID() string
- func (r *MemoryResource) Open(_ context.Context) error
- func (r *MemoryResource) Read(p []byte) (n int, err error)
- func (r *MemoryResource) Write(p []byte) (n int, err error)
- type SSHServer
- type SftpClient
- type SftpResource
- func (r *SftpResource) Close(ctx context.Context) error
- func (r *SftpResource) GetID() string
- func (r *SftpResource) Open(ctx context.Context) error
- func (r *SftpResource) Read(p []byte) (n int, err error)
- func (r *SftpResource) WithFlag(flag int) *SftpResource
- func (r *SftpResource) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrResourceNotOpened = errors.New("resource not opened")
Functions ¶
func NewAuthMethodFromPrivateKey ¶
func NewAuthMethodFromPrivateKey(privateKey []byte) (ssh.AuthMethod, error)
func NewAuthMethodFromPrivateKeyFile ¶
func NewAuthMethodFromPrivateKeyFile(privateKeyFile string) (ssh.AuthMethod, error)
Types ¶
type HTTPInterceptor ¶
type HTTPInterceptor struct { Headers map[string]string Delegate http.RoundTripper }
type HTTPResource ¶
type HTTPResource struct {
// contains filtered or unexported fields
}
func NewHTTPResource ¶
func NewHTTPResource( logger *slog.Logger, url string, ) *HTTPResource
func (*HTTPResource) GetID ¶
func (r *HTTPResource) GetID() string
func (*HTTPResource) WithRequestTimeout ¶
func (r *HTTPResource) WithRequestTimeout(timeout time.Duration) *HTTPResource
type ISftpClient ¶
type LocalResource ¶
type LocalResource struct { Logger *slog.Logger FilePath string Flag int FileMode fs.FileMode // contains filtered or unexported fields }
func NewLocalResource ¶
func NewLocalResource( logger *slog.Logger, filePath string, ) *LocalResource
func (*LocalResource) GetID ¶
func (r *LocalResource) GetID() string
func (*LocalResource) WithDefaultFileMode ¶
func (r *LocalResource) WithDefaultFileMode() *LocalResource
func (*LocalResource) WithFileMode ¶
func (r *LocalResource) WithFileMode(fileMode fs.FileMode) *LocalResource
func (*LocalResource) WithFlag ¶
func (r *LocalResource) WithFlag(flag int) *LocalResource
func (*LocalResource) WithWriteFlag ¶
func (r *LocalResource) WithWriteFlag() *LocalResource
type MemoryResource ¶
type MemoryResource struct {
// contains filtered or unexported fields
}
func NewMemoryResource ¶
func NewMemoryResource( logger *slog.Logger, identifier string, ) *MemoryResource
func (*MemoryResource) GetData ¶
func (r *MemoryResource) GetData() []byte
func (*MemoryResource) GetID ¶
func (r *MemoryResource) GetID() string
type SSHServer ¶
type SSHServer struct {
// contains filtered or unexported fields
}
func NewSSHServer ¶
func NewSSHServer( address string, config *ssh.ClientConfig, ) *SSHServer
type SftpClient ¶
type SftpClient struct {
// contains filtered or unexported fields
}
resource on sftp server
func NewSftpClient ¶
func NewSftpClient(logger *slog.Logger, destServer *SSHServer) *SftpClient
type SftpResource ¶
type SftpResource struct {
// contains filtered or unexported fields
}
resource on sftp server
func NewSftpResource ¶
func NewSftpResource(logger *slog.Logger, client ISftpClient, filePath string) *SftpResource
func (*SftpResource) GetID ¶
func (r *SftpResource) GetID() string
func (*SftpResource) WithFlag ¶
func (r *SftpResource) WithFlag(flag int) *SftpResource
Click to show internal directories.
Click to hide internal directories.