Versions in this module Expand all Collapse all v1 v1.5.1 Feb 7, 2022 Changes in this version + const BINLOG_CHECKSUM_ALG_CRC32 + const BINLOG_CHECKSUM_ALG_OFF + const BINLOG_CHECKSUM_ALG_UNDEF + const BINLOG_DUMP_NEVER_STOP + const BINLOG_DUMP_NON_BLOCK + const BINLOG_MARIADB_FL_ALLOW_PARALLEL + const BINLOG_MARIADB_FL_DDL + const BINLOG_MARIADB_FL_GROUP_COMMIT_ID + const BINLOG_MARIADB_FL_STANDALONE + const BINLOG_MARIADB_FL_TRANSACTIONAL + const BINLOG_MARIADB_FL_WAITED + const BINLOG_ROW_IAMGE_MINIMAL + const BINLOG_ROW_IMAGE_FULL + const BINLOG_ROW_IMAGE_NOBLOB + const BINLOG_SEND_ANNOTATE_ROWS_EVENT + const BINLOG_THROUGH_GTID + const BINLOG_THROUGH_POSITION + const BinlogChecksumLength + const DATETIMEF_INT_OFS + const EventHeaderSize + const JSONB_DOUBLE + const JSONB_FALSE_LITERAL + const JSONB_INT16 + const JSONB_INT32 + const JSONB_INT64 + const JSONB_LARGE_ARRAY + const JSONB_LARGE_OBJECT + const JSONB_LITERAL + const JSONB_NULL_LITERAL + const JSONB_OPAQUE + const JSONB_SMALL_ARRAY + const JSONB_SMALL_OBJECT + const JSONB_STRING + const JSONB_TRUE_LITERAL + const JSONB_UINT16 + const JSONB_UINT32 + const JSONB_UINT64 + const LOG_EVENT_ARTIFICIAL_F + const LOG_EVENT_BINLOG_IN_USE_F + const LOG_EVENT_FORCED_ROTATE_F + const LOG_EVENT_IGNORABLE_F + const LOG_EVENT_MTS_ISOLATE_F + const LOG_EVENT_NO_FILTER_F + const LOG_EVENT_RELAY_LOG_F + const LOG_EVENT_SUPPRESS_USE_F + const LOG_EVENT_THREAD_SPECIFIC_F + const LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F + const LogicalTimestampTypeCode + const MinBinlogVersion + const PartLogicalTimestampLength + const RowsEventStmtEndFlag + const SidLength + const TABLE_MAP_OPT_META_COLUMN_CHARSET + const TABLE_MAP_OPT_META_COLUMN_NAME + const TABLE_MAP_OPT_META_DEFAULT_CHARSET + const TABLE_MAP_OPT_META_ENUM_AND_SET_COLUMN_CHARSET + const TABLE_MAP_OPT_META_ENUM_AND_SET_DEFAULT_CHARSET + const TABLE_MAP_OPT_META_ENUM_STR_VALUE + const TABLE_MAP_OPT_META_GEOMETRY_TYPE + const TABLE_MAP_OPT_META_PRIMARY_KEY_WITH_PREFIX + const TABLE_MAP_OPT_META_SET_STR_VALUE + const TABLE_MAP_OPT_META_SIGNEDNESS + const TABLE_MAP_OPT_META_SIMPLE_PRIMARY_KEY + const TIMEF_INT_OFS + const TIMEF_OFS + const UndefinedServerVer + var BinLogFileHeader []byte = []byte + var ErrChecksumMismatch = errors.New("binlog checksum mismatch, data may be corrupted") + var ErrNeedSyncAgain = errors.New("Last sync error or closed, try sync and get event again") + var ErrSyncClosed = errors.New("Sync was closed") + var SemiSyncIndicator byte = 0xef + type BeginLoadQueryEvent struct + BlockData []byte + FileID uint32 + func (e *BeginLoadQueryEvent) Decode(data []byte) error + func (e *BeginLoadQueryEvent) Dump(w io.Writer) + type BinlogEvent struct + Event Event + Header *EventHeader + RawData []byte + func (e *BinlogEvent) Dump(w io.Writer) + type BinlogParser struct + func NewBinlogParser() *BinlogParser + func (p *BinlogParser) Parse(data []byte) (*BinlogEvent, error) + func (p *BinlogParser) ParseFile(name string, offset int64, onEvent OnEventFunc) error + func (p *BinlogParser) ParseReader(r io.Reader, onEvent OnEventFunc) error + func (p *BinlogParser) ParseSingleEvent(r io.Reader, onEvent OnEventFunc) (bool, error) + func (p *BinlogParser) Reset() + func (p *BinlogParser) Resume() + func (p *BinlogParser) SetFlavor(flavor string) + func (p *BinlogParser) SetIgnoreJSONDecodeError(ignoreJSONDecodeErr bool) + func (p *BinlogParser) SetParseTime(parseTime bool) + func (p *BinlogParser) SetRawMode(mode bool) + func (p *BinlogParser) SetTimestampStringLocation(timestampStringLocation *time.Location) + func (p *BinlogParser) SetUseDecimal(useDecimal bool) + func (p *BinlogParser) SetVerifyChecksum(verify bool) + func (p *BinlogParser) Stop() + type BinlogStreamer struct + func (s *BinlogStreamer) DumpEvents() []*BinlogEvent + func (s *BinlogStreamer) GetEvent(ctx context.Context) (*BinlogEvent, error) + func (s *BinlogStreamer) GetEventWithStartTime(ctx context.Context, startTime time.Time) (*BinlogEvent, error) + type BinlogSyncer struct + func NewBinlogSyncer(cfg BinlogSyncerConfig) *BinlogSyncer + func (b *BinlogSyncer) Close() + func (b *BinlogSyncer) GetNextPosition() Position + func (b *BinlogSyncer) LastConnectionID() uint32 + func (b *BinlogSyncer) StartBackup(backupDir string, p Position, timeout time.Duration) error + func (b *BinlogSyncer) StartSync(pos Position) (*BinlogStreamer, error) + func (b *BinlogSyncer) StartSyncGTID(gset GTIDSet) (*BinlogStreamer, error) + type BinlogSyncerConfig struct + Charset string + DisableRetrySync bool + DumpCommandFlag uint16 + Flavor string + HeartbeatPeriod time.Duration + Host string + Localhost string + MaxReconnectAttempts int + Option func(*client.Conn) error + ParseTime bool + Password string + Port uint16 + RawModeEnabled bool + ReadTimeout time.Duration + RecvBufferSize int + SemiSyncEnabled bool + ServerID uint32 + TLSConfig *tls.Config + TimestampStringLocation *time.Location + UseDecimal bool + User string + VerifyChecksum bool + type Event interface + Decode func(data []byte) error + Dump func(w io.Writer) + type EventError struct + Data []byte + Err string + Header *EventHeader + func (e *EventError) Error() string + type EventHeader struct + EventSize uint32 + EventType EventType + Flags uint16 + LogPos uint32 + ServerID uint32 + Timestamp uint32 + func (h *EventHeader) Decode(data []byte) error + func (h *EventHeader) Dump(w io.Writer) + type EventType byte + const ANONYMOUS_GTID_EVENT + const APPEND_BLOCK_EVENT + const BEGIN_LOAD_QUERY_EVENT + const CREATE_FILE_EVENT + const DELETE_FILE_EVENT + const DELETE_ROWS_EVENTv0 + const DELETE_ROWS_EVENTv1 + const DELETE_ROWS_EVENTv2 + const EXECUTE_LOAD_QUERY_EVENT + const EXEC_LOAD_EVENT + const FORMAT_DESCRIPTION_EVENT + const GTID_EVENT + const HEARTBEAT_EVENT + const IGNORABLE_EVENT + const INCIDENT_EVENT + const INTVAR_EVENT + const LOAD_EVENT + const MARIADB_ANNOTATE_ROWS_EVENT + const MARIADB_BINLOG_CHECKPOINT_EVENT + const MARIADB_GTID_EVENT + const MARIADB_GTID_LIST_EVENT + const NEW_LOAD_EVENT + const PREVIOUS_GTIDS_EVENT + const QUERY_EVENT + const RAND_EVENT + const ROTATE_EVENT + const ROWS_QUERY_EVENT + const SLAVE_EVENT + const START_EVENT_V3 + const STOP_EVENT + const TABLE_MAP_EVENT + const TRANSACTION_CONTEXT_EVENT + const UNKNOWN_EVENT + const UPDATE_ROWS_EVENTv0 + const UPDATE_ROWS_EVENTv1 + const UPDATE_ROWS_EVENTv2 + const USER_VAR_EVENT + const VIEW_CHANGE_EVENT + const WRITE_ROWS_EVENTv0 + const WRITE_ROWS_EVENTv1 + const WRITE_ROWS_EVENTv2 + const XA_PREPARE_LOG_EVENT + const XID_EVENT + func (e EventType) String() string + type ExecuteLoadQueryEvent struct + DupHandlingFlags uint8 + EndPos uint32 + ErrorCode uint16 + ExecutionTime uint32 + FileID uint32 + SchemaLength uint8 + SlaveProxyID uint32 + StartPos uint32 + StatusVars uint16 + func (e *ExecuteLoadQueryEvent) Decode(data []byte) error + func (e *ExecuteLoadQueryEvent) Dump(w io.Writer) + type FormatDescriptionEvent struct + ChecksumAlgorithm byte + CreateTimestamp uint32 + EventHeaderLength uint8 + EventTypeHeaderLengths []byte + ServerVersion []byte + Version uint16 + func (e *FormatDescriptionEvent) Decode(data []byte) error + func (e *FormatDescriptionEvent) Dump(w io.Writer) + type GTIDEvent struct + CommitFlag uint8 + GNO int64 + ImmediateCommitTimestamp uint64 + ImmediateServerVersion uint32 + LastCommitted int64 + OriginalCommitTimestamp uint64 + OriginalServerVersion uint32 + SID []byte + SequenceNumber int64 + TransactionLength uint64 + func (e *GTIDEvent) Decode(data []byte) error + func (e *GTIDEvent) Dump(w io.Writer) + func (e *GTIDEvent) ImmediateCommitTime() time.Time + func (e *GTIDEvent) OriginalCommitTime() time.Time + type GenericEvent struct + Data []byte + func (e *GenericEvent) Decode(data []byte) error + func (e *GenericEvent) Dump(w io.Writer) + type IntVarEvent struct + Type IntVarEventType + Value uint64 + func (i *IntVarEvent) Decode(data []byte) error + func (i *IntVarEvent) Dump(w io.Writer) + type IntVarEventType byte + const INSERT_ID + const INVALID + const LAST_INSERT_ID + type MariadbAnnotateRowsEvent struct + Query []byte + func (e *MariadbAnnotateRowsEvent) Decode(data []byte) error + func (e *MariadbAnnotateRowsEvent) Dump(w io.Writer) + type MariadbBinlogCheckPointEvent struct + Info []byte + func (e *MariadbBinlogCheckPointEvent) Decode(data []byte) error + func (e *MariadbBinlogCheckPointEvent) Dump(w io.Writer) + type MariadbGTIDEvent struct + CommitID uint64 + Flags byte + GTID MariadbGTID + func (e *MariadbGTIDEvent) Decode(data []byte) error + func (e *MariadbGTIDEvent) Dump(w io.Writer) + func (e *MariadbGTIDEvent) IsDDL() bool + func (e *MariadbGTIDEvent) IsGroupCommit() bool + func (e *MariadbGTIDEvent) IsStandalone() bool + type MariadbGTIDListEvent struct + GTIDs []MariadbGTID + func (e *MariadbGTIDListEvent) Decode(data []byte) error + func (e *MariadbGTIDListEvent) Dump(w io.Writer) + type OnEventFunc func(*BinlogEvent) error + type PreviousGTIDsEvent struct + GTIDSets string + func (e *PreviousGTIDsEvent) Decode(data []byte) error + func (e *PreviousGTIDsEvent) Dump(w io.Writer) + type QueryEvent struct + ErrorCode uint16 + ExecutionTime uint32 + GSet GTIDSet + Query []byte + Schema []byte + SlaveProxyID uint32 + StatusVars []byte + func (e *QueryEvent) Decode(data []byte) error + func (e *QueryEvent) Dump(w io.Writer) + type RotateEvent struct + NextLogName []byte + Position uint64 + func (e *RotateEvent) Decode(data []byte) error + func (e *RotateEvent) Dump(w io.Writer) + type RowsEvent struct + ColumnBitmap1 []byte + ColumnBitmap2 []byte + ColumnCount uint64 + ExtraData []byte + Flags uint16 + Rows [][]interface{} + SkippedColumns [][]int + Table *TableMapEvent + TableID uint64 + Version int + func (e *RowsEvent) Decode(data []byte) (err2 error) + func (e *RowsEvent) Dump(w io.Writer) + type RowsQueryEvent struct + Query []byte + func (e *RowsQueryEvent) Decode(data []byte) error + func (e *RowsQueryEvent) Dump(w io.Writer) + type TableMapEvent struct + ColumnCharset []uint64 + ColumnCount uint64 + ColumnMeta []uint16 + ColumnName [][]byte + ColumnType []byte + DefaultCharset []uint64 + EnumSetColumnCharset []uint64 + EnumSetDefaultCharset []uint64 + EnumStrValue [][][]byte + Flags uint16 + GeometryType []uint64 + NullBitmap []byte + PrimaryKey []uint64 + PrimaryKeyPrefix []uint64 + Schema []byte + SetStrValue [][][]byte + SignednessBitmap []byte + Table []byte + TableID uint64 + func (e *TableMapEvent) CollationMap() map[int]uint64 + func (e *TableMapEvent) ColumnNameString() []string + func (e *TableMapEvent) Decode(data []byte) error + func (e *TableMapEvent) Dump(w io.Writer) + func (e *TableMapEvent) EnumSetCollationMap() map[int]uint64 + func (e *TableMapEvent) EnumStrValueMap() map[int][]string + func (e *TableMapEvent) EnumStrValueString() [][]string + func (e *TableMapEvent) GeometryTypeMap() map[int]uint64 + func (e *TableMapEvent) IsCharacterColumn(i int) bool + func (e *TableMapEvent) IsEnumColumn(i int) bool + func (e *TableMapEvent) IsEnumOrSetColumn(i int) bool + func (e *TableMapEvent) IsGeometryColumn(i int) bool + func (e *TableMapEvent) IsNumericColumn(i int) bool + func (e *TableMapEvent) IsSetColumn(i int) bool + func (e *TableMapEvent) Nullable(i int) (available, nullable bool) + func (e *TableMapEvent) SetStrValueMap() map[int][]string + func (e *TableMapEvent) SetStrValueString() [][]string + func (e *TableMapEvent) UnsignedMap() map[int]bool + type XIDEvent struct + GSet GTIDSet + XID uint64 + func (e *XIDEvent) Decode(data []byte) error + func (e *XIDEvent) Dump(w io.Writer)