Documentation ¶
Index ¶
- Constants
- func BinlogIndexPath(binlogPath string) (string, error)
- func DumpBinlogFromPos(srcFilePath string, startPos uint, targetFilePath string) error
- func DumpUnexecutedBinlogByGtid(srcFilePath string, executedGtidDesc string, targetFilePath string, ...) error
- func GenBinlogEventBytes(fh EventFixedHeader, fd EventFixedData, vd EventVariableData) ([]byte, error)
- func GetAllGtidOfBinlogDir(binlogDir, binlogBaseName string) (gtidDesc string, err error)
- func GetFirstPreviousGtidOfBinlogDir(binlogDir, binlogBaseName string) (gtidDesc string, err error)
- func GetGtidOfBinlog(binlogPath string) (gtidDesc string, err error)
- func GetPreviousGtids(binlogPath string) (gtidDesc string, err error)
- func GetUnexecutedBinlogFilesByGtid(binlogDir string, binlogBaseName string, executedGtidDesc string, ...) (ret []string, err error)
- func GetUnexecutedBinlogPosByGtid(binlogPath string, executedGtidDesc string, includeEventBeforeFirst bool) (pos uint, err error)
- func GetUnexecutedBinlogPosByGtidAndAllGtid(binlogPath string, executedGtidDesc string, includeEventBeforeFirst bool) (pos uint, allgtid string, err error)
- func NextBinlogName(binlogPath string) (string, error)
- func NextBinlogPath(binlogPath string) (string, error)
- func ParseBinlogFile(path string, fx func(transaction Transaction) bool) error
- func ParseBinlogWithFilter(path string, pos int64, filter BinlogFilter, fx func(Transaction) bool) error
- func SetLogger(logger Logger)
- type BinlogEvent
- type BinlogFilter
- type EventFixedData
- type EventFixedHeader
- type EventVariableData
- type Logger
- type Transaction
- type TxDetail
Constants ¶
View Source
const ( UNKNOWN_EVENT = 0 START_EVENT_V3 = 1 QUERY_EVENT = 2 STOP_EVENT = 3 ROTATE_EVENT = 4 INTVAR_EVENT = 5 LOAD_EVENT = 6 SLAVE_EVENT = 7 CREATE_FILE_EVENT = 8 APPEND_BLOCK_EVENT = 9 EXEC_LOAD_EVENT = 10 DELETE_FILE_EVENT = 11 NEW_LOAD_EVENT = 12 RAND_EVENT = 13 USER_VAR_EVENT = 14 FORMAT_DESCRIPTION_EVENT = 15 XID_EVENT = 16 BEGIN_LOAD_QUERY_EVENT = 17 EXECUTE_LOAD_QUERY_EVENT = 18 TABLE_MAP_EVENT = 19 PRE_GA_WRITE_ROWS_EVENT = 20 PRE_GA_UPDATE_ROWS_EVENT = 21 PRE_GA_DELETE_ROWS_EVENT = 22 WRITE_ROWS_EVENT_V1 = 23 UPDATE_ROWS_EVENT_V1 = 24 DELETE_ROWS_EVENT_V1 = 25 INCIDENT_EVENT = 26 HEARTBEAT_LOG_EVENT = 27 IGNORABLE_LOG_EVENT = 28 ROWS_QUERY_LOG_EVENT = 29 WRITE_ROWS_EVENT = 30 UPDATE_ROWS_EVENT = 31 DELETE_ROWS_EVENT = 32 GTID_LOG_EVENT = 33 ANONYMOUS_GTID_LOG_EVENT = 34 PREVIOUS_GTIDS_LOG_EVENT = 35 )
View Source
const ( LOG_EVENT_FIXED_HEADER_LEN = 19 MAX_ALLOWED_PACKET = 1024 * 1024 * 1024 )
View Source
const ( STATUS_PREPARE uint8 = iota STATUS_BEGIN STATUS_COMMIT STATUS_ROLLBACK )
Variables ¶
This section is empty.
Functions ¶
func BinlogIndexPath ¶
func DumpBinlogFromPos ¶
func GenBinlogEventBytes ¶
func GenBinlogEventBytes(fh EventFixedHeader, fd EventFixedData, vd EventVariableData) ([]byte, error)
func GetAllGtidOfBinlogDir ¶
func GetGtidOfBinlog ¶
func GetPreviousGtids ¶
func NextBinlogName ¶
func NextBinlogPath ¶
func ParseBinlogFile ¶
func ParseBinlogFile(path string, fx func(transaction Transaction) bool) error
func ParseBinlogWithFilter ¶
func ParseBinlogWithFilter(path string, pos int64, filter BinlogFilter, fx func(Transaction) bool) error
Types ¶
type BinlogEvent ¶
type BinlogEvent struct { Type string DB string TB string Data string RowCnt uint32 Rows [][]interface{} CompressionType string }
func ParseBinlogEvent ¶
func ParseBinlogEvent(ev *replication.BinlogEvent) []BinlogEvent
type BinlogFilter ¶
type EventFixedData ¶
type EventFixedData struct {
Bytes []byte
}
type EventFixedHeader ¶
type EventVariableData ¶
type EventVariableData struct {
Bytes []byte
}
type Transaction ¶
type Transaction struct { GTID string `json:"gtid"` Timestamp int64 `json:"timestamp"` Time time.Time `json:"time"` StartPos int `json:"startPos"` EndPos int `json:"endPos"` Size int `json:"size"` RowsCount int `json:"rowsCount"` Status uint8 `json:"status"` TxStartTime int64 `json:"txStartTime"` TxEndTime int64 `json:"txEndTime"` Txs []TxDetail `json:"txs"` // contains filtered or unexported fields }
func (Transaction) GetSqlOrigin ¶
func (t Transaction) GetSqlOrigin() []string
type TxDetail ¶
type TxDetail struct { StartPos int `json:"startPos"` EndPos int `json:"endPos"` RowCount int `json:"rowCount"` Timestamp int64 `json:"timestamp"` Time time.Time `json:"time"` Sql string `json:"sql"` Db string `json:"db"` Table string `json:"table"` SqlType string `json:"sqlType"` CompressionType string `json:"compressionType"` Rows [][]interface{} }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.