sftp

package module
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package sftp is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	User            string
	Password        string
	Host            string
	Port            int
	HostKeyCallBack ssh.HostKeyCallback
}

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

func (fl *FileLog) PrettyPrint(writer io.Writer)

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) Open added in v0.2.0

func (f *FileSystem) Open(name string) (file.File, error)

func (*FileSystem) OpenFile added in v0.2.0

func (f *FileSystem) OpenFile(name string, flag int, _ os.FileMode) (file.File, 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 Metrics

type Metrics interface {
	NewHistogram(name, desc string, buckets ...float64)
	RecordHistogram(ctx context.Context, name string, value float64, labels ...string)
}

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) Debug

func (m *MockLogger) Debug(args ...any)

Debug mocks base method.

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.

func (*MockLoggerMockRecorder) Errorf

func (mr *MockLoggerMockRecorder) Errorf(pattern any, args ...any) *gomock.Call

Errorf indicates an expected call of Errorf.

func (*MockLoggerMockRecorder) Logf

func (mr *MockLoggerMockRecorder) Logf(pattern any, args ...any) *gomock.Call

Logf indicates an expected call of Logf.

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

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) OpenFile

func (m *MocksftpClient) OpenFile(path string, f int) (*sftp.File, error)

OpenFile 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.

func (*MocksftpClient) Stat

func (m *MocksftpClient) Stat(p string) (os.FileInfo, error)

Stat 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.

func (*MocksftpClientMockRecorder) Rename

func (mr *MocksftpClientMockRecorder) Rename(oldname, newname any) *gomock.Call

Rename indicates an expected call of Rename.

func (*MocksftpClientMockRecorder) Stat

Stat indicates an expected call of Stat.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址