Documentation
¶
Index ¶
Constants ¶
View Source
const ( ACTION_UPDATE = "update" ACTION_INSERT = "insert" ACTION_DELETE = "delete" )
The action name for sync.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity interface { SavePos() bool // 实体ACK后是否需要保存位置 Pos() mysql.Position // 获取位置信息 String() string }
Entity 事件实体 实体会直接存储在EventStore中 不同类型的Event实体,则处理不同 RowEvent实体不需要保存位置 XIDEvent,RotateEvent需要保存位置 保存位置信息时机为,Canald ACK后,倒叙拿到实体列表的最近的一个可保存的实体,获取位置信息缓存并落地 落地的策略根据配置可进行文件和Etcd落地
type Record ¶
type Record struct { // 区分多个用户空间 Namespace string `json:"namespace"` // 命名空间 Action string `json:"action"` Schema string `json:"schema"` Name string `json:"name"` PkNames []string `json:"pk_names"` Columns []map[string]interface{} `json:"columns"` // 字段 和 对应的值 }
Record 数据库记录变更结构
func (Record) ColumnsBytes ¶
ColumnsBytes columns bytes
type RotateEvent ¶
RotateEvent binglog文件轮转
type RowsEvent ¶
type RowsEvent struct { LogName string // binlog 文件名称 Save bool // 是否保存位点 Table *schema.Table Action string // changed row list // binlog has three update event version, v0, v1 and v2. // for v1 and v2, the rows number must be even. // Two rows for one event, format is [before update row, after update row] // for update v0, only one row for a event, and we don't support this version. Rows [][]interface{} // Header can be used to inspect the event Header *replication.EventHeader }
RowsEvent is the event for row replication.
func NewRowsEvent ¶
func NewRowsEvent(table *schema.Table, action, logName string, rows [][]interface{}, header *replication.EventHeader) *RowsEvent
NewRowsEvent new rows event
Click to show internal directories.
Click to hide internal directories.