binlog

package
v1.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotDML    EventDML = "NoDML"
	InsertDML          = "Insert"
	UpdateDML          = "Update"
	DeleteDML          = "Delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BinlogDMLEvent

type BinlogDMLEvent struct {
	DatabaseName      string
	TableName         string
	DML               EventDML
	WhereColumnValues *sql.ColumnValues
	NewColumnValues   *sql.ColumnValues
}

BinlogDMLEvent is a binary log rows (DML) event entry, with data

func NewBinlogDMLEvent

func NewBinlogDMLEvent(databaseName, tableName string, dml EventDML) *BinlogDMLEvent

func (*BinlogDMLEvent) String

func (this *BinlogDMLEvent) String() string

type BinlogEntry

type BinlogEntry struct {
	Coordinates mysql.BinlogCoordinates
	EndLogPos   uint64

	DmlEvent *BinlogDMLEvent
}

BinlogEntry describes an entry in the binary log

func NewBinlogEntry

func NewBinlogEntry(logFile string, logPos uint64) *BinlogEntry

NewBinlogEntry creates an empty, ready to go BinlogEntry object

func NewBinlogEntryAt

func NewBinlogEntryAt(coordinates mysql.BinlogCoordinates) *BinlogEntry

NewBinlogEntry creates an empty, ready to go BinlogEntry object

func (*BinlogEntry) Duplicate

func (this *BinlogEntry) Duplicate() *BinlogEntry

Duplicate creates and returns a new binlog entry, with some of the attributes pre-assigned

func (*BinlogEntry) String

func (this *BinlogEntry) String() string

Duplicate creates and returns a new binlog entry, with some of the attributes pre-assigned

type BinlogReader

type BinlogReader interface {
	StreamEvents(canStopStreaming func() bool, entriesChannel chan<- *BinlogEntry) error
	Reconnect() error
}

BinlogReader is a general interface whose implementations can choose their methods of reading a binary log file and parsing it into binlog entries

type EventDML

type EventDML string

func ToEventDML

func ToEventDML(description string) EventDML

type GoMySQLReader

type GoMySQLReader struct {
	LastAppliedRowsEventHint mysql.BinlogCoordinates
	// contains filtered or unexported fields
}

func NewGoMySQLReader

func NewGoMySQLReader(connectionConfig *mysql.ConnectionConfig) (binlogReader *GoMySQLReader, err error)

func (*GoMySQLReader) ConnectBinlogStreamer

func (this *GoMySQLReader) ConnectBinlogStreamer(coordinates mysql.BinlogCoordinates) (err error)

ConnectBinlogStreamer

func (*GoMySQLReader) GetCurrentBinlogCoordinates added in v0.7.16

func (this *GoMySQLReader) GetCurrentBinlogCoordinates() *mysql.BinlogCoordinates

func (*GoMySQLReader) StreamEvents

func (this *GoMySQLReader) StreamEvents(canStopStreaming func() bool, entriesChannel chan<- *BinlogEntry) error

StreamEvents

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL