binlog

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binlog

type Binlog struct {
	// github.com/siddontang/go-mysql interface
	canal.DummyEventHandler
	// config
	Config *app.MysqlConfig

	// event unique index
	EventIndex int64
	// contains filtered or unexported fields
}

func NewBinlog

func NewBinlog(ctx *app.Context, opts ...BinlogOption) *Binlog

创建一个binlog服务对象

func (*Binlog) Close

func (h *Binlog) Close()

关闭binlog服务

func (*Binlog) OnDDL

func (h *Binlog) OnDDL(p mysql.Position, e *replication.QueryEvent) error

暂未使用的基础事件

func (*Binlog) OnGTID

func (h *Binlog) OnGTID(g mysql.GTIDSet) error

暂未使用的基础事件

func (*Binlog) OnLeader

func (h *Binlog) OnLeader(isLeader bool)

选leader回调 binlog服务启动和停止由此控制

func (*Binlog) OnPosSynced

func (h *Binlog) OnPosSynced(p mysql.Position, b bool) error

pos改变事件

func (*Binlog) OnRotate

func (h *Binlog) OnRotate(e *replication.RotateEvent) error

暂未使用的基础事件

func (*Binlog) OnRow

func (h *Binlog) OnRow(e *canal.RowsEvent) error

数据改变事件回调

func (*Binlog) OnTableChanged

func (h *Binlog) OnTableChanged(schema string, table string) error

alter table结构改变事件回调

func (*Binlog) OnXID

func (h *Binlog) OnXID(p mysql.Position) error

暂未使用的基础事件

func (*Binlog) RegisterService

func (h *Binlog) RegisterService(s service.Service)

注册服务

func (*Binlog) SaveBinlogPosition

func (h *Binlog) SaveBinlogPosition(r []byte)

use for agent sync pos callback 保存pos信息到cache 这里的api对外提供,用于agent集群同步pos信息

func (*Binlog) Start

func (h *Binlog) Start()

启动binlog 这里启动的是服务插件

func (*Binlog) StartService

func (h *Binlog) StartService()

启动服务 这里只是发出了启动服务信号

func (*Binlog) StopService

func (h *Binlog) StopService(exit bool)

停止服务 参数exit为true时,会彻底退出服务 这里只是发出了停止服务信号

func (*Binlog) String

func (h *Binlog) String() string

String 基础接口

type BinlogOption

type BinlogOption func(h *Binlog)

func OnEvent

func OnEvent(f OnEventFunc) BinlogOption

set on event callback 设置事件回调api

func PosChange

func PosChange(f PosChangeFunc) BinlogOption

set pos change callback if pos change, will call h.onPosChanges func 设置binlog pos改变回调api

type OnEventFunc

type OnEventFunc func(table string, data []byte)

type PosChangeFunc

type PosChangeFunc func(r []byte)

Jump to

Keyboard shortcuts

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