Documentation
¶
Index ¶
- Constants
- type FtpWriterJob
- type FtpWriterJobFactory
- type FtpWriterTask
- type FtpWriterTaskFactory
- type IFtpHelper
- type SftpHelperImpl
- func (h *SftpHelperImpl) DeleteFiles(fileSet map[string]bool) error
- func (h *SftpHelperImpl) GetAllFilesInDir(dirPath, fileName string) (map[string]bool, error)
- func (h *SftpHelperImpl) GetOutputStream(fileName string) (io.WriteCloser, error)
- func (h *SftpHelperImpl) LoginFtpServer(host, username, password string, port, timeout int) error
- func (h *SftpHelperImpl) LogoutFtpServer() error
- func (h *SftpHelperImpl) MkDirRecursive(dirPath string) error
- type StandardFtpHelperImpl
- func (h *StandardFtpHelperImpl) DeleteFiles(fileSet map[string]bool) error
- func (h *StandardFtpHelperImpl) GetAllFilesInDir(dirPath, fileName string) (map[string]bool, error)
- func (h *StandardFtpHelperImpl) GetOutputStream(fileName string) (io.WriteCloser, error)
- func (h *StandardFtpHelperImpl) LoginFtpServer(host, username, password string, port, timeout int) error
- func (h *StandardFtpHelperImpl) LogoutFtpServer() error
- func (h *StandardFtpHelperImpl) MkDirRecursive(dirPath string) error
Constants ¶
View Source
const ( KeyProtocol = "protocol" KeyHost = "host" KeyUsername = "username" KeyPassword = "password" KeyPort = "port" KeyTimeout = "timeout" KeyConnectPattern = "connectPattern" KeyPath = "path" // 通用writer参数 KeyFileName = "fileName" KeyWriteMode = "writeMode" KeyFieldDelimiter = "fieldDelimiter" KeyEncoding = "encoding" KeyCompress = "compress" KeyNullFormat = "nullFormat" KeyDateFormat = "dateFormat" KeyFileFormat = "fileFormat" KeyHeader = "header" KeySuffix = "suffix" )
配置键常量 - 与Java版本保持一致
View Source
const ( DefaultFtpPort = 21 DefaultSftpPort = 22 DefaultTimeout = 60000 // 毫秒 DefaultFtpConnectPattern = "PASV" DefaultFieldDelimiter = "," DefaultEncoding = "UTF-8" DefaultNullFormat = "\\N" DefaultFileFormat = "text" )
默认值常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FtpWriterJob ¶
type FtpWriterJob struct {
// contains filtered or unexported fields
}
FtpWriterJob FTP写入作业,复制Java版本的功能
func NewFtpWriterJob ¶
func NewFtpWriterJob() *FtpWriterJob
func (*FtpWriterJob) Destroy ¶
func (job *FtpWriterJob) Destroy() error
func (*FtpWriterJob) Init ¶
func (job *FtpWriterJob) Init(config config.Configuration) error
func (*FtpWriterJob) Post ¶
func (job *FtpWriterJob) Post() error
func (*FtpWriterJob) Prepare ¶
func (job *FtpWriterJob) Prepare() error
func (*FtpWriterJob) Split ¶
func (job *FtpWriterJob) Split(mandatoryNumber int) ([]config.Configuration, error)
type FtpWriterJobFactory ¶
type FtpWriterJobFactory struct{}
FtpWriterJobFactory 实现WriterJobFactory接口
func (*FtpWriterJobFactory) CreateWriterJob ¶
func (f *FtpWriterJobFactory) CreateWriterJob() plugin.WriterJob
type FtpWriterTask ¶
type FtpWriterTask struct {
// contains filtered or unexported fields
}
FtpWriterTask FTP写入任务
func NewFtpWriterTask ¶
func NewFtpWriterTask() *FtpWriterTask
func (*FtpWriterTask) Destroy ¶
func (task *FtpWriterTask) Destroy() error
func (*FtpWriterTask) Init ¶
func (task *FtpWriterTask) Init(config config.Configuration) error
func (*FtpWriterTask) Post ¶
func (task *FtpWriterTask) Post() error
func (*FtpWriterTask) Prepare ¶
func (task *FtpWriterTask) Prepare() error
func (*FtpWriterTask) StartWrite ¶
func (task *FtpWriterTask) StartWrite(recordReceiver plugin.RecordReceiver) error
type FtpWriterTaskFactory ¶
type FtpWriterTaskFactory struct{}
FtpWriterTaskFactory 实现WriterTaskFactory接口
func (*FtpWriterTaskFactory) CreateWriterTask ¶
func (f *FtpWriterTaskFactory) CreateWriterTask() plugin.WriterTask
type IFtpHelper ¶
type IFtpHelper interface {
LoginFtpServer(host, username, password string, port, timeout int) error
LogoutFtpServer() error
MkDirRecursive(dirPath string) error
GetAllFilesInDir(dirPath, fileName string) (map[string]bool, error)
DeleteFiles(fileSet map[string]bool) error
GetOutputStream(fileName string) (io.WriteCloser, error)
}
IFtpHelper 接口定义了FTP和SFTP操作的通用方法 - 与Java版本对应
type SftpHelperImpl ¶
type SftpHelperImpl struct {
// contains filtered or unexported fields
}
SftpHelperImpl 实现SFTP协议 - 对应Java版本SftpHelperImpl
func NewSftpHelperImpl ¶
func NewSftpHelperImpl() *SftpHelperImpl
func (*SftpHelperImpl) DeleteFiles ¶
func (h *SftpHelperImpl) DeleteFiles(fileSet map[string]bool) error
func (*SftpHelperImpl) GetAllFilesInDir ¶
func (h *SftpHelperImpl) GetAllFilesInDir(dirPath, fileName string) (map[string]bool, error)
func (*SftpHelperImpl) GetOutputStream ¶
func (h *SftpHelperImpl) GetOutputStream(fileName string) (io.WriteCloser, error)
func (*SftpHelperImpl) LoginFtpServer ¶
func (h *SftpHelperImpl) LoginFtpServer(host, username, password string, port, timeout int) error
func (*SftpHelperImpl) LogoutFtpServer ¶
func (h *SftpHelperImpl) LogoutFtpServer() error
func (*SftpHelperImpl) MkDirRecursive ¶
func (h *SftpHelperImpl) MkDirRecursive(dirPath string) error
type StandardFtpHelperImpl ¶
type StandardFtpHelperImpl struct {
// contains filtered or unexported fields
}
StandardFtpHelperImpl 实现标准FTP协议 - 对应Java版本StandardFtpHelperImpl
func NewStandardFtpHelperImpl ¶
func NewStandardFtpHelperImpl() *StandardFtpHelperImpl
func (*StandardFtpHelperImpl) DeleteFiles ¶
func (h *StandardFtpHelperImpl) DeleteFiles(fileSet map[string]bool) error
func (*StandardFtpHelperImpl) GetAllFilesInDir ¶
func (h *StandardFtpHelperImpl) GetAllFilesInDir(dirPath, fileName string) (map[string]bool, error)
func (*StandardFtpHelperImpl) GetOutputStream ¶
func (h *StandardFtpHelperImpl) GetOutputStream(fileName string) (io.WriteCloser, error)
func (*StandardFtpHelperImpl) LoginFtpServer ¶
func (h *StandardFtpHelperImpl) LoginFtpServer(host, username, password string, port, timeout int) error
func (*StandardFtpHelperImpl) LogoutFtpServer ¶
func (h *StandardFtpHelperImpl) LogoutFtpServer() error
func (*StandardFtpHelperImpl) MkDirRecursive ¶
func (h *StandardFtpHelperImpl) MkDirRecursive(dirPath string) error
Click to show internal directories.
Click to hide internal directories.