Versions in this module Expand all Collapse all v1 v1.5.5 May 18, 2020 Changes in this version + const COUNT + const COUNTFUNC + const CacheMapFile + const DATABASE + const DAY + const DefaultDoneRecordsFile + const DefaultDoneSqlsFile + const DefaultMSSQLTable + const DefaultMySQLDatabase + const DefaultMySQLTable + const DefaultPGSQLTable + const HOUR + const MINUTE + const MONTH + const READFUNC + const SECOND + const SqlOffsetConnector + const SqlSpliter + const SupportReminder + const TABLE + const TimestampRecordsFile + const Wildcards + const YEAR + func CheckMagic(rawSql string) (valid bool) + func CompareRemainStr(target, magicRemainStr, magicRet string, magicRemainIndex []int) bool + func CompareTime(target, match string, timeStart, timeEnd []int, min bool) (valid bool) + func CompareWithStartTime(data models.Data, timestampKey string, startTime time.Time) (int, bool) + func CompareWithStartTimeInt(data models.Data, timestampKey string, startTimeInt int64) (int, bool) + func CompareWithStartTimeStr(data models.Data, timestampKey, startTimeStr string) (int, bool) + func Contains(slice []string, str string) bool + func ConvertBool(v interface{}) (bool, error) + func ConvertDate(v interface{}) (time.Time, error) + func ConvertFloat(v interface{}) (float64, error) + func ConvertLong(v interface{}) (int64, error) + func ConvertMagicIndex(magic string, now time.Time) (Ret string, index int) + func ConvertScanArgs(data models.Data, scanArg interface{}, column, runnerName, name string, ...) (int64, error) + func ConvertString(v interface{}) (string, error) + func ConvertUUID(v interface{}) (string, error) + func EqualTime(target, magicRet string, timeStart, timeEnd []int) (valid bool) + func GetInitScans(length int, rows *sql.Rows, schemas map[string]string, runnerName, name string) (scanArgs []interface{}, nochoiced []bool) + func GetOffsetIndex(offsetKey string, columns []string) int + func GetOffsetIndexWithTimeStamp(offsetKey, timestampKey string, columns []string) int + func GetRemainStr(origin string, magicRemainIndex []int) (remainStr string) + func GetTimeFromArgs(offsetKeyIndex int, scanArgs []interface{}) (time.Time, bool) + func GetTimeFromData(data models.Data, timestampKey string) (time.Time, bool) + func GetTimeIntFromArgs(offsetKeyIndex int, scanArgs []interface{}) (int64, bool) + func GetTimeIntFromData(data models.Data, timestampKey string) (int64, bool) + func GetTimeStrFromData(data models.Data, timestampKey string) (string, bool) + func OpenSql(dbtype, connectStr string) (db *sql.DB, err error) + func QueryNumber(tsql string, db *sql.DB) (int64, error) + func RemoveWildcards(checkWildcards string, length int) int + func RestoreMeta(meta *reader.Meta, rawSqls string, magicLagDur time.Duration) (offsets []int64, sqls []string, omitMeta bool) + func RestoreSqls(meta *reader.Meta) map[string]string + func RestoreTimestampIntOffset(doneFilePath string) (int64, map[string]string, error) + func RestoreTimestampOffset(doneFilePath string) (time.Time, map[string]string, error) + func RestoreTimestampStrOffset(doneFilePath string) (string, map[string]string, error) + func SchemaCheck(rawSchemas []string) (schemas map[string]string, err error) + func UpdateSqls(rawsqls string, now time.Time) []string + func WriteCacheMap(doneFilePath string, cache map[string]string) (err error) + func WriteRecordsFile(doneFilePath, content string) (err error) + func WriteSqlsFile(doneFilePath, content string) (err error) + func WriteTimestampOffset(doneFilePath, content string) (err error) + type ByJson []jsonIndex + func (a ByJson) Len() int + func (a ByJson) Less(i, j int) bool + func (a ByJson) Swap(i, j int) + type DBRecords map[string]TableRecords + func (dbRecords *DBRecords) GetTableRecords(db string) TableRecords + func (dbRecords *DBRecords) Reset() + func (dbRecords *DBRecords) Set(value DBRecords) + func (dbRecords *DBRecords) SetTableInfo(db, table string, tableInfo TableInfo) + func (dbRecords *DBRecords) SetTableRecords(db string, tableRecords TableRecords) + type MagicRes struct + RemainIndex []int + Ret string + TimeEnd []int + TimeStart []int + func GoMagicIndex(rawSql string, now time.Time) (MagicRes, error) + type ReadInfo struct + Bytes int64 + Data models.Data + Json string + func GetJson(datas []ReadInfo) ([]ReadInfo, bool) + func SortByJson(datas []ReadInfo) ([]ReadInfo, bool) + type SyncDBRecords struct + Mutex sync.RWMutex + Records DBRecords + func (dbRecords *SyncDBRecords) RestoreRecordsFile(meta *reader.Meta) (lastDB, lastTable string, omitDoneDBRecords bool) + func (syncDBRecords *SyncDBRecords) CheckDoneRecords(target, curDB string) bool + func (syncDBRecords *SyncDBRecords) GetDBRecords() DBRecords + func (syncDBRecords *SyncDBRecords) GetTableRecords(db string) TableRecords + func (syncDBRecords *SyncDBRecords) Reset() + func (syncDBRecords *SyncDBRecords) SetTableInfo(db, table string, tableInfo TableInfo) + func (syncDBRecords *SyncDBRecords) SetTableRecords(db string, tableRecords TableRecords) + type TableInfo struct + Offset int64 + Size int64 + type TableRecords struct + Mutex sync.RWMutex + Table map[string]TableInfo + func (tableRecords *TableRecords) GetTable() map[string]TableInfo + func (tableRecords *TableRecords) GetTableInfo(table string) TableInfo + func (tableRecords *TableRecords) Reset() + func (tableRecords *TableRecords) RestoreTableDone(meta *reader.Meta, database string, tables []string) bool + func (tableRecords *TableRecords) Set(value TableRecords) + func (tableRecords *TableRecords) SetTableInfo(table string, tableInfo TableInfo)