Documentation
¶
Index ¶
- Variables
- type Column
- func (*Column) Descriptor() ([]byte, []int)deprecated
- func (x *Column) GetIndex() int32
- func (x *Column) GetIsKey() bool
- func (x *Column) GetIsNull() bool
- func (m *Column) GetIsNullPresent() isColumn_IsNullPresent
- func (x *Column) GetLength() int32
- func (x *Column) GetMysqlType() string
- func (x *Column) GetName() string
- func (x *Column) GetProps() []*Pair
- func (x *Column) GetSqlType() int32
- func (x *Column) GetUpdated() bool
- func (x *Column) GetValue() string
- func (*Column) ProtoMessage()
- func (x *Column) ProtoReflect() protoreflect.Message
- func (x *Column) Reset()
- func (x *Column) String() string
- type Column_IsNull
- type Entry
- func (*Entry) Descriptor() ([]byte, []int)deprecated
- func (x *Entry) GetEntryType() EntryType
- func (m *Entry) GetEntryTypePresent() isEntry_EntryTypePresent
- func (x *Entry) GetHeader() *Header
- func (x *Entry) GetStoreValue() []byte
- func (*Entry) ProtoMessage()
- func (x *Entry) ProtoReflect() protoreflect.Message
- func (x *Entry) Reset()
- func (x *Entry) String() string
- type EntryType
- type Entry_EntryType
- type EventType
- type Header
- func (*Header) Descriptor() ([]byte, []int)deprecated
- func (x *Header) GetEventLength() int64
- func (x *Header) GetEventType() EventType
- func (m *Header) GetEventTypePresent() isHeader_EventTypePresent
- func (x *Header) GetExecuteTime() int64
- func (x *Header) GetGtid() string
- func (x *Header) GetLogfileName() string
- func (x *Header) GetLogfileOffset() int64
- func (x *Header) GetProps() []*Pair
- func (x *Header) GetSchemaName() string
- func (x *Header) GetServerId() int64
- func (x *Header) GetServerenCode() string
- func (x *Header) GetSourceType() Type
- func (m *Header) GetSourceTypePresent() isHeader_SourceTypePresent
- func (x *Header) GetTableName() string
- func (x *Header) GetVersion() int32
- func (m *Header) GetVersionPresent() isHeader_VersionPresent
- func (*Header) ProtoMessage()
- func (x *Header) ProtoReflect() protoreflect.Message
- func (x *Header) Reset()
- func (x *Header) String() string
- type Header_EventType
- type Header_SourceType
- type Header_Version
- type Pair
- type RowChange
- func (*RowChange) Descriptor() ([]byte, []int)deprecated
- func (x *RowChange) GetDdlSchemaName() string
- func (x *RowChange) GetEventType() EventType
- func (m *RowChange) GetEventTypePresent() isRowChange_EventTypePresent
- func (x *RowChange) GetIsDdl() bool
- func (m *RowChange) GetIsDdlPresent() isRowChange_IsDdlPresent
- func (x *RowChange) GetProps() []*Pair
- func (x *RowChange) GetRowDatas() []*RowData
- func (x *RowChange) GetSql() string
- func (x *RowChange) GetTableId() int64
- func (*RowChange) ProtoMessage()
- func (x *RowChange) ProtoReflect() protoreflect.Message
- func (x *RowChange) Reset()
- func (x *RowChange) String() string
- type RowChange_EventType
- type RowChange_IsDdl
- type RowData
- func (*RowData) Descriptor() ([]byte, []int)deprecated
- func (x *RowData) GetAfterColumns() []*Column
- func (x *RowData) GetBeforeColumns() []*Column
- func (x *RowData) GetProps() []*Pair
- func (*RowData) ProtoMessage()
- func (x *RowData) ProtoReflect() protoreflect.Message
- func (x *RowData) Reset()
- func (x *RowData) String() string
- type TransactionBegin
- func (*TransactionBegin) Descriptor() ([]byte, []int)deprecated
- func (x *TransactionBegin) GetExecuteTime() int64
- func (x *TransactionBegin) GetProps() []*Pair
- func (x *TransactionBegin) GetThreadId() int64
- func (x *TransactionBegin) GetTransactionId() string
- func (*TransactionBegin) ProtoMessage()
- func (x *TransactionBegin) ProtoReflect() protoreflect.Message
- func (x *TransactionBegin) Reset()
- func (x *TransactionBegin) String() string
- type TransactionEnd
- func (*TransactionEnd) Descriptor() ([]byte, []int)deprecated
- func (x *TransactionEnd) GetExecuteTime() int64
- func (x *TransactionEnd) GetProps() []*Pair
- func (x *TransactionEnd) GetTransactionId() string
- func (*TransactionEnd) ProtoMessage()
- func (x *TransactionEnd) ProtoReflect() protoreflect.Message
- func (x *TransactionEnd) Reset()
- func (x *TransactionEnd) String() string
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EntryType_name = map[int32]string{ 0: "ENTRYTYPECOMPATIBLEPROTO2", 1: "TRANSACTIONBEGIN", 2: "ROWDATA", 3: "TRANSACTIONEND", 4: "HEARTBEAT", 5: "GTIDLOG", } EntryType_value = map[string]int32{ "ENTRYTYPECOMPATIBLEPROTO2": 0, "TRANSACTIONBEGIN": 1, "ROWDATA": 2, "TRANSACTIONEND": 3, "HEARTBEAT": 4, "GTIDLOG": 5, } )
Enum value maps for EntryType.
View Source
var ( EventType_name = map[int32]string{ 0: "EVENTTYPECOMPATIBLEPROTO2", 1: "INSERT", 2: "UPDATE", 3: "DELETE", 4: "CREATE", 5: "ALTER", 6: "ERASE", 7: "QUERY", 8: "TRUNCATE", 9: "RENAME", 10: "CINDEX", 11: "DINDEX", 12: "GTID", 13: "XACOMMIT", 14: "XAROLLBACK", 15: "MHEARTBEAT", } EventType_value = map[string]int32{ "EVENTTYPECOMPATIBLEPROTO2": 0, "INSERT": 1, "UPDATE": 2, "DELETE": 3, "CREATE": 4, "ALTER": 5, "ERASE": 6, "QUERY": 7, "TRUNCATE": 8, "RENAME": 9, "CINDEX": 10, "DINDEX": 11, "GTID": 12, "XACOMMIT": 13, "XAROLLBACK": 14, "MHEARTBEAT": 15, } )
Enum value maps for EventType.
View Source
var ( Type_name = map[int32]string{ 0: "TYPECOMPATIBLEPROTO2", 1: "ORACLE", 2: "MYSQL", 3: "PGSQL", } Type_value = map[string]int32{ "TYPECOMPATIBLEPROTO2": 0, "ORACLE": 1, "MYSQL": 2, "PGSQL": 3, } )
Enum value maps for Type.
View Source
var File_canal_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct {
//*字段下标*
Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
//*字段java中类型*
SqlType int32 `protobuf:"varint,2,opt,name=sqlType,proto3" json:"sqlType,omitempty"`
//*字段名称(忽略大小写),在mysql中是没有的*
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
//*是否是主键*
IsKey bool `protobuf:"varint,4,opt,name=isKey,proto3" json:"isKey,omitempty"`
//*如果EventType=UPDATE,用于标识这个字段值是否有修改*
Updated bool `protobuf:"varint,5,opt,name=updated,proto3" json:"updated,omitempty"`
//[default = false]
//
// Types that are assignable to IsNullPresent:
// *Column_IsNull
IsNullPresent isColumn_IsNullPresent `protobuf_oneof:"isNull_present"`
//*预留扩展*
Props []*Pair `protobuf:"bytes,7,rep,name=props,proto3" json:"props,omitempty"`
//* 字段值,timestamp,Datetime是一个时间格式的文本 *
Value string `protobuf:"bytes,8,opt,name=value,proto3" json:"value,omitempty"`
//* 对应数据对象原始长度 *
Length int32 `protobuf:"varint,9,opt,name=length,proto3" json:"length,omitempty"`
//*字段mysql类型*
MysqlType string `protobuf:"bytes,10,opt,name=mysqlType,proto3" json:"mysqlType,omitempty"`
// contains filtered or unexported fields
}
*每个字段的数据结构*
func (*Column) Descriptor
deprecated
func (*Column) GetIsNullPresent ¶
func (m *Column) GetIsNullPresent() isColumn_IsNullPresent
func (*Column) GetMysqlType ¶
func (*Column) GetSqlType ¶
func (*Column) GetUpdated ¶
func (*Column) ProtoMessage ¶
func (*Column) ProtoMessage()
func (*Column) ProtoReflect ¶
func (x *Column) ProtoReflect() protoreflect.Message
type Column_IsNull ¶
type Column_IsNull struct {
IsNull bool `protobuf:"varint,6,opt,name=isNull,proto3,oneof"`
}
type Entry ¶
type Entry struct {
//*协议头部信息*
Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
///**打散后的事件类型**/ [default = ROWDATA]
//
// Types that are assignable to EntryTypePresent:
// *Entry_EntryType
EntryTypePresent isEntry_EntryTypePresent `protobuf_oneof:"entryType_present"`
//*传输的二进制数组*
StoreValue []byte `protobuf:"bytes,3,opt,name=storeValue,proto3" json:"storeValue,omitempty"`
// contains filtered or unexported fields
}
*************************************************************** message model 如果要在Enum中新增类型,确保以前的类型的下标值不变. **************************************************************
func (*Entry) Descriptor
deprecated
func (*Entry) GetEntryType ¶
func (*Entry) GetEntryTypePresent ¶
func (m *Entry) GetEntryTypePresent() isEntry_EntryTypePresent
func (*Entry) GetStoreValue ¶
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
func (*Entry) ProtoReflect ¶
func (x *Entry) ProtoReflect() protoreflect.Message
type EntryType ¶
type EntryType int32
*打散后的事件类型,主要用于标识事务的开始,变更数据,结束*
func (EntryType) Descriptor ¶
func (EntryType) Descriptor() protoreflect.EnumDescriptor
func (EntryType) EnumDescriptor
deprecated
func (EntryType) Number ¶
func (x EntryType) Number() protoreflect.EnumNumber
func (EntryType) Type ¶
func (EntryType) Type() protoreflect.EnumType
type Entry_EntryType ¶
type Entry_EntryType struct {
EntryType EntryType `protobuf:"varint,2,opt,name=entryType,proto3,enum=canal.EntryType,oneof"`
}
type EventType ¶
type EventType int32
* 事件类型 *
const ( EventType_EVENTTYPECOMPATIBLEPROTO2 EventType = 0 EventType_INSERT EventType = 1 EventType_UPDATE EventType = 2 EventType_DELETE EventType = 3 EventType_CREATE EventType = 4 EventType_ALTER EventType = 5 EventType_ERASE EventType = 6 EventType_QUERY EventType = 7 EventType_TRUNCATE EventType = 8 EventType_RENAME EventType = 9 //*CREATE INDEX* EventType_CINDEX EventType = 10 EventType_DINDEX EventType = 11 EventType_GTID EventType = 12 //* XA * EventType_XACOMMIT EventType = 13 EventType_XAROLLBACK EventType = 14 //* MASTER HEARTBEAT * EventType_MHEARTBEAT EventType = 15 )
func (EventType) Descriptor ¶
func (EventType) Descriptor() protoreflect.EnumDescriptor
func (EventType) EnumDescriptor
deprecated
func (EventType) Number ¶
func (x EventType) Number() protoreflect.EnumNumber
func (EventType) Type ¶
func (EventType) Type() protoreflect.EnumType
type Header ¶
type Header struct {
//[default = 1]
//
// Types that are assignable to VersionPresent:
// *Header_Version
VersionPresent isHeader_VersionPresent `protobuf_oneof:"version_present"`
//*binlog/redolog 文件名*
LogfileName string `protobuf:"bytes,2,opt,name=logfileName,proto3" json:"logfileName,omitempty"`
//*binlog/redolog 文件的偏移位置*
LogfileOffset int64 `protobuf:"varint,3,opt,name=logfileOffset,proto3" json:"logfileOffset,omitempty"`
//*服务端serverId*
ServerId int64 `protobuf:"varint,4,opt,name=serverId,proto3" json:"serverId,omitempty"`
//* 变更数据的编码 *
ServerenCode string `protobuf:"bytes,5,opt,name=serverenCode,proto3" json:"serverenCode,omitempty"`
//*变更数据的执行时间 *
ExecuteTime int64 `protobuf:"varint,6,opt,name=executeTime,proto3" json:"executeTime,omitempty"`
//[default = MYSQL]
//
// Types that are assignable to SourceTypePresent:
// *Header_SourceType
SourceTypePresent isHeader_SourceTypePresent `protobuf_oneof:"sourceType_present"`
//* 变更数据的schemaname*
SchemaName string `protobuf:"bytes,8,opt,name=schemaName,proto3" json:"schemaName,omitempty"`
//*变更数据的tablename*
TableName string `protobuf:"bytes,9,opt,name=tableName,proto3" json:"tableName,omitempty"`
//*每个event的长度*
EventLength int64 `protobuf:"varint,10,opt,name=eventLength,proto3" json:"eventLength,omitempty"`
// [default = UPDATE]
//
// Types that are assignable to EventTypePresent:
// *Header_EventType
EventTypePresent isHeader_EventTypePresent `protobuf_oneof:"eventType_present"`
//*预留扩展*
Props []*Pair `protobuf:"bytes,12,rep,name=props,proto3" json:"props,omitempty"`
//*当前事务的gitd*
Gtid string `protobuf:"bytes,13,opt,name=gtid,proto3" json:"gtid,omitempty"`
// contains filtered or unexported fields
}
*message Header*
func (*Header) Descriptor
deprecated
func (*Header) GetEventLength ¶
func (*Header) GetEventType ¶
func (*Header) GetEventTypePresent ¶
func (m *Header) GetEventTypePresent() isHeader_EventTypePresent
func (*Header) GetExecuteTime ¶
func (*Header) GetLogfileName ¶
func (*Header) GetLogfileOffset ¶
func (*Header) GetSchemaName ¶
func (*Header) GetServerId ¶
func (*Header) GetServerenCode ¶
func (*Header) GetSourceType ¶
func (*Header) GetSourceTypePresent ¶
func (m *Header) GetSourceTypePresent() isHeader_SourceTypePresent
func (*Header) GetTableName ¶
func (*Header) GetVersion ¶
func (*Header) GetVersionPresent ¶
func (m *Header) GetVersionPresent() isHeader_VersionPresent
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type Header_EventType ¶
type Header_EventType struct {
EventType EventType `protobuf:"varint,11,opt,name=eventType,proto3,enum=canal.EventType,oneof"`
}
type Header_SourceType ¶
type Header_SourceType struct {
SourceType Type `protobuf:"varint,7,opt,name=sourceType,proto3,enum=canal.Type,oneof"`
}
type Header_Version ¶
type Header_Version struct {
Version int32 `protobuf:"varint,1,opt,name=version,proto3,oneof"`
}
type Pair ¶
type Pair struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
*预留扩展*
func (*Pair) Descriptor
deprecated
func (*Pair) ProtoMessage ¶
func (*Pair) ProtoMessage()
func (*Pair) ProtoReflect ¶
func (x *Pair) ProtoReflect() protoreflect.Message
type RowChange ¶
type RowChange struct {
//*tableId,由数据库产生*
TableId int64 `protobuf:"varint,1,opt,name=tableId,proto3" json:"tableId,omitempty"`
//[default = UPDATE]
//
// Types that are assignable to EventTypePresent:
// *RowChange_EventType
EventTypePresent isRowChange_EventTypePresent `protobuf_oneof:"eventType_present"`
// [default = false]
//
// Types that are assignable to IsDdlPresent:
// *RowChange_IsDdl
IsDdlPresent isRowChange_IsDdlPresent `protobuf_oneof:"isDdl_present"`
//* ddl/query的sql语句 *
Sql string `protobuf:"bytes,11,opt,name=sql,proto3" json:"sql,omitempty"`
//* 一次数据库变更可能存在多行 *
RowDatas []*RowData `protobuf:"bytes,12,rep,name=rowDatas,proto3" json:"rowDatas,omitempty"`
//*预留扩展*
Props []*Pair `protobuf:"bytes,13,rep,name=props,proto3" json:"props,omitempty"`
//* ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName *
DdlSchemaName string `protobuf:"bytes,14,opt,name=ddlSchemaName,proto3" json:"ddlSchemaName,omitempty"`
// contains filtered or unexported fields
}
*message row 每行变更数据的数据结构*
func (*RowChange) Descriptor
deprecated
func (*RowChange) GetDdlSchemaName ¶
func (*RowChange) GetEventType ¶
func (*RowChange) GetEventTypePresent ¶
func (m *RowChange) GetEventTypePresent() isRowChange_EventTypePresent
func (*RowChange) GetIsDdlPresent ¶
func (m *RowChange) GetIsDdlPresent() isRowChange_IsDdlPresent
func (*RowChange) GetRowDatas ¶
func (*RowChange) GetTableId ¶
func (*RowChange) ProtoMessage ¶
func (*RowChange) ProtoMessage()
func (*RowChange) ProtoReflect ¶
func (x *RowChange) ProtoReflect() protoreflect.Message
type RowChange_EventType ¶
type RowChange_EventType struct {
EventType EventType `protobuf:"varint,2,opt,name=eventType,proto3,enum=canal.EventType,oneof"`
}
type RowChange_IsDdl ¶
type RowChange_IsDdl struct {
IsDdl bool `protobuf:"varint,10,opt,name=isDdl,proto3,oneof"`
}
type RowData ¶
type RowData struct {
//* 字段信息,增量数据(修改前,删除前) *
BeforeColumns []*Column `protobuf:"bytes,1,rep,name=beforeColumns,proto3" json:"beforeColumns,omitempty"`
//* 字段信息,增量数据(修改后,新增后) *
AfterColumns []*Column `protobuf:"bytes,2,rep,name=afterColumns,proto3" json:"afterColumns,omitempty"`
//*预留扩展*
Props []*Pair `protobuf:"bytes,3,rep,name=props,proto3" json:"props,omitempty"`
// contains filtered or unexported fields
}
func (*RowData) Descriptor
deprecated
func (*RowData) GetAfterColumns ¶
func (*RowData) GetBeforeColumns ¶
func (*RowData) ProtoMessage ¶
func (*RowData) ProtoMessage()
func (*RowData) ProtoReflect ¶
func (x *RowData) ProtoReflect() protoreflect.Message
type TransactionBegin ¶
type TransactionBegin struct {
//*已废弃,请使用header里的executeTime*
ExecuteTime int64 `protobuf:"varint,1,opt,name=executeTime,proto3" json:"executeTime,omitempty"`
//*已废弃,Begin里不提供事务id*
TransactionId string `protobuf:"bytes,2,opt,name=transactionId,proto3" json:"transactionId,omitempty"`
//*预留扩展*
Props []*Pair `protobuf:"bytes,3,rep,name=props,proto3" json:"props,omitempty"`
//*执行的thread Id*
ThreadId int64 `protobuf:"varint,4,opt,name=threadId,proto3" json:"threadId,omitempty"`
// contains filtered or unexported fields
}
*开始事务的一些信息*
func (*TransactionBegin) Descriptor
deprecated
func (*TransactionBegin) Descriptor() ([]byte, []int)
Deprecated: Use TransactionBegin.ProtoReflect.Descriptor instead.
func (*TransactionBegin) GetExecuteTime ¶
func (x *TransactionBegin) GetExecuteTime() int64
func (*TransactionBegin) GetProps ¶
func (x *TransactionBegin) GetProps() []*Pair
func (*TransactionBegin) GetThreadId ¶
func (x *TransactionBegin) GetThreadId() int64
func (*TransactionBegin) GetTransactionId ¶
func (x *TransactionBegin) GetTransactionId() string
func (*TransactionBegin) ProtoMessage ¶
func (*TransactionBegin) ProtoMessage()
func (*TransactionBegin) ProtoReflect ¶
func (x *TransactionBegin) ProtoReflect() protoreflect.Message
func (*TransactionBegin) Reset ¶
func (x *TransactionBegin) Reset()
func (*TransactionBegin) String ¶
func (x *TransactionBegin) String() string
type TransactionEnd ¶
type TransactionEnd struct {
//*已废弃,请使用header里的executeTime*
ExecuteTime int64 `protobuf:"varint,1,opt,name=executeTime,proto3" json:"executeTime,omitempty"`
//*事务号*
TransactionId string `protobuf:"bytes,2,opt,name=transactionId,proto3" json:"transactionId,omitempty"`
//*预留扩展*
Props []*Pair `protobuf:"bytes,3,rep,name=props,proto3" json:"props,omitempty"`
// contains filtered or unexported fields
}
*结束事务的一些信息*
func (*TransactionEnd) Descriptor
deprecated
func (*TransactionEnd) Descriptor() ([]byte, []int)
Deprecated: Use TransactionEnd.ProtoReflect.Descriptor instead.
func (*TransactionEnd) GetExecuteTime ¶
func (x *TransactionEnd) GetExecuteTime() int64
func (*TransactionEnd) GetProps ¶
func (x *TransactionEnd) GetProps() []*Pair
func (*TransactionEnd) GetTransactionId ¶
func (x *TransactionEnd) GetTransactionId() string
func (*TransactionEnd) ProtoMessage ¶
func (*TransactionEnd) ProtoMessage()
func (*TransactionEnd) ProtoReflect ¶
func (x *TransactionEnd) ProtoReflect() protoreflect.Message
func (*TransactionEnd) Reset ¶
func (x *TransactionEnd) Reset()
func (*TransactionEnd) String ¶
func (x *TransactionEnd) String() string
type Type ¶
type Type int32
*数据库类型*
func (Type) Descriptor ¶
func (Type) Descriptor() protoreflect.EnumDescriptor
func (Type) EnumDescriptor
deprecated
func (Type) Number ¶
func (x Type) Number() protoreflect.EnumNumber
func (Type) Type ¶
func (Type) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.