Documentation
¶
Index ¶
- Constants
- Variables
- func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error)
- func WriteRecordsFile(doneFilePath, content string) (err error)
- type DBRecords
- 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
- type Reader
- func (r *Reader) Close() error
- func (r *Reader) Lag() (rl *LagInfo, err error)
- func (r *Reader) Name() string
- func (r *Reader) ReadData() (Data, int64, error)
- func (r *Reader) ReadLine() (string, error)
- func (r *Reader) SetMode(mode string, v interface{}) error
- func (r *Reader) Source() string
- func (r *Reader) Start() error
- func (r *Reader) Status() StatsInfo
- func (r *Reader) SyncMeta()
- type SyncDBRecords
- 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
- type TableRecords
- func (tableRecords *TableRecords) GetTable() map[string]TableInfo
- func (tableRecords *TableRecords) GetTableInfo(table string) TableInfo
- func (tableRecords *TableRecords) Reset()
- func (tableRecords *TableRecords) Set(value TableRecords)
- func (tableRecords *TableRecords) SetTableInfo(table string, tableInfo TableInfo)
Constants ¶
View Source
const ( DefaultMySQLTable = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA='DATABASE_NAME';" DefaultMySQLDatabase = "SHOW DATABASES;" DefaultPGSQLTable = "SELECT TABLENAME FROM PG_TABLES WHERE SCHEMANAME='SCHEMA_NAME';" DefaultMSSQLTable = "" /* 144-byte string literal not displayed */ SupportReminder = "history all magic only support @(YYYY) @(YY) @(MM) @(DD) @(hh) @(mm) @(ss)" Wildcards = "*" DefaultDoneRecordsFile = "sql.records" )
View Source
const ( YEAR = iota MONTH DAY HOUR MINUTE SECOND )
View Source
const ( // 获取符合条件的table TABLE = iota // 获取符合条件的database DATABASE // 获取数据库表的总条数 COUNT )
View Source
const ( // 获取数据条数的函数 COUNTFUNC = iota // 获取读取数据的函数 READFUNC )
Variables ¶
View Source
var MysqlSystemDB = []string{"information_schema", "performance_schema", "mysql", "sys"}
Functions ¶
func WriteRecordsFile ¶
WriteRecordsFile 将当前文件写入donefiel中
Types ¶
type DBRecords ¶
type DBRecords map[string]TableRecords
func (*DBRecords) GetTableRecords ¶
func (dbRecords *DBRecords) GetTableRecords(db string) TableRecords
func (*DBRecords) SetTableInfo ¶ added in v1.5.2
func (*DBRecords) SetTableRecords ¶
func (dbRecords *DBRecords) SetTableRecords(db string, tableRecords TableRecords)
type Reader ¶
type SyncDBRecords ¶ added in v1.5.1
type SyncDBRecords struct {
// contains filtered or unexported fields
}
func (*SyncDBRecords) GetDBRecords ¶ added in v1.5.1
func (syncDBRecords *SyncDBRecords) GetDBRecords() DBRecords
func (*SyncDBRecords) GetTableRecords ¶ added in v1.5.1
func (syncDBRecords *SyncDBRecords) GetTableRecords(db string) TableRecords
func (*SyncDBRecords) Reset ¶ added in v1.5.1
func (syncDBRecords *SyncDBRecords) Reset()
func (*SyncDBRecords) SetTableInfo ¶ added in v1.5.2
func (syncDBRecords *SyncDBRecords) SetTableInfo(db, table string, tableInfo TableInfo)
func (*SyncDBRecords) SetTableRecords ¶ added in v1.5.1
func (syncDBRecords *SyncDBRecords) SetTableRecords(db string, tableRecords TableRecords)
type TableRecords ¶
func (*TableRecords) GetTable ¶ added in v1.5.2
func (tableRecords *TableRecords) GetTable() map[string]TableInfo
func (*TableRecords) GetTableInfo ¶
func (tableRecords *TableRecords) GetTableInfo(table string) TableInfo
func (*TableRecords) Reset ¶
func (tableRecords *TableRecords) Reset()
func (*TableRecords) Set ¶
func (tableRecords *TableRecords) Set(value TableRecords)
func (*TableRecords) SetTableInfo ¶
func (tableRecords *TableRecords) SetTableInfo(table string, tableInfo TableInfo)
Click to show internal directories.
Click to hide internal directories.