parse

package
v0.0.0-...-584552c Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TRANSACTION_BEGIN = "BEGIN"
	TRANSACTION_END   = "COMMIT"
)
View Source
const (
	TYPE_NUMBER    = iota + 1 // tinyint, smallint, mediumint, int, bigint, year
	TYPE_FLOAT                // float, double
	TYPE_ENUM                 // enum
	TYPE_SET                  // set
	TYPE_STRING               // other
	TYPE_DATETIME             // datetime
	TYPE_TIMESTAMP            // timestamp
	TYPE_DATE                 // date
	TYPE_TIME                 // time
	TYPE_BIT                  // bit
	TYPE_JSON                 // json
)
View Source
const MASTER_HEARTBEAT_PERIOD_SECONDS = 15

Master heartbeat interval

View Source
const UTF8 = "UTF8"

Variables

View Source
var IgnoreEventErr = errors.New("ignore event")

Functions

This section is empty.

Types

type AuthenticInfo

type AuthenticInfo struct {
	// contains filtered or unexported fields
}

type DdlParserResult

type DdlParserResult struct {
	// contains filtered or unexported fields
}

type DdlSQLParser

type DdlSQLParser struct {
	// contains filtered or unexported fields
}

func NewSQLParser

func NewSQLParser(sql string) *DdlSQLParser

func (*DdlSQLParser) Parse

func (dsp *DdlSQLParser) Parse(dbName string) ([]*DdlParserResult, error)

type EventConvert

type EventConvert struct {
	FilterQueryDcl bool
	FilterQueryDml bool
	FilterQueryDdl bool
	FilterTableErr bool
	FilterRows     bool
	// contains filtered or unexported fields
}

func NewEventCovert

func NewEventCovert(tblMetaCache *TableMetaCache) *EventConvert

func (*EventConvert) Parse

func (ec *EventConvert) Parse(event *LogEvent) (entry *Entry, err error)

type Index

type Index struct {
	Name     string
	Columns  []string
	IsPK     bool
	IsUnique bool
}

type LogDecoder

type LogDecoder struct {
	// contains filtered or unexported fields
}

func NewDumpEventLogDecoder

func NewDumpEventLogDecoder() *LogDecoder

func NewEmptyLogDecoder

func NewEmptyLogDecoder() *LogDecoder

func NewLogDecoder

func NewLogDecoder(from, to LogEventType) *LogDecoder

func NewSinkEventLogDecoder

func NewSinkEventLogDecoder() *LogDecoder

func (*LogDecoder) Decode

func (ld *LogDecoder) Decode(data []byte) (*LogEvent, error)

type LogFetcher

type LogFetcher struct {
	// contains filtered or unexported fields
}

func NewLogFetcher

func NewLogFetcher(conn *MySQLConnection, ld *LogDecoder) *LogFetcher

func (*LogFetcher) Close

func (lf *LogFetcher) Close() error

Close the LogSteamer.

func (*LogFetcher) Fetch

func (lf *LogFetcher) Fetch() (*LogEvent, error)

type LogSteamer

type LogSteamer struct {
	// contains filtered or unexported fields
}

func NewLogSteamer

func NewLogSteamer(conn *MySQLConnection, ld *LogDecoder) *LogSteamer

func (*LogSteamer) Close

func (ls *LogSteamer) Close() error

Close the LogSteamer.

func (*LogSteamer) Fetch

func (ls *LogSteamer) Fetch() *Streamer

type MemoryTableMeta

type MemoryTableMeta struct {
	// contains filtered or unexported fields
}

type MySQLConnection

type MySQLConnection struct {
	*MySQLConnector
	// contains filtered or unexported fields
}

func NewMySQLConnection

func NewMySQLConnection(auth *AuthenticInfo, slaveId uint32) *MySQLConnection

func (*MySQLConnection) Connect

func (mc *MySQLConnection) Connect() error

func (*MySQLConnection) Disconnect

func (mc *MySQLConnection) Disconnect() error

func (*MySQLConnection) Dump

func (mc *MySQLConnection) Dump(binlogName string, position uint32, sinkFunc SinkFunction) error

func (*MySQLConnection) Fork

func (mc *MySQLConnection) Fork() *MySQLConnection

func (*MySQLConnection) Reconnect

func (mc *MySQLConnection) Reconnect() error

func (*MySQLConnection) Sink

func (mc *MySQLConnection) Sink(binlogName string, position uint32, sinkFunc SinkFunction) error

type MySQLEventParser

type MySQLEventParser struct {
	*MySQLConnection

	MasterAuth     *AuthenticInfo
	SlaveAuth      *AuthenticInfo
	MasterPosition *protoc.EntryPosition
	SlavePosition  *protoc.EntryPosition

	BinLogFormat binlogFormatImage
	BinLogImage  binlogFormatImage
	// contains filtered or unexported fields
}

func NewMySQLEventParser

func NewMySQLEventParser(destination string, slaveId int) *MySQLEventParser

func (*MySQLEventParser) BuildMySQLConnection

func (mp *MySQLEventParser) BuildMySQLConnection(auth *AuthenticInfo) (*MySQLConnection, error)

func (*MySQLEventParser) FindStartPosition

func (mp *MySQLEventParser) FindStartPosition() *protoc.EntryPosition

func (*MySQLEventParser) PrepareDump

func (mp *MySQLEventParser) PrepareDump() error

type RawIndex

type RawIndex struct {
	// contains filtered or unexported fields
}

type RawTableColumn

type RawTableColumn struct {
	// contains filtered or unexported fields
}

type SinkFunction

type SinkFunction func(event *LogEvent) bool

type Streamer

type Streamer struct {
	// contains filtered or unexported fields
}

func NewStreamer

func NewStreamer() *Streamer

func (*Streamer) GetEvent

func (s *Streamer) GetEvent() (*LogEvent, error)

type TableColumn

type TableColumn struct {
	Name       string
	Type       int
	RawType    string
	Collation  string
	Nullable   bool
	IsAuto     bool
	IsUnsigned bool
	EnumValues []string
	SetValues  []string
}

type TableMeta

type TableMeta struct {
	Schema string
	Table  string

	Columns []*TableColumn
	Indexes map[string]*Index
}

type TableMetaCache

type TableMetaCache struct {
	// contains filtered or unexported fields
}

func NewTableMetaCache

func NewTableMetaCache(conn *MySQLConnection, destination string) (*TableMetaCache, error)

func (*TableMetaCache) GetOneTableMeta

func (tmc *TableMetaCache) GetOneTableMeta(schema string, table string) *TableMeta

func (*TableMetaCache) GetOneTableMetaViaTSDB

func (tmc *TableMetaCache) GetOneTableMetaViaTSDB(schema, table string, position *protoc.EntryPosition, useCache bool) *TableMeta

func (*TableMetaCache) RemoveOneTableMeta

func (tmc *TableMetaCache) RemoveOneTableMeta(schema string, table string)

func (*TableMetaCache) RestoreOneTableMeta

func (tmc *TableMetaCache) RestoreOneTableMeta(schema string, table string) error

type TableMetaTSDB

type TableMetaTSDB struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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