binlog_monitor

package module
v0.0.0-...-ac6babd Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 7 Imported by: 0

README

binlog_monitor

This project combines bin-log from mysql, mq.

It will send message to specific topic when bin-log is appended. And also provide receiver sdk to help you to consume message.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType int
const (
	Unknown ActionType = iota
	Delete  ActionType = 1
	Insert  ActionType = 2
	Update  ActionType = 3
	Any     ActionType = 4
)

func GetAction

func GetAction(str string) ActionType

type BinLogMessage

type BinLogMessage struct {
	TableName string
	DBName    string
	Action    ActionType
	Data      [][]interface{}
}

type Client

type Client struct {
	Handler *monitorHandler
	// contains filtered or unexported fields
}

func GetClientWithConfig

func GetClientWithConfig(config *canal.Config) *Client

func GetDefaultClient

func GetDefaultClient() *Client

func (*Client) Register

func (c *Client) Register(tableName, topic string, action ActionType)

func (*Client) SetOnDDLHandler

func (c *Client) SetOnDDLHandler(funcHandler OnDDLHandler)

func (*Client) SetOnGTIDHandler

func (c *Client) SetOnGTIDHandler(funcHandler OnGTIDHandler)

func (*Client) SetOnPosSyncedHandler

func (c *Client) SetOnPosSyncedHandler(funcHandler OnPosSyncedHandler)

func (*Client) SetOnRotateHandler

func (c *Client) SetOnRotateHandler(funcHandler OnRotateHandler)

func (*Client) SetOnRowHandler

func (c *Client) SetOnRowHandler(funcHandler OnRowHandler)

func (*Client) SetOnTableChangedHandler

func (c *Client) SetOnTableChangedHandler(funcHandler OnTableChangedHandler)

func (*Client) SetOnXIDHandler

func (c *Client) SetOnXIDHandler(funcHandler OnXIDHandler)

func (*Client) Start

func (c *Client) Start()

func (*Client) StartWithPos

func (c *Client) StartWithPos(pos *mysql.Position)

func (*Client) Stop

func (c *Client) Stop()

type OnDDLHandler

type OnDDLHandler func(nextPos mysql.Position, queryEvent *replication.QueryEvent) error

type OnGTIDHandler

type OnGTIDHandler func(gtid mysql.GTIDSet) error

type OnPosSyncedHandler

type OnPosSyncedHandler func(pos mysql.Position, set mysql.GTIDSet, force bool) error

type OnRotateHandler

type OnRotateHandler func(r *replication.RotateEvent) error

type OnRowHandler

type OnRowHandler func(ev *canal.RowsEvent) error

type OnTableChangedHandler

type OnTableChangedHandler func(schema string, table string) error

type OnXIDHandler

type OnXIDHandler func(nextPos mysql.Position) error

Jump to

Keyboard shortcuts

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