Documentation ¶
Index ¶
- Variables
- type EnhancedReader
- func (r *EnhancedReader) Close() error
- func (r *EnhancedReader) NextRowsEvent(ctx context.Context) (*EnhancedRowsEvent, error)
- func (r *EnhancedReader) ReadEvent(ctx context.Context) (*Event, error)
- func (r *EnhancedReader) Safepoint() binlog.Position
- func (r *EnhancedReader) State() binlog.Position
- func (r *EnhancedReader) WhitelistTables(database string, tables ...string) error
- type EnhancedRowsEvent
- type Event
- type Reader
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnknownTableID is returned when a table ID from a rows event is // missing in the table map index. ErrUnknownTableID = errors.New("Unknown table ID") )
Functions ¶
This section is empty.
Types ¶
type EnhancedReader ¶
type EnhancedReader struct {
// contains filtered or unexported fields
}
EnhancedReader is an extended version of the reader that maintains schema details to add column names and signed integers support.
func NewEnhanced ¶
func NewEnhanced(dsn string, sc driver.Config) (*EnhancedReader, error)
NewEnhanced creates a new enhanced binary log reader.
func (*EnhancedReader) Close ¶
func (r *EnhancedReader) Close() error
Close underlying database connection.
func (*EnhancedReader) NextRowsEvent ¶
func (r *EnhancedReader) NextRowsEvent(ctx context.Context) (*EnhancedRowsEvent, error)
NextRowsEvent returns the next rows event for a whitelisted table. It blocks until next event is received or context is cancelled.
func (*EnhancedReader) ReadEvent ¶
func (r *EnhancedReader) ReadEvent(ctx context.Context) (*Event, error)
ReadEvent reads next event from the binary log.
func (*EnhancedReader) Safepoint ¶
func (r *EnhancedReader) Safepoint() binlog.Position
Safepoint returns last encountered position that is considered safe to start with.
func (*EnhancedReader) State ¶
func (r *EnhancedReader) State() binlog.Position
State returns current position in the binary log.
func (*EnhancedReader) WhitelistTables ¶
func (r *EnhancedReader) WhitelistTables(database string, tables ...string) error
WhitelistTables adds given tables of the given database to processing white list.
type EnhancedRowsEvent ¶
type EnhancedRowsEvent struct { Header binlog.EventHeader Table binlog.TableDescription Rows []map[string]interface{} }
EnhancedRowsEvent ...
type Event ¶
type Event struct { Format binlog.FormatDescription Header binlog.EventHeader Buffer []byte Offset uint64 // Table is not empty for rows events Table *binlog.TableDescription }
Event contains binlog event details.