Documentation
¶
Overview ¶
Package sftp is a generated GoMock package.
Index ¶
- type Config
- type FileLog
- type FileSystem
- func (f *FileSystem) ChDir(_ string) error
- func (f *FileSystem) Connect()
- func (f *FileSystem) Create(name string) (file.File, error)
- func (f *FileSystem) Getwd() (string, error)
- func (f *FileSystem) Mkdir(name string, _ os.FileMode) error
- func (f *FileSystem) MkdirAll(path string, _ os.FileMode) error
- func (f *FileSystem) Open(name string) (file.File, error)
- func (f *FileSystem) OpenFile(name string, flag int, _ os.FileMode) (file.File, error)
- func (f *FileSystem) ReadDir(dir string) ([]file.FileInfo, error)
- func (f *FileSystem) Remove(name string) error
- func (f *FileSystem) RemoveAll(path string) error
- func (f *FileSystem) Rename(oldname, newname string) error
- func (f *FileSystem) Stat(name string) (file.FileInfo, error)
- func (f *FileSystem) UseLogger(logger any)
- func (f *FileSystem) UseMetrics(metrics any)
- type Logger
- type Metrics
- type MockLogger
- type MockLoggerMockRecorder
- func (mr *MockLoggerMockRecorder) Debug(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Debugf(pattern any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Errorf(pattern any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Logf(pattern any, args ...any) *gomock.Call
- type MockMetrics
- type MockMetricsMockRecorder
- type MocksftpClient
- func (m *MocksftpClient) Create(path string) (*sftp.File, error)
- func (m *MocksftpClient) EXPECT() *MocksftpClientMockRecorder
- func (m *MocksftpClient) Getwd() (string, error)
- func (m *MocksftpClient) Mkdir(path string) error
- func (m *MocksftpClient) MkdirAll(path string) error
- func (m *MocksftpClient) Open(path string) (*sftp.File, error)
- func (m *MocksftpClient) OpenFile(path string, f int) (*sftp.File, error)
- func (m *MocksftpClient) ReadDir(p string) ([]os.FileInfo, error)
- func (m *MocksftpClient) Remove(path string) error
- func (m *MocksftpClient) RemoveAll(path string) error
- func (m *MocksftpClient) Rename(oldname, newname string) error
- func (m *MocksftpClient) Stat(p string) (os.FileInfo, error)
- type MocksftpClientMockRecorder
- func (mr *MocksftpClientMockRecorder) Create(path any) *gomock.Call
- func (mr *MocksftpClientMockRecorder) Getwd() *gomock.Call
- func (mr *MocksftpClientMockRecorder) Mkdir(path any) *gomock.Call
- func (mr *MocksftpClientMockRecorder) MkdirAll(path any) *gomock.Call
- func (mr *MocksftpClientMockRecorder) Open(path any) *gomock.Call
- func (mr *MocksftpClientMockRecorder) OpenFile(path, f any) *gomock.Call
- func (mr *MocksftpClientMockRecorder) ReadDir(p any) *gomock.Call
- func (mr *MocksftpClientMockRecorder) Remove(path any) *gomock.Call
- func (mr *MocksftpClientMockRecorder) RemoveAll(path any) *gomock.Call
- func (mr *MocksftpClientMockRecorder) Rename(oldname, newname any) *gomock.Call
- func (mr *MocksftpClientMockRecorder) Stat(p any) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileLog ¶
type FileLog struct {
Operation string `json:"operation"`
Duration int64 `json:"duration"`
Status *string `json:"status"`
Location string `json:"location,omitempty"`
}
FileLog handles logging with different levels.
func (*FileLog) PrettyPrint ¶
type FileSystem ¶ added in v0.2.0
type FileSystem struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg Config) *FileSystem
func (*FileSystem) ChDir ¶ added in v0.2.0
func (f *FileSystem) ChDir(_ string) error
func (*FileSystem) Connect ¶ added in v0.2.0
func (f *FileSystem) Connect()
Connect establishes a connection to the SFTP server using the provided configuration.
func (*FileSystem) Create ¶ added in v0.2.0
func (f *FileSystem) Create(name string) (file.File, error)
func (*FileSystem) Getwd ¶ added in v0.2.0
func (f *FileSystem) Getwd() (string, error)
func (*FileSystem) Mkdir ¶ added in v0.2.0
func (f *FileSystem) Mkdir(name string, _ os.FileMode) error
func (*FileSystem) MkdirAll ¶ added in v0.2.0
func (f *FileSystem) MkdirAll(path string, _ os.FileMode) error
func (*FileSystem) ReadDir ¶ added in v0.2.0
func (f *FileSystem) ReadDir(dir string) ([]file.FileInfo, error)
func (*FileSystem) Remove ¶ added in v0.2.0
func (f *FileSystem) Remove(name string) error
func (*FileSystem) RemoveAll ¶ added in v0.2.0
func (f *FileSystem) RemoveAll(path string) error
func (*FileSystem) Rename ¶ added in v0.2.0
func (f *FileSystem) Rename(oldname, newname string) error
func (*FileSystem) Stat ¶ added in v0.2.0
func (f *FileSystem) Stat(name string) (file.FileInfo, error)
func (*FileSystem) UseLogger ¶ added in v0.2.0
func (f *FileSystem) UseLogger(logger any)
UseLogger sets the logger for the FileSystem client.
func (*FileSystem) UseMetrics ¶ added in v0.2.0
func (f *FileSystem) UseMetrics(metrics any)
UseMetrics sets the metrics for the FileSystem client.
type Logger ¶
type Logger interface {
Debug(args ...any)
Debugf(pattern string, args ...any)
Logf(pattern string, args ...any)
Errorf(pattern string, args ...any)
}
Logger interface is used by ftp package to log information about query execution.
type MockLogger ¶
type MockLogger struct {
// contains filtered or unexported fields
}
MockLogger is a mock of Logger interface.
func NewMockLogger ¶
func NewMockLogger(ctrl *gomock.Controller) *MockLogger
NewMockLogger creates a new mock instance.
func (*MockLogger) Debugf ¶
func (m *MockLogger) Debugf(pattern string, args ...any)
Debugf mocks base method.
func (*MockLogger) EXPECT ¶
func (m *MockLogger) EXPECT() *MockLoggerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLogger) Errorf ¶
func (m *MockLogger) Errorf(pattern string, args ...any)
Errorf mocks base method.
func (*MockLogger) Logf ¶
func (m *MockLogger) Logf(pattern string, args ...any)
Logf mocks base method.
type MockLoggerMockRecorder ¶
type MockLoggerMockRecorder struct {
// contains filtered or unexported fields
}
MockLoggerMockRecorder is the mock recorder for MockLogger.
func (*MockLoggerMockRecorder) Debug ¶
func (mr *MockLoggerMockRecorder) Debug(args ...any) *gomock.Call
Debug indicates an expected call of Debug.
func (*MockLoggerMockRecorder) Debugf ¶
func (mr *MockLoggerMockRecorder) Debugf(pattern any, args ...any) *gomock.Call
Debugf indicates an expected call of Debugf.
type MockMetrics ¶
type MockMetrics struct {
// contains filtered or unexported fields
}
MockMetrics is a mock of Metrics interface.
func NewMockMetrics ¶
func NewMockMetrics(ctrl *gomock.Controller) *MockMetrics
NewMockMetrics creates a new mock instance.
func (*MockMetrics) EXPECT ¶
func (m *MockMetrics) EXPECT() *MockMetricsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMetrics) NewHistogram ¶
func (m *MockMetrics) NewHistogram(name, desc string, buckets ...float64)
NewHistogram mocks base method.
func (*MockMetrics) RecordHistogram ¶
func (m *MockMetrics) RecordHistogram(ctx context.Context, name string, value float64, labels ...string)
RecordHistogram mocks base method.
type MockMetricsMockRecorder ¶
type MockMetricsMockRecorder struct {
// contains filtered or unexported fields
}
MockMetricsMockRecorder is the mock recorder for MockMetrics.
func (*MockMetricsMockRecorder) NewHistogram ¶
func (mr *MockMetricsMockRecorder) NewHistogram(name, desc any, buckets ...any) *gomock.Call
NewHistogram indicates an expected call of NewHistogram.
func (*MockMetricsMockRecorder) RecordHistogram ¶
func (mr *MockMetricsMockRecorder) RecordHistogram(ctx, name, value any, labels ...any) *gomock.Call
RecordHistogram indicates an expected call of RecordHistogram.
type MocksftpClient ¶
type MocksftpClient struct {
// contains filtered or unexported fields
}
MocksftpClient is a mock of sftpClient interface.
func NewMocksftpClient ¶
func NewMocksftpClient(ctrl *gomock.Controller) *MocksftpClient
NewMocksftpClient creates a new mock instance.
func (*MocksftpClient) Create ¶
func (m *MocksftpClient) Create(path string) (*sftp.File, error)
Create mocks base method.
func (*MocksftpClient) EXPECT ¶
func (m *MocksftpClient) EXPECT() *MocksftpClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MocksftpClient) Getwd ¶
func (m *MocksftpClient) Getwd() (string, error)
Getwd mocks base method.
func (*MocksftpClient) Mkdir ¶
func (m *MocksftpClient) Mkdir(path string) error
Mkdir mocks base method.
func (*MocksftpClient) MkdirAll ¶
func (m *MocksftpClient) MkdirAll(path string) error
MkdirAll mocks base method.
func (*MocksftpClient) Open ¶
func (m *MocksftpClient) Open(path string) (*sftp.File, error)
Open mocks base method.
func (*MocksftpClient) ReadDir ¶
func (m *MocksftpClient) ReadDir(p string) ([]os.FileInfo, error)
ReadDir mocks base method.
func (*MocksftpClient) Remove ¶
func (m *MocksftpClient) Remove(path string) error
Remove mocks base method.
func (*MocksftpClient) RemoveAll ¶
func (m *MocksftpClient) RemoveAll(path string) error
RemoveAll mocks base method.
func (*MocksftpClient) Rename ¶
func (m *MocksftpClient) Rename(oldname, newname string) error
Rename mocks base method.
type MocksftpClientMockRecorder ¶
type MocksftpClientMockRecorder struct {
// contains filtered or unexported fields
}
MocksftpClientMockRecorder is the mock recorder for MocksftpClient.
func (*MocksftpClientMockRecorder) Create ¶
func (mr *MocksftpClientMockRecorder) Create(path any) *gomock.Call
Create indicates an expected call of Create.
func (*MocksftpClientMockRecorder) Getwd ¶
func (mr *MocksftpClientMockRecorder) Getwd() *gomock.Call
Getwd indicates an expected call of Getwd.
func (*MocksftpClientMockRecorder) Mkdir ¶
func (mr *MocksftpClientMockRecorder) Mkdir(path any) *gomock.Call
Mkdir indicates an expected call of Mkdir.
func (*MocksftpClientMockRecorder) MkdirAll ¶
func (mr *MocksftpClientMockRecorder) MkdirAll(path any) *gomock.Call
MkdirAll indicates an expected call of MkdirAll.
func (*MocksftpClientMockRecorder) Open ¶
func (mr *MocksftpClientMockRecorder) Open(path any) *gomock.Call
Open indicates an expected call of Open.
func (*MocksftpClientMockRecorder) OpenFile ¶
func (mr *MocksftpClientMockRecorder) OpenFile(path, f any) *gomock.Call
OpenFile indicates an expected call of OpenFile.
func (*MocksftpClientMockRecorder) ReadDir ¶
func (mr *MocksftpClientMockRecorder) ReadDir(p any) *gomock.Call
ReadDir indicates an expected call of ReadDir.
func (*MocksftpClientMockRecorder) Remove ¶
func (mr *MocksftpClientMockRecorder) Remove(path any) *gomock.Call
Remove indicates an expected call of Remove.
func (*MocksftpClientMockRecorder) RemoveAll ¶
func (mr *MocksftpClientMockRecorder) RemoveAll(path any) *gomock.Call
RemoveAll indicates an expected call of RemoveAll.