Documentation
¶
Index ¶
- type Binlog
- func (bin *Binlog) Close()
- func (bin *Binlog) CloseSQLWorker(sqlworker *SQLWorker)
- func (bin *Binlog) Init() error
- func (bin *Binlog) LastGTID() int64
- func (bin *Binlog) LogEvent(typ string, schema string, sql string)
- func (bin *Binlog) NewSQLWorker(ts int64) (*SQLWorker, error)
- func (bin *Binlog) RelayInfos() []RelayInfo
- type Event
- type IOWorker
- type Info
- type RelayInfo
- type SQLWorker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binlog ¶
type Binlog struct {
// contains filtered or unexported fields
}
Binlog tuple.
func NewBinlog ¶
func NewBinlog(log *xlog.Log, conf *config.BinlogConfig) *Binlog
NewBinlog creates the new binlog tuple.
func (*Binlog) CloseSQLWorker ¶
CloseSQLWorker used to close the sqlworker.
func (*Binlog) LogEvent ¶
LogEvent used to write the event to the bin.
func (*Binlog) NewSQLWorker ¶
NewSQLWorker creates the new sql worker.
type Event ¶
type Event struct { // An identifier that describes the event type. Type string Schema string Query string Version uint16 // The GTID of this event. Timestamp uint64 // The name of the file that is being listed. LogName string // The position at which the event occurs. Pos int64 // The position at which the next event begins, which is equal to Pos plus the size of the event. EndLogPos int64 }
Event binlog event.
type IOWorker ¶
type IOWorker struct {
// contains filtered or unexported fields
}
IOWorker tuple.
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
Info tuple.
func NewInfo ¶
NewInfo returns info tuple.
func (*Info) ReadTs ¶
ReadTs used to get the ts from the relay file.
type RelayInfo ¶
type RelayInfo struct { ID int64 StartGTID int64 RelayGTID int64 LastWriteGTID int64 Relaybin string RelayPosition int64 SecondBehinds int64 }
RelayInfo represents the relay sqlworker status.
type SQLWorker ¶
type SQLWorker struct {
// contains filtered or unexported fields
}
SQLWorker tuple.
func NewSQLWorker ¶
NewSQLWorker creates the new SQLWorker.
func (*SQLWorker) Init ¶
Init used to init the sql current position and seek to the right event.
func (*SQLWorker) NextEvent ¶
NextEvent used to read the next event. If we get the end of the current binlog file and don't have next binlog, just returns (nil,nil).
func (*SQLWorker) RelayGTID ¶
RelayGTID returns the last event timestamp have read.
func (*SQLWorker) RelayName ¶
RelayName returns the current binlog which are read.
func (*SQLWorker) RelayPosition ¶
RelayPosition returns the current binlog position which are read.