Documentation
¶
Index ¶
- Constants
- Variables
- type AuthenticInfo
- type DdlParserResult
- type DdlSQLParser
- type EventConvert
- type Index
- type LogDecoder
- type LogFetcher
- type LogSteamer
- type MemoryTableMeta
- type MySQLConnection
- func (mc *MySQLConnection) Connect() error
- func (mc *MySQLConnection) Disconnect() error
- func (mc *MySQLConnection) Dump(binlogName string, position uint32, sinkFunc SinkFunction) error
- func (mc *MySQLConnection) Fork() *MySQLConnection
- func (mc *MySQLConnection) Reconnect() error
- func (mc *MySQLConnection) Sink(binlogName string, position uint32, sinkFunc SinkFunction) error
- type MySQLEventParser
- type RawIndex
- type RawTableColumn
- type SinkFunction
- type Streamer
- type TableColumn
- type TableMeta
- type TableMetaCache
- func (tmc *TableMetaCache) GetOneTableMeta(schema string, table string) *TableMeta
- func (tmc *TableMetaCache) GetOneTableMetaViaTSDB(schema, table string, position *protoc.EntryPosition, useCache bool) *TableMeta
- func (tmc *TableMetaCache) RemoveOneTableMeta(schema string, table string)
- func (tmc *TableMetaCache) RestoreOneTableMeta(schema string, table string) error
- type TableMetaTSDB
Constants ¶
View Source
const ( TRANSACTION_BEGIN = "BEGIN" TRANSACTION_END = "COMMIT" )
View Source
const ( TYPE_NUMBER = iota + 1 // tinyint, smallint, mediumint, int, bigint, year TYPE_FLOAT // float, double TYPE_ENUM // enum TYPE_SET // set TYPE_STRING // other TYPE_DATETIME // datetime TYPE_TIMESTAMP // timestamp TYPE_DATE // date TYPE_TIME // time TYPE_BIT // bit TYPE_JSON // json )
View Source
const MASTER_HEARTBEAT_PERIOD_SECONDS = 15
Master heartbeat interval
View Source
const UTF8 = "UTF8"
Variables ¶
View Source
var IgnoreEventErr = errors.New("ignore event")
Functions ¶
This section is empty.
Types ¶
type AuthenticInfo ¶
type AuthenticInfo struct {
// contains filtered or unexported fields
}
type DdlParserResult ¶
type DdlParserResult struct {
// contains filtered or unexported fields
}
type DdlSQLParser ¶
type DdlSQLParser struct {
// contains filtered or unexported fields
}
func NewSQLParser ¶
func NewSQLParser(sql string) *DdlSQLParser
func (*DdlSQLParser) Parse ¶
func (dsp *DdlSQLParser) Parse(dbName string) ([]*DdlParserResult, error)
type EventConvert ¶
type EventConvert struct {
FilterQueryDcl bool
FilterQueryDml bool
FilterQueryDdl bool
FilterTableErr bool
FilterRows bool
// contains filtered or unexported fields
}
func NewEventCovert ¶
func NewEventCovert(tblMetaCache *TableMetaCache) *EventConvert
func (*EventConvert) Parse ¶
func (ec *EventConvert) Parse(event *LogEvent) (entry *Entry, err error)
type LogDecoder ¶
type LogDecoder struct {
// contains filtered or unexported fields
}
func NewDumpEventLogDecoder ¶
func NewDumpEventLogDecoder() *LogDecoder
func NewEmptyLogDecoder ¶
func NewEmptyLogDecoder() *LogDecoder
func NewLogDecoder ¶
func NewLogDecoder(from, to LogEventType) *LogDecoder
func NewSinkEventLogDecoder ¶
func NewSinkEventLogDecoder() *LogDecoder
func (*LogDecoder) Decode ¶
func (ld *LogDecoder) Decode(data []byte) (*LogEvent, error)
type LogFetcher ¶
type LogFetcher struct {
// contains filtered or unexported fields
}
func NewLogFetcher ¶
func NewLogFetcher(conn *MySQLConnection, ld *LogDecoder) *LogFetcher
func (*LogFetcher) Fetch ¶
func (lf *LogFetcher) Fetch() (*LogEvent, error)
type LogSteamer ¶
type LogSteamer struct {
// contains filtered or unexported fields
}
func NewLogSteamer ¶
func NewLogSteamer(conn *MySQLConnection, ld *LogDecoder) *LogSteamer
func (*LogSteamer) Fetch ¶
func (ls *LogSteamer) Fetch() *Streamer
type MemoryTableMeta ¶
type MemoryTableMeta struct {
// contains filtered or unexported fields
}
type MySQLConnection ¶
type MySQLConnection struct {
*MySQLConnector
// contains filtered or unexported fields
}
func NewMySQLConnection ¶
func NewMySQLConnection(auth *AuthenticInfo, slaveId uint32) *MySQLConnection
func (*MySQLConnection) Connect ¶
func (mc *MySQLConnection) Connect() error
func (*MySQLConnection) Disconnect ¶
func (mc *MySQLConnection) Disconnect() error
func (*MySQLConnection) Dump ¶
func (mc *MySQLConnection) Dump(binlogName string, position uint32, sinkFunc SinkFunction) error
func (*MySQLConnection) Fork ¶
func (mc *MySQLConnection) Fork() *MySQLConnection
func (*MySQLConnection) Reconnect ¶
func (mc *MySQLConnection) Reconnect() error
func (*MySQLConnection) Sink ¶
func (mc *MySQLConnection) Sink(binlogName string, position uint32, sinkFunc SinkFunction) error
type MySQLEventParser ¶
type MySQLEventParser struct {
*MySQLConnection
MasterAuth *AuthenticInfo
SlaveAuth *AuthenticInfo
MasterPosition *protoc.EntryPosition
SlavePosition *protoc.EntryPosition
BinLogFormat binlogFormatImage
BinLogImage binlogFormatImage
// contains filtered or unexported fields
}
func NewMySQLEventParser ¶
func NewMySQLEventParser(destination string, slaveId int) *MySQLEventParser
func (*MySQLEventParser) BuildMySQLConnection ¶
func (mp *MySQLEventParser) BuildMySQLConnection(auth *AuthenticInfo) (*MySQLConnection, error)
func (*MySQLEventParser) FindStartPosition ¶
func (mp *MySQLEventParser) FindStartPosition() *protoc.EntryPosition
func (*MySQLEventParser) PrepareDump ¶
func (mp *MySQLEventParser) PrepareDump() error
type RawTableColumn ¶
type RawTableColumn struct {
// contains filtered or unexported fields
}
type SinkFunction ¶
type SinkFunction func(event *LogEvent) bool
type Streamer ¶
type Streamer struct {
// contains filtered or unexported fields
}
func NewStreamer ¶
func NewStreamer() *Streamer
type TableColumn ¶
type TableMeta ¶
type TableMeta struct {
Schema string
Table string
Columns []*TableColumn
Indexes map[string]*Index
}
type TableMetaCache ¶
type TableMetaCache struct {
// contains filtered or unexported fields
}
func NewTableMetaCache ¶
func NewTableMetaCache(conn *MySQLConnection, destination string) (*TableMetaCache, error)
func (*TableMetaCache) GetOneTableMeta ¶
func (tmc *TableMetaCache) GetOneTableMeta(schema string, table string) *TableMeta
func (*TableMetaCache) GetOneTableMetaViaTSDB ¶
func (tmc *TableMetaCache) GetOneTableMetaViaTSDB(schema, table string, position *protoc.EntryPosition, useCache bool) *TableMeta
func (*TableMetaCache) RemoveOneTableMeta ¶
func (tmc *TableMetaCache) RemoveOneTableMeta(schema string, table string)
func (*TableMetaCache) RestoreOneTableMeta ¶
func (tmc *TableMetaCache) RestoreOneTableMeta(schema string, table string) error
type TableMetaTSDB ¶
type TableMetaTSDB struct {
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.