Documentation
¶
Index ¶
- Constants
- Variables
- func DateMove(progress *Progress, from DataSource, to DataSource) (err error)
- func New(options *Options) (t *task.Task, err error)
- func ValidateDataType(dataType DataType) (err error)
- type Column
- type Data
- type DataSource
- type DataSourceBase
- func (this_ *DataSourceBase) DataToValues(progress *Progress, data map[string]interface{}) (res []interface{}, err error)
- func (this_ *DataSourceBase) GetColumnList() []*Column
- func (this_ *DataSourceBase) GetColumnNames() []string
- func (this_ *DataSourceBase) GetDialectColumnList() []*dialect.ColumnModel
- func (this_ *DataSourceBase) GetStringValueByScript(script string) (res string, err error)
- func (this_ *DataSourceBase) GetValueByScript(script string) (interface{}, error)
- func (this_ *DataSourceBase) SetScriptContext(key string, value interface{})
- func (this_ *DataSourceBase) SetScriptContextData(data map[string]interface{})
- func (this_ *DataSourceBase) ValuesToData(progress *Progress, cols []interface{}) (data map[string]interface{}, err error)
- func (this_ *DataSourceBase) ValuesToValues(progress *Progress, cols []interface{}) (res []interface{}, err error)
- type DataSourceConfig
- func (this_ *DataSourceConfig) GetDialect() dialect.Dialect
- func (this_ *DataSourceConfig) GetDialectParam() *dialect.ParamModel
- func (this_ *DataSourceConfig) GetFileName() string
- func (this_ *DataSourceConfig) GetTxtFileType() string
- func (this_ *DataSourceConfig) IsData() bool
- func (this_ *DataSourceConfig) IsDb() bool
- func (this_ *DataSourceConfig) IsEs() bool
- func (this_ *DataSourceConfig) IsExcel() bool
- func (this_ *DataSourceConfig) IsKafka() bool
- func (this_ *DataSourceConfig) IsRedis() bool
- func (this_ *DataSourceConfig) IsScript() bool
- func (this_ *DataSourceConfig) IsSql() bool
- func (this_ *DataSourceConfig) IsTxt() bool
- type DataSourceData
- func (this_ *DataSourceData) GetDataList() []map[string]interface{}
- func (this_ *DataSourceData) Read(progress *Progress, dataChan chan *Data) (err error)
- func (this_ *DataSourceData) ReadEnd(progress *Progress) (err error)
- func (this_ *DataSourceData) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceData) Stop(progress *Progress)
- func (this_ *DataSourceData) Write(progress *Progress, data *Data) (err error)
- func (this_ *DataSourceData) WriteEnd(progress *Progress) (err error)
- func (this_ *DataSourceData) WriteStart(progress *Progress) (err error)
- type DataSourceDataParam
- type DataSourceDb
- func (this_ *DataSourceDb) GetParam() *dialect.ParamModel
- func (this_ *DataSourceDb) Read(progress *Progress, dataChan chan *Data) (err error)
- func (this_ *DataSourceDb) ReadEnd(progress *Progress) (err error)
- func (this_ *DataSourceDb) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceDb) Stop(progress *Progress)
- func (this_ *DataSourceDb) Write(progress *Progress, data *Data) (err error)
- func (this_ *DataSourceDb) WriteEnd(progress *Progress) (err error)
- func (this_ *DataSourceDb) WriteStart(progress *Progress) (err error)
- type DataSourceDbParam
- type DataSourceEs
- func (this_ *DataSourceEs) Read(progress *Progress, dataChan chan *Data) (err error)
- func (this_ *DataSourceEs) ReadEnd(progress *Progress) (err error)
- func (this_ *DataSourceEs) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceEs) Stop(progress *Progress)
- func (this_ *DataSourceEs) Write(progress *Progress, data *Data) (err error)
- func (this_ *DataSourceEs) WriteEnd(progress *Progress) (err error)
- func (this_ *DataSourceEs) WriteStart(progress *Progress) (err error)
- type DataSourceEsParam
- type DataSourceExcel
- func (this_ *DataSourceExcel) CloseReadFile()
- func (this_ *DataSourceExcel) CloseWriteFile()
- func (this_ *DataSourceExcel) GetReadFile() (file *xlsx.File, err error)
- func (this_ *DataSourceExcel) GetWriteFile() (file *xlsx.File, err error)
- func (this_ *DataSourceExcel) Read(progress *Progress, dataChan chan *Data) (err error)
- func (this_ *DataSourceExcel) ReadEnd(progress *Progress) (err error)
- func (this_ *DataSourceExcel) ReadLineCount() (lineCount int64, err error)
- func (this_ *DataSourceExcel) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceExcel) Stop(progress *Progress)
- func (this_ *DataSourceExcel) Write(progress *Progress, data *Data) (err error)
- func (this_ *DataSourceExcel) WriteEnd(progress *Progress) (err error)
- func (this_ *DataSourceExcel) WriteStart(progress *Progress) (err error)
- type DataSourceExcelParam
- type DataSourceFile
- func (this_ *DataSourceFile) CloseReadFile()
- func (this_ *DataSourceFile) CloseWriteFile()
- func (this_ *DataSourceFile) GetFilePath() string
- func (this_ *DataSourceFile) GetReadFile() (file *os.File, err error)
- func (this_ *DataSourceFile) GetWriteBuf() (bufWriter *bufio.Writer, err error)
- func (this_ *DataSourceFile) GetWriteFile() (file *os.File, err error)
- func (this_ *DataSourceFile) ReadEnd(progress *Progress) (err error)
- func (this_ *DataSourceFile) ReadLineCount() (lineCount int64, err error)
- func (this_ *DataSourceFile) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceFile) Stop(progress *Progress)
- func (this_ *DataSourceFile) WriteEnd(progress *Progress) (err error)
- func (this_ *DataSourceFile) WriteStart(progress *Progress) (err error)
- type DataSourceKafka
- func (this_ *DataSourceKafka) Read(progress *Progress, dataChan chan *Data) (err error)
- func (this_ *DataSourceKafka) ReadEnd(progress *Progress) (err error)
- func (this_ *DataSourceKafka) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceKafka) Stop(progress *Progress)
- func (this_ *DataSourceKafka) Write(progress *Progress, data *Data) (err error)
- func (this_ *DataSourceKafka) WriteEnd(progress *Progress) (err error)
- func (this_ *DataSourceKafka) WriteStart(progress *Progress) (err error)
- type DataSourceKafkaParam
- type DataSourceRedis
- func (this_ *DataSourceRedis) Read(progress *Progress, dataChan chan *Data) (err error)
- func (this_ *DataSourceRedis) ReadEnd(progress *Progress) (err error)
- func (this_ *DataSourceRedis) ReadKey(progress *Progress, dataChan chan *Data, database int, key string, ...) (err error)
- func (this_ *DataSourceRedis) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceRedis) Stop(progress *Progress)
- func (this_ *DataSourceRedis) Write(progress *Progress, data *Data) (err error)
- func (this_ *DataSourceRedis) WriteEnd(progress *Progress) (err error)
- func (this_ *DataSourceRedis) WriteStart(progress *Progress) (err error)
- type DataSourceRedisParam
- type DataSourceScript
- func (this_ *DataSourceScript) Read(progress *Progress, dataChan chan *Data) (err error)
- func (this_ *DataSourceScript) ReadEnd(progress *Progress) (err error)
- func (this_ *DataSourceScript) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceScript) Stop(progress *Progress)
- func (this_ *DataSourceScript) Write(progress *Progress, data *Data) (err error)
- func (this_ *DataSourceScript) WriteEnd(progress *Progress) (err error)
- func (this_ *DataSourceScript) WriteStart(progress *Progress) (err error)
- type DataSourceScriptParam
- type DataSourceSql
- func (this_ *DataSourceSql) GetDialect() dialect.Dialect
- func (this_ *DataSourceSql) GetParam() *dialect.ParamModel
- func (this_ *DataSourceSql) Read(progress *Progress, dataChan chan *Data) (err error)
- func (this_ *DataSourceSql) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceSql) Write(progress *Progress, data *Data) (err error)
- func (this_ *DataSourceSql) WriteStart(progress *Progress) (err error)
- type DataSourceSqlParam
- type DataSourceTxt
- func (this_ *DataSourceTxt) GetColSeparator() string
- func (this_ *DataSourceTxt) Read(progress *Progress, dataChan chan *Data) (err error)
- func (this_ *DataSourceTxt) ReadStart(progress *Progress) (err error)
- func (this_ *DataSourceTxt) ReadTitles(progress *Progress) (titles []string, err error)
- func (this_ *DataSourceTxt) StringsToValues(progress *Progress, cols []string) (res []interface{}, err error)
- func (this_ *DataSourceTxt) ValuesToStrings(progress *Progress, cols []interface{}) (res []string, err error)
- func (this_ *DataSourceTxt) Write(progress *Progress, data *Data) (err error)
- type DataSourceTxtParam
- type DataType
- type DbColumn
- type DbOwner
- type DbTable
- type Executor
- type Options
- type Progress
- type ProgressCount
- type SqlAndParam
Constants ¶
View Source
const ( DataTypeEmpty = 0 DataTypeCols = 1 // 列数据 DataTypeSql = 2 // SQL 语句 DataTypeSqlAndParams = 3 // 带占位符的SQL语句 )
Variables ¶
View Source
var (
ErrorStopped = errors.New(`task stopped`)
)
Functions ¶
func DateMove ¶
func DateMove(progress *Progress, from DataSource, to DataSource) (err error)
func ValidateDataType ¶
Types ¶
type Column ¶
type Column struct { *dialect.ColumnModel Value string `json:"value,omitempty"` SubProperty bool `json:"subProperty,omitempty"` }
type Data ¶
type Data struct { Total int64 `json:"total,omitempty"` DataType DataType `json:"dataType,omitempty"` ColsList [][]interface{} `json:"colsList,omitempty"` SqlList []string `json:"sqlList,omitempty"` SqlAndParams []*SqlAndParam `json:"sqlAndParams,omitempty"` // contains filtered or unexported fields }
type DataSource ¶
type DataSource interface { Stop(progress *Progress) ReadStart(progress *Progress) (err error) Read(progress *Progress, dataChan chan *Data) (err error) ReadEnd(progress *Progress) (err error) WriteStart(progress *Progress) (err error) Write(progress *Progress, data *Data) (err error) WriteEnd(progress *Progress) (err error) }
type DataSourceBase ¶
type DataSourceBase struct { ColumnList []*Column ScriptContext map[string]interface{} FillColumn bool `json:"fillColumn,omitempty"` // contains filtered or unexported fields }
func NewDataSourceBase ¶ added in v1.2.3
func NewDataSourceBase(columnList []*Column) *DataSourceBase
func (*DataSourceBase) DataToValues ¶
func (this_ *DataSourceBase) DataToValues(progress *Progress, data map[string]interface{}) (res []interface{}, err error)
func (*DataSourceBase) GetColumnList ¶ added in v1.2.3
func (this_ *DataSourceBase) GetColumnList() []*Column
func (*DataSourceBase) GetColumnNames ¶
func (this_ *DataSourceBase) GetColumnNames() []string
func (*DataSourceBase) GetDialectColumnList ¶
func (this_ *DataSourceBase) GetDialectColumnList() []*dialect.ColumnModel
func (*DataSourceBase) GetStringValueByScript ¶ added in v1.2.2
func (this_ *DataSourceBase) GetStringValueByScript(script string) (res string, err error)
func (*DataSourceBase) GetValueByScript ¶ added in v1.2.2
func (this_ *DataSourceBase) GetValueByScript(script string) (interface{}, error)
func (*DataSourceBase) SetScriptContext ¶ added in v1.2.2
func (this_ *DataSourceBase) SetScriptContext(key string, value interface{})
func (*DataSourceBase) SetScriptContextData ¶ added in v1.2.3
func (this_ *DataSourceBase) SetScriptContextData(data map[string]interface{})
func (*DataSourceBase) ValuesToData ¶
func (this_ *DataSourceBase) ValuesToData(progress *Progress, cols []interface{}) (data map[string]interface{}, err error)
func (*DataSourceBase) ValuesToValues ¶
func (this_ *DataSourceBase) ValuesToValues(progress *Progress, cols []interface{}) (res []interface{}, err error)
type DataSourceConfig ¶
type DataSourceConfig struct { *dialect.ParamModel Type string `json:"type,omitempty"` SqlFileMergeType string `json:"sqlFileMergeType,omitempty"` // SQL 的文件合并类型 如:one:一个文件, owner:每个库一个文件,table:每个表一个文件 DataSourceSqlParam DataSourceTxtParam DataSourceScriptParam DataSourceRedisParam DataSourceExcelParam DataSourceKafkaParam DataSourceEsParam BySql bool `json:"bySql,omitempty"` // 根据 SQL 语句导出 DataSourceDbParam DataSourceDataParam TxtFileType string `json:"txtFileType,omitempty"` // // 数据库 配置 DbConfig *db.Config `json:"-"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` EsConfig *elasticsearch.Config `json:"-"` RedisConfig *redis.Config `json:"-"` KafkaConfig *kafka.Config `json:"-"` FillColumn bool `json:"fillColumn,omitempty"` // 自动填充列 ColumnList []*Column `json:"columnList,omitempty"` AllOwner bool `json:"allOwner,omitempty"` Owners []*DbOwner `json:"owners,omitempty"` SkipOwnerNames []string `json:"skipOwnerNames,omitempty"` FilePath string `json:"filePath,omitempty"` ShouldOwner bool `json:"shouldOwner,omitempty"` // 需要 建库 ShouldTable bool `json:"shouldTable,omitempty"` // 需要 建表 FileNameSplice string `json:"fileNameSplice,omitempty"` // 文件名拼接字符 如:/ :库作为目录 表作为名称 默认 FileName string `json:"fileName,omitempty"` RowNumber int64 `json:"rowNumber,omitempty"` // contains filtered or unexported fields }
func (*DataSourceConfig) GetDialect ¶ added in v1.2.5
func (this_ *DataSourceConfig) GetDialect() dialect.Dialect
func (*DataSourceConfig) GetDialectParam ¶ added in v1.2.3
func (this_ *DataSourceConfig) GetDialectParam() *dialect.ParamModel
func (*DataSourceConfig) GetFileName ¶ added in v1.2.3
func (this_ *DataSourceConfig) GetFileName() string
func (*DataSourceConfig) GetTxtFileType ¶ added in v1.2.2
func (this_ *DataSourceConfig) GetTxtFileType() string
func (*DataSourceConfig) IsData ¶
func (this_ *DataSourceConfig) IsData() bool
func (*DataSourceConfig) IsDb ¶
func (this_ *DataSourceConfig) IsDb() bool
func (*DataSourceConfig) IsEs ¶
func (this_ *DataSourceConfig) IsEs() bool
func (*DataSourceConfig) IsExcel ¶
func (this_ *DataSourceConfig) IsExcel() bool
func (*DataSourceConfig) IsKafka ¶
func (this_ *DataSourceConfig) IsKafka() bool
func (*DataSourceConfig) IsRedis ¶
func (this_ *DataSourceConfig) IsRedis() bool
func (*DataSourceConfig) IsScript ¶ added in v1.2.2
func (this_ *DataSourceConfig) IsScript() bool
func (*DataSourceConfig) IsSql ¶
func (this_ *DataSourceConfig) IsSql() bool
func (*DataSourceConfig) IsTxt ¶
func (this_ *DataSourceConfig) IsTxt() bool
type DataSourceData ¶
type DataSourceData struct { *DataSourceBase *DataSourceDataParam }
func NewDataSourceData ¶
func NewDataSourceData() *DataSourceData
func (*DataSourceData) GetDataList ¶ added in v1.2.3
func (this_ *DataSourceData) GetDataList() []map[string]interface{}
func (*DataSourceData) Read ¶
func (this_ *DataSourceData) Read(progress *Progress, dataChan chan *Data) (err error)
func (*DataSourceData) ReadEnd ¶
func (this_ *DataSourceData) ReadEnd(progress *Progress) (err error)
func (*DataSourceData) ReadStart ¶
func (this_ *DataSourceData) ReadStart(progress *Progress) (err error)
func (*DataSourceData) Stop ¶
func (this_ *DataSourceData) Stop(progress *Progress)
func (*DataSourceData) Write ¶
func (this_ *DataSourceData) Write(progress *Progress, data *Data) (err error)
func (*DataSourceData) WriteEnd ¶
func (this_ *DataSourceData) WriteEnd(progress *Progress) (err error)
func (*DataSourceData) WriteStart ¶
func (this_ *DataSourceData) WriteStart(progress *Progress) (err error)
type DataSourceDataParam ¶ added in v1.2.8
type DataSourceDataParam struct {
DataList []map[string]interface{} `json:"dataList,omitempty"`
}
type DataSourceDb ¶
type DataSourceDb struct { *dialect.ParamModel *DataSourceBase *DataSourceDbParam *DataSourceSqlParam Service db.IService }
func NewDataSourceDb ¶
func NewDataSourceDb() *DataSourceDb
func (*DataSourceDb) GetParam ¶
func (this_ *DataSourceDb) GetParam() *dialect.ParamModel
func (*DataSourceDb) Read ¶
func (this_ *DataSourceDb) Read(progress *Progress, dataChan chan *Data) (err error)
func (*DataSourceDb) ReadEnd ¶
func (this_ *DataSourceDb) ReadEnd(progress *Progress) (err error)
func (*DataSourceDb) ReadStart ¶
func (this_ *DataSourceDb) ReadStart(progress *Progress) (err error)
func (*DataSourceDb) Stop ¶
func (this_ *DataSourceDb) Stop(progress *Progress)
func (*DataSourceDb) Write ¶
func (this_ *DataSourceDb) Write(progress *Progress, data *Data) (err error)
func (*DataSourceDb) WriteEnd ¶
func (this_ *DataSourceDb) WriteEnd(progress *Progress) (err error)
func (*DataSourceDb) WriteStart ¶
func (this_ *DataSourceDb) WriteStart(progress *Progress) (err error)
type DataSourceDbParam ¶ added in v1.2.8
type DataSourceEs ¶
type DataSourceEs struct { *DataSourceBase *DataSourceEsParam Service elasticsearch.IService }
func NewDataSourceEs ¶
func NewDataSourceEs() *DataSourceEs
func (*DataSourceEs) Read ¶
func (this_ *DataSourceEs) Read(progress *Progress, dataChan chan *Data) (err error)
func (*DataSourceEs) ReadEnd ¶
func (this_ *DataSourceEs) ReadEnd(progress *Progress) (err error)
func (*DataSourceEs) ReadStart ¶
func (this_ *DataSourceEs) ReadStart(progress *Progress) (err error)
func (*DataSourceEs) Stop ¶
func (this_ *DataSourceEs) Stop(progress *Progress)
func (*DataSourceEs) Write ¶
func (this_ *DataSourceEs) Write(progress *Progress, data *Data) (err error)
func (*DataSourceEs) WriteEnd ¶
func (this_ *DataSourceEs) WriteEnd(progress *Progress) (err error)
func (*DataSourceEs) WriteStart ¶
func (this_ *DataSourceEs) WriteStart(progress *Progress) (err error)
type DataSourceEsParam ¶ added in v1.2.8
type DataSourceExcel ¶
type DataSourceExcel struct { *DataSourceBase *DataSourceExcelParam FilePath string `json:"filePath,omitempty"` // contains filtered or unexported fields }
func NewDataSourceExcel ¶
func NewDataSourceExcel() *DataSourceExcel
func (*DataSourceExcel) CloseReadFile ¶
func (this_ *DataSourceExcel) CloseReadFile()
func (*DataSourceExcel) CloseWriteFile ¶
func (this_ *DataSourceExcel) CloseWriteFile()
func (*DataSourceExcel) GetReadFile ¶
func (this_ *DataSourceExcel) GetReadFile() (file *xlsx.File, err error)
func (*DataSourceExcel) GetWriteFile ¶
func (this_ *DataSourceExcel) GetWriteFile() (file *xlsx.File, err error)
func (*DataSourceExcel) Read ¶
func (this_ *DataSourceExcel) Read(progress *Progress, dataChan chan *Data) (err error)
func (*DataSourceExcel) ReadEnd ¶
func (this_ *DataSourceExcel) ReadEnd(progress *Progress) (err error)
func (*DataSourceExcel) ReadLineCount ¶
func (this_ *DataSourceExcel) ReadLineCount() (lineCount int64, err error)
func (*DataSourceExcel) ReadStart ¶
func (this_ *DataSourceExcel) ReadStart(progress *Progress) (err error)
func (*DataSourceExcel) Stop ¶
func (this_ *DataSourceExcel) Stop(progress *Progress)
func (*DataSourceExcel) Write ¶
func (this_ *DataSourceExcel) Write(progress *Progress, data *Data) (err error)
func (*DataSourceExcel) WriteEnd ¶
func (this_ *DataSourceExcel) WriteEnd(progress *Progress) (err error)
func (*DataSourceExcel) WriteStart ¶
func (this_ *DataSourceExcel) WriteStart(progress *Progress) (err error)
type DataSourceExcelParam ¶ added in v1.2.8
type DataSourceExcelParam struct {
SheetName string `json:"sheetName,omitempty"`
}
type DataSourceFile ¶
type DataSourceFile struct { FilePath string // contains filtered or unexported fields }
func NewDataSourceFile ¶ added in v1.2.3
func NewDataSourceFile(filePath string) *DataSourceFile
func (*DataSourceFile) CloseReadFile ¶
func (this_ *DataSourceFile) CloseReadFile()
func (*DataSourceFile) CloseWriteFile ¶
func (this_ *DataSourceFile) CloseWriteFile()
func (*DataSourceFile) GetFilePath ¶ added in v1.2.3
func (this_ *DataSourceFile) GetFilePath() string
func (*DataSourceFile) GetReadFile ¶
func (this_ *DataSourceFile) GetReadFile() (file *os.File, err error)
func (*DataSourceFile) GetWriteBuf ¶
func (this_ *DataSourceFile) GetWriteBuf() (bufWriter *bufio.Writer, err error)
func (*DataSourceFile) GetWriteFile ¶
func (this_ *DataSourceFile) GetWriteFile() (file *os.File, err error)
func (*DataSourceFile) ReadEnd ¶
func (this_ *DataSourceFile) ReadEnd(progress *Progress) (err error)
func (*DataSourceFile) ReadLineCount ¶
func (this_ *DataSourceFile) ReadLineCount() (lineCount int64, err error)
func (*DataSourceFile) ReadStart ¶
func (this_ *DataSourceFile) ReadStart(progress *Progress) (err error)
func (*DataSourceFile) Stop ¶
func (this_ *DataSourceFile) Stop(progress *Progress)
func (*DataSourceFile) WriteEnd ¶
func (this_ *DataSourceFile) WriteEnd(progress *Progress) (err error)
func (*DataSourceFile) WriteStart ¶
func (this_ *DataSourceFile) WriteStart(progress *Progress) (err error)
type DataSourceKafka ¶
type DataSourceKafka struct { *DataSourceBase *DataSourceKafkaParam Service kafka.IService // contains filtered or unexported fields }
func NewDataSourceKafka ¶
func NewDataSourceKafka() *DataSourceKafka
func (*DataSourceKafka) Read ¶
func (this_ *DataSourceKafka) Read(progress *Progress, dataChan chan *Data) (err error)
func (*DataSourceKafka) ReadEnd ¶
func (this_ *DataSourceKafka) ReadEnd(progress *Progress) (err error)
func (*DataSourceKafka) ReadStart ¶
func (this_ *DataSourceKafka) ReadStart(progress *Progress) (err error)
func (*DataSourceKafka) Stop ¶
func (this_ *DataSourceKafka) Stop(progress *Progress)
func (*DataSourceKafka) Write ¶
func (this_ *DataSourceKafka) Write(progress *Progress, data *Data) (err error)
func (*DataSourceKafka) WriteEnd ¶
func (this_ *DataSourceKafka) WriteEnd(progress *Progress) (err error)
func (*DataSourceKafka) WriteStart ¶
func (this_ *DataSourceKafka) WriteStart(progress *Progress) (err error)
type DataSourceKafkaParam ¶ added in v1.2.8
type DataSourceKafkaParam struct { TopicName string `json:"topicName,omitempty"` TopicGroupName string `json:"topicGroupName,omitempty"` TopicKey string `json:"topicKey,omitempty"` TopicValue string `json:"topicValue,omitempty"` TopicValueByData bool `json:"topicValueByData,omitempty"` PullWait int64 `json:"pullWait,omitempty"` }
type DataSourceRedis ¶
type DataSourceRedis struct { *DataSourceBase *DataSourceRedisParam Service redis.IService // contains filtered or unexported fields }
func NewDataSourceRedis ¶
func NewDataSourceRedis() *DataSourceRedis
func (*DataSourceRedis) Read ¶
func (this_ *DataSourceRedis) Read(progress *Progress, dataChan chan *Data) (err error)
func (*DataSourceRedis) ReadEnd ¶
func (this_ *DataSourceRedis) ReadEnd(progress *Progress) (err error)
func (*DataSourceRedis) ReadStart ¶
func (this_ *DataSourceRedis) ReadStart(progress *Progress) (err error)
func (*DataSourceRedis) Stop ¶
func (this_ *DataSourceRedis) Stop(progress *Progress)
func (*DataSourceRedis) Write ¶
func (this_ *DataSourceRedis) Write(progress *Progress, data *Data) (err error)
func (*DataSourceRedis) WriteEnd ¶
func (this_ *DataSourceRedis) WriteEnd(progress *Progress) (err error)
func (*DataSourceRedis) WriteStart ¶
func (this_ *DataSourceRedis) WriteStart(progress *Progress) (err error)
type DataSourceRedisParam ¶ added in v1.2.8
type DataSourceRedisParam struct { RedisDatabase int `json:"redisDatabase,omitempty"` RedisKeyPattern string `json:"redisKeyPattern,omitempty"` RedisKeyName string `json:"redisKeyName,omitempty"` RedisKeyScript string `json:"redisKeyScript,omitempty"` RedisFieldName string `json:"redisFieldName,omitempty"` RedisFieldScript string `json:"redisFieldScript,omitempty"` RedisValueName string `json:"redisValueName,omitempty"` RedisValueTypeName string `json:"redisValueTypeName,omitempty"` RedisValueByData bool `json:"redisValueByData,omitempty"` RedisValueType string `json:"redisValueType,omitempty"` }
type DataSourceScript ¶ added in v1.2.2
type DataSourceScript struct { *DataSourceBase *DataSourceScriptParam }
func NewDataSourceScript ¶ added in v1.2.2
func NewDataSourceScript() *DataSourceScript
func (*DataSourceScript) Read ¶ added in v1.2.2
func (this_ *DataSourceScript) Read(progress *Progress, dataChan chan *Data) (err error)
func (*DataSourceScript) ReadEnd ¶ added in v1.2.2
func (this_ *DataSourceScript) ReadEnd(progress *Progress) (err error)
func (*DataSourceScript) ReadStart ¶ added in v1.2.2
func (this_ *DataSourceScript) ReadStart(progress *Progress) (err error)
func (*DataSourceScript) Stop ¶ added in v1.2.2
func (this_ *DataSourceScript) Stop(progress *Progress)
func (*DataSourceScript) Write ¶ added in v1.2.2
func (this_ *DataSourceScript) Write(progress *Progress, data *Data) (err error)
func (*DataSourceScript) WriteEnd ¶ added in v1.2.2
func (this_ *DataSourceScript) WriteEnd(progress *Progress) (err error)
func (*DataSourceScript) WriteStart ¶ added in v1.2.2
func (this_ *DataSourceScript) WriteStart(progress *Progress) (err error)
type DataSourceScriptParam ¶ added in v1.2.8
type DataSourceScriptParam struct {
Total int64 `json:"total,omitempty"`
}
type DataSourceSql ¶
type DataSourceSql struct { *DataSourceBase *DataSourceFile *DataSourceSqlParam *dialect.ParamModel // contains filtered or unexported fields }
func NewDataSourceSql ¶
func NewDataSourceSql() *DataSourceSql
func (*DataSourceSql) GetDialect ¶
func (this_ *DataSourceSql) GetDialect() dialect.Dialect
func (*DataSourceSql) GetParam ¶
func (this_ *DataSourceSql) GetParam() *dialect.ParamModel
func (*DataSourceSql) Read ¶
func (this_ *DataSourceSql) Read(progress *Progress, dataChan chan *Data) (err error)
func (*DataSourceSql) ReadStart ¶
func (this_ *DataSourceSql) ReadStart(progress *Progress) (err error)
func (*DataSourceSql) Write ¶
func (this_ *DataSourceSql) Write(progress *Progress, data *Data) (err error)
func (*DataSourceSql) WriteStart ¶
func (this_ *DataSourceSql) WriteStart(progress *Progress) (err error)
type DataSourceSqlParam ¶ added in v1.2.8
type DataSourceTxt ¶
type DataSourceTxt struct { *DataSourceBase *DataSourceFile *DataSourceTxtParam // contains filtered or unexported fields }
func NewDataSourceTxt ¶
func NewDataSourceTxt() *DataSourceTxt
func (*DataSourceTxt) GetColSeparator ¶ added in v1.2.3
func (this_ *DataSourceTxt) GetColSeparator() string
func (*DataSourceTxt) Read ¶
func (this_ *DataSourceTxt) Read(progress *Progress, dataChan chan *Data) (err error)
func (*DataSourceTxt) ReadStart ¶
func (this_ *DataSourceTxt) ReadStart(progress *Progress) (err error)
func (*DataSourceTxt) ReadTitles ¶ added in v1.2.3
func (this_ *DataSourceTxt) ReadTitles(progress *Progress) (titles []string, err error)
func (*DataSourceTxt) StringsToValues ¶ added in v1.2.2
func (this_ *DataSourceTxt) StringsToValues(progress *Progress, cols []string) (res []interface{}, err error)
func (*DataSourceTxt) ValuesToStrings ¶ added in v1.2.2
func (this_ *DataSourceTxt) ValuesToStrings(progress *Progress, cols []interface{}) (res []string, err error)
type DataSourceTxtParam ¶ added in v1.2.8
type DbColumn ¶
type DbColumn struct { From *dialect.ColumnModel `json:"from,omitempty"` To *dialect.ColumnModel `json:"to,omitempty"` Value string `json:"value,omitempty"` }
type DbOwner ¶
type DbOwner struct { From *dialect.OwnerModel `json:"from,omitempty"` To *dialect.OwnerModel `json:"to,omitempty"` SkipTableNames []string `json:"skipTableNames,omitempty"` AllTable bool `json:"allTable,omitempty"` Tables []*DbTable `json:"tables,omitempty"` // contains filtered or unexported fields }
type DbTable ¶
type DbTable struct { From *dialect.TableModel `json:"from,omitempty"` To *dialect.TableModel `json:"to,omitempty"` Columns []*DbColumn `json:"columns,omitempty"` SkipColumnNames []string `json:"skipColumnNames,omitempty"` AllColumn bool `json:"allColumn,omitempty"` // contains filtered or unexported fields }
func (*DbTable) GetToDialectTable ¶
func (this_ *DbTable) GetToDialectTable() *dialect.TableModel
type Options ¶
type Options struct { Key string `json:"key,omitempty"` // 任务的 key Dir string `json:"dir,omitempty"` // 任务过程中 生成文件的目录 From *DataSourceConfig `json:"from,omitempty"` // 源 数据配置 To *DataSourceConfig `json:"to,omitempty"` // 目标 数据配置 ErrorContinue bool `json:"errorContinue,omitempty"` BatchNumber int64 `json:"batchNumber,omitempty"` }
type Progress ¶
type Progress struct { *Options DataTotal int64 `json:"dataTotal"` OwnerTotal int64 `json:"ownerTotal"` OwnerCount *ProgressCount `json:"ownerCount"` TableTotal int64 `json:"tableTotal"` TableCount *ProgressCount `json:"tableCount"` ReadCount *ProgressCount `json:"readCount"` WriteCount *ProgressCount `json:"writeCount"` IndexTotal int64 `json:"indexTotal"` IndexCount *ProgressCount `json:"indexCount"` TopicTotal int64 `json:"topicTotal"` TopicCount *ProgressCount `json:"topicCount"` // contains filtered or unexported fields }
func NewProgress ¶
func (*Progress) ShouldStop ¶
type ProgressCount ¶
type ProgressCount struct { Total int64 `json:"total"` Error int64 `json:"error"` Success int64 `json:"success"` Errors []string `json:"errors"` }
func (*ProgressCount) AddError ¶
func (this_ *ProgressCount) AddError(size int64, err error)
func (*ProgressCount) AddSuccess ¶
func (this_ *ProgressCount) AddSuccess(size int64)
type SqlAndParam ¶
type SqlAndParam struct { Sql string `json:"sql,omitempty"` Params []interface{} `json:"params,omitempty"` }
Source Files
¶
- datamove.go
- datamove_base.go
- datamove_data.go
- datamove_datasource.go
- datamove_db.go
- datamove_es.go
- datamove_excel.go
- datamove_execute.go
- datamove_kafka.go
- datamove_redis.go
- datamove_script.go
- datamove_sql.go
- datamove_txt.go
- datasource.go
- datasource_base.go
- datasource_data.go
- datasource_db.go
- datasource_es.go
- datasource_excel.go
- datasource_file.go
- datasource_kafka.go
- datasource_redis.go
- datasource_script.go
- datasource_sql.go
- datasource_txt.go
Click to show internal directories.
Click to hide internal directories.