protoc

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: 4 Imported by: 2

Documentation

Overview

Package protoc is a generated protocol buffer package.

It is generated from these files:

entry_protoc.proto

It has these top-level messages:

Entry
Header
Column
RowData
RowChange
TransactionBegin
TransactionEnd
Pair

Index

Constants

This section is empty.

Variables

View Source
var Compression_name = map[int32]string{
	0: "NONE",
	1: "ZLIB",
	2: "GZIP",
	3: "LZF",
}
View Source
var Compression_value = map[string]int32{
	"NONE": 0,
	"ZLIB": 1,
	"GZIP": 2,
	"LZF":  3,
}
View Source
var EntryType_name = map[int32]string{
	0: "TRANSACTION_BEGIN",
	1: "ROWDATA",
	2: "TRANSACTION_END",
	3: "HEARTBEAT",
}
View Source
var EntryType_value = map[string]int32{
	"TRANSACTION_BEGIN": 0,
	"ROWDATA":           1,
	"TRANSACTION_END":   2,
	"HEARTBEAT":         3,
}
View Source
var EventType_name = map[int32]string{
	0:  "INSERT",
	1:  "UPDATE",
	2:  "DELETE",
	3:  "CREATE",
	4:  "ALTER",
	5:  "DROP",
	6:  "QUERY",
	7:  "TRUNCATE",
	8:  "RENAME",
	9:  "CINDEX",
	10: "DINDEX",
}
View Source
var EventType_value = map[string]int32{
	"INSERT":   0,
	"UPDATE":   1,
	"DELETE":   2,
	"CREATE":   3,
	"ALTER":    4,
	"DROP":     5,
	"QUERY":    6,
	"TRUNCATE": 7,
	"RENAME":   8,
	"CINDEX":   9,
	"DINDEX":   10,
}
View Source
var PacketType_name = map[int32]string{
	0:  "UNKNOWN",
	1:  "HANDSHAKE",
	2:  "CLIENTAUTHENTICATION",
	3:  "ACK",
	4:  "SUBSCRIPTION",
	5:  "UNSUBSCRIPTION",
	6:  "GET",
	7:  "MESSAGES",
	8:  "CLIENTACK",
	9:  "HEARTBEAT",
	10: "CLIENTROLLBACK",
}
View Source
var PacketType_value = map[string]int32{
	"UNKNOWN":              0,
	"HANDSHAKE":            1,
	"CLIENTAUTHENTICATION": 2,
	"ACK":                  3,
	"SUBSCRIPTION":         4,
	"UNSUBSCRIPTION":       5,
	"GET":                  6,
	"MESSAGES":             7,
	"CLIENTACK":            8,
	"HEARTBEAT":            9,
	"CLIENTROLLBACK":       10,
}
View Source
var Type_name = map[int32]string{
	0: "ORACLE",
	1: "MYSQL",
	2: "PGSQL",
}
View Source
var Type_value = map[string]int32{
	"ORACLE": 0,
	"MYSQL":  1,
	"PGSQL":  2,
}

Functions

This section is empty.

Types

type Ack

type Ack struct {
	ErrorCode    int32  `protobuf:"varint,1,opt,name=error_code,json=errorCode" json:"error_code,omitempty"`
	ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage" json:"error_message,omitempty"`
}

func (*Ack) Descriptor

func (*Ack) Descriptor() ([]byte, []int)

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) Reset

func (m *Ack) Reset()

func (*Ack) String

func (m *Ack) String() string

type ClientAck

type ClientAck struct {
	Destination string `protobuf:"bytes,1,opt,name=destination" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId" json:"client_id,omitempty"`
	BatchId     int64  `protobuf:"varint,3,opt,name=batch_id,json=batchId" json:"batch_id,omitempty"`
}

func (*ClientAck) Descriptor

func (*ClientAck) Descriptor() ([]byte, []int)

func (*ClientAck) ProtoMessage

func (*ClientAck) ProtoMessage()

func (*ClientAck) Reset

func (m *ClientAck) Reset()

func (*ClientAck) String

func (m *ClientAck) String() string

type ClientAuth

type ClientAuth struct {
	Username        string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
	Password        []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	NetReadTimeout  int32  `protobuf:"varint,3,opt,name=net_read_timeout,json=netReadTimeout" json:"net_read_timeout,omitempty"`
	NetWriteTimeout int32  `protobuf:"varint,4,opt,name=net_write_timeout,json=netWriteTimeout" json:"net_write_timeout,omitempty"`
	Destination     string `protobuf:"bytes,5,opt,name=destination" json:"destination,omitempty"`
	ClientId        string `protobuf:"bytes,6,opt,name=client_id,json=clientId" json:"client_id,omitempty"`
	Filter          string `protobuf:"bytes,7,opt,name=filter" json:"filter,omitempty"`
	StartTimestamp  int64  `protobuf:"varint,8,opt,name=start_timestamp,json=startTimestamp" json:"start_timestamp,omitempty"`
}

client authentication

func (*ClientAuth) Descriptor

func (*ClientAuth) Descriptor() ([]byte, []int)

func (*ClientAuth) ProtoMessage

func (*ClientAuth) ProtoMessage()

func (*ClientAuth) Reset

func (m *ClientAuth) Reset()

func (*ClientAuth) String

func (m *ClientAuth) String() string

type ClientRollback

type ClientRollback struct {
	Destination string `protobuf:"bytes,1,opt,name=destination" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId" json:"client_id,omitempty"`
	BatchId     int64  `protobuf:"varint,3,opt,name=batch_id,json=batchId" json:"batch_id,omitempty"`
}

func (*ClientRollback) Descriptor

func (*ClientRollback) Descriptor() ([]byte, []int)

func (*ClientRollback) ProtoMessage

func (*ClientRollback) ProtoMessage()

func (*ClientRollback) Reset

func (m *ClientRollback) Reset()

func (*ClientRollback) String

func (m *ClientRollback) String() string

type Column

type Column struct {
	// 字段下标
	Index int32 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
	// 字段类型
	SqlType int32 `protobuf:"varint,2,opt,name=sqlType" json:"sqlType,omitempty"`
	// 字段名称
	Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
	// 是否是主键
	IsKey bool `protobuf:"varint,4,opt,name=isKey" json:"isKey,omitempty"`
	// 如果EventType=UPDATE,用于标识这个字段值是否有修改
	Updated bool `protobuf:"varint,5,opt,name=updated" json:"updated,omitempty"`
	// 标识是否为空
	IsNull bool `protobuf:"varint,6,opt,name=isNull" json:"isNull,omitempty"`
	// 字段值
	Value string `protobuf:"bytes,7,opt,name=value" json:"value,omitempty"`
	// 字段mysql类型
	MysqlType string `protobuf:"bytes,8,opt,name=mysqlType" json:"mysqlType,omitempty"`
	// 预留扩展
	Props []*Pair `protobuf:"bytes,9,rep,name=props" json:"props,omitempty"`
}

每个字段的数据结构

func (*Column) Descriptor

func (*Column) Descriptor() ([]byte, []int)

func (*Column) GetProps

func (m *Column) GetProps() []*Pair

func (*Column) ProtoMessage

func (*Column) ProtoMessage()

func (*Column) Reset

func (m *Column) Reset()

func (*Column) String

func (m *Column) String() string

type Compression

type Compression int32
const (
	Compression_NONE Compression = 0
	Compression_ZLIB Compression = 1
	Compression_GZIP Compression = 2
	Compression_LZF  Compression = 3
)

func (Compression) EnumDescriptor

func (Compression) EnumDescriptor() ([]byte, []int)

func (Compression) String

func (x Compression) String() string

type Entry

type Entry struct {
	// 协议头部信息
	Header *Header `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
	// 事件类型
	EntryType EntryType `protobuf:"varint,2,opt,name=entryType,enum=protoc.EntryType" json:"entryType,omitempty"`
	// 传输的二进制数组
	StoreValue []byte `protobuf:"bytes,3,opt,name=storeValue,proto3" json:"storeValue,omitempty"`
}

func (*Entry) Descriptor

func (*Entry) Descriptor() ([]byte, []int)

func (*Entry) GetHeader

func (m *Entry) GetHeader() *Header

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) Reset

func (m *Entry) Reset()

func (*Entry) String

func (m *Entry) String() string

type EntryPosition

type EntryPosition struct {
	Included    bool
	LogfileName string
	LogPosition int64
	Timestamp   int64
	ServerId    int64
}

func (*EntryPosition) String

func (ep *EntryPosition) String() string

type EntryType

type EntryType int32

标识事务的开始,变更数据,结束的事件类型

const (
	EntryType_TRANSACTION_BEGIN EntryType = 0
	EntryType_ROWDATA           EntryType = 1
	EntryType_TRANSACTION_END   EntryType = 2
	// 心跳类型,内部使用,外部暂不可见
	EntryType_HEARTBEAT EntryType = 3
)

func (EntryType) EnumDescriptor

func (EntryType) EnumDescriptor() ([]byte, []int)

func (EntryType) String

func (x EntryType) String() string

type EventType

type EventType int32

事件类型

const (
	EventType_INSERT   EventType = 0
	EventType_UPDATE   EventType = 1
	EventType_DELETE   EventType = 2
	EventType_CREATE   EventType = 3
	EventType_ALTER    EventType = 4
	EventType_DROP     EventType = 5
	EventType_QUERY    EventType = 6
	EventType_TRUNCATE EventType = 7
	EventType_RENAME   EventType = 8
	// CREATE INDEX
	EventType_CINDEX EventType = 9
	EventType_DINDEX EventType = 10
)

func (EventType) EnumDescriptor

func (EventType) EnumDescriptor() ([]byte, []int)

func (EventType) String

func (x EventType) String() string

type Get

type Get struct {
	Destination string `protobuf:"bytes,1,opt,name=destination" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId" json:"client_id,omitempty"`
	FetchSize   int32  `protobuf:"varint,3,opt,name=fetch_size,json=fetchSize" json:"fetch_size,omitempty"`
	Timeout     int64  `protobuf:"varint,4,opt,name=timeout" json:"timeout,omitempty"`
	Unit        int32  `protobuf:"varint,5,opt,name=unit" json:"unit,omitempty"`
	AutoAck     bool   `protobuf:"varint,6,opt,name=auto_ack,json=autoAck" json:"auto_ack,omitempty"`
}

PullRequest

func (*Get) Descriptor

func (*Get) Descriptor() ([]byte, []int)

func (*Get) ProtoMessage

func (*Get) ProtoMessage()

func (*Get) Reset

func (m *Get) Reset()

func (*Get) String

func (m *Get) String() string

type Handshake

type Handshake struct {
	CommunicationEncoding string        `protobuf:"bytes,1,opt,name=communication_encoding,json=communicationEncoding" json:"communication_encoding,omitempty"`
	Seeds                 []byte        `protobuf:"bytes,2,opt,name=seeds,proto3" json:"seeds,omitempty"`
	SupportedCompressions []Compression `` /* 142-byte string literal not displayed */
}

func (*Handshake) Descriptor

func (*Handshake) Descriptor() ([]byte, []int)

func (*Handshake) ProtoMessage

func (*Handshake) ProtoMessage()

func (*Handshake) Reset

func (m *Handshake) Reset()

func (*Handshake) String

func (m *Handshake) String() string
type Header struct {
	// 协议的版本号
	Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
	// binlog
	LogfileName string `protobuf:"bytes,2,opt,name=logfileName" json:"logfileName,omitempty"`
	// binlog 文件的偏移位置
	LogfileOffset int64 `protobuf:"varint,3,opt,name=logfileOffset" json:"logfileOffset,omitempty"`
	// 服务端serverId
	ServerId int64 `protobuf:"varint,4,opt,name=serverId" json:"serverId,omitempty"`
	// 变更数据的编码
	ServerEncode string `protobuf:"bytes,5,opt,name=serverEncode" json:"serverEncode,omitempty"`
	// 变更数据的执行时间
	ExecuteTime int64 `protobuf:"varint,6,opt,name=executeTime" json:"executeTime,omitempty"`
	// 变更数据的来源
	SourceType Type `protobuf:"varint,7,opt,name=sourceType,enum=protoc.Type" json:"sourceType,omitempty"`
	// 变更数据的schema name
	SchemaName string `protobuf:"bytes,8,opt,name=schemaName" json:"schemaName,omitempty"`
	// 变更数据的table name
	TableName string `protobuf:"bytes,9,opt,name=tableName" json:"tableName,omitempty"`
	// 每个event的长度
	EventLength int64 `protobuf:"varint,10,opt,name=eventLength" json:"eventLength,omitempty"`
	// GTID string
	Gtid string `protobuf:"bytes,11,opt,name=gtid" json:"gtid,omitempty"`
	// last committed id
	LastCommitted int64 `protobuf:"varint,12,opt,name=lastCommitted" json:"lastCommitted,omitempty"`
	// sequence number
	SeqNum int64 `protobuf:"varint,13,opt,name=seqNum" json:"seqNum,omitempty"`
	// 数据变更类型
	EventType EventType `protobuf:"varint,14,opt,name=eventType,enum=protoc.EventType" json:"eventType,omitempty"`
	// 预留扩展
	Props []*Pair `protobuf:"bytes,15,rep,name=props" json:"props,omitempty"`
}

message Header

func (*Header) Descriptor

func (*Header) Descriptor() ([]byte, []int)

func (*Header) GetProps

func (m *Header) GetProps() []*Pair

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) Reset

func (m *Header) Reset()

func (*Header) String

func (m *Header) String() string

type HeartBeat

type HeartBeat struct {
	SendTimestamp  int64 `protobuf:"varint,1,opt,name=send_timestamp,json=sendTimestamp" json:"send_timestamp,omitempty"`
	StartTimestamp int64 `protobuf:"varint,2,opt,name=start_timestamp,json=startTimestamp" json:"start_timestamp,omitempty"`
}

func (*HeartBeat) Descriptor

func (*HeartBeat) Descriptor() ([]byte, []int)

func (*HeartBeat) ProtoMessage

func (*HeartBeat) ProtoMessage()

func (*HeartBeat) Reset

func (m *HeartBeat) Reset()

func (*HeartBeat) String

func (m *HeartBeat) String() string

type Messages

type Messages struct {
	BatchId  int64    `protobuf:"varint,1,opt,name=batch_id,json=batchId" json:"batch_id,omitempty"`
	Messages [][]byte `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
}

func (*Messages) Descriptor

func (*Messages) Descriptor() ([]byte, []int)

func (*Messages) ProtoMessage

func (*Messages) ProtoMessage()

func (*Messages) Reset

func (m *Messages) Reset()

func (*Messages) String

func (m *Messages) String() string

type Packet

type Packet struct {
	MagicNumber int32       `protobuf:"varint,1,opt,name=magic_number,json=magicNumber" json:"magic_number,omitempty"`
	Version     int32       `protobuf:"varint,2,opt,name=version" json:"version,omitempty"`
	Type        PacketType  `protobuf:"varint,3,opt,name=type,enum=protoc.PacketType" json:"type,omitempty"`
	Compression Compression `protobuf:"varint,4,opt,name=compression,enum=protoc.Compression" json:"compression,omitempty"`
	Body        []byte      `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"`
}

func (*Packet) Descriptor

func (*Packet) Descriptor() ([]byte, []int)

func (*Packet) ProtoMessage

func (*Packet) ProtoMessage()

func (*Packet) Reset

func (m *Packet) Reset()

func (*Packet) String

func (m *Packet) String() string

type PacketType

type PacketType int32
const (
	PacketType_UNKNOWN              PacketType = 0
	PacketType_HANDSHAKE            PacketType = 1
	PacketType_CLIENTAUTHENTICATION PacketType = 2
	PacketType_ACK                  PacketType = 3
	PacketType_SUBSCRIPTION         PacketType = 4
	PacketType_UNSUBSCRIPTION       PacketType = 5
	PacketType_GET                  PacketType = 6
	PacketType_MESSAGES             PacketType = 7
	PacketType_CLIENTACK            PacketType = 8
	PacketType_HEARTBEAT            PacketType = 9
	PacketType_CLIENTROLLBACK       PacketType = 10
)

func (PacketType) EnumDescriptor

func (PacketType) EnumDescriptor() ([]byte, []int)

func (PacketType) String

func (x PacketType) String() string

type Pair

type Pair struct {
	Key   string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}

预留扩展

func (*Pair) Descriptor

func (*Pair) Descriptor() ([]byte, []int)

func (*Pair) ProtoMessage

func (*Pair) ProtoMessage()

func (*Pair) Reset

func (m *Pair) Reset()

func (*Pair) String

func (m *Pair) String() string

type RowChange

type RowChange struct {
	// tableId,由数据库产生
	TableId int64 `protobuf:"varint,1,opt,name=tableId" json:"tableId,omitempty"`
	// 数据变更类型
	EventType EventType `protobuf:"varint,2,opt,name=eventType,enum=protoc.EventType" json:"eventType,omitempty"`
	// 标识是否是ddl语句
	IsDDL bool `protobuf:"varint,10,opt,name=isDDL" json:"isDDL,omitempty"`
	// ddl/query的sql语句
	Sql string `protobuf:"bytes,11,opt,name=sql" json:"sql,omitempty"`
	// 一次数据库变更可能存在多行
	RowDatas []*RowData `protobuf:"bytes,12,rep,name=rowDatas" json:"rowDatas,omitempty"`
	// ddl/query的schemaName
	DdlSchemaName string `protobuf:"bytes,13,opt,name=ddlSchemaName" json:"ddlSchemaName,omitempty"`
	// 预留扩展
	Props []*Pair `protobuf:"bytes,14,rep,name=props" json:"props,omitempty"`
}

message row 每行变更数据的数据结构

func (*RowChange) Descriptor

func (*RowChange) Descriptor() ([]byte, []int)

func (*RowChange) GetProps

func (m *RowChange) GetProps() []*Pair

func (*RowChange) GetRowDatas

func (m *RowChange) GetRowDatas() []*RowData

func (*RowChange) ProtoMessage

func (*RowChange) ProtoMessage()

func (*RowChange) Reset

func (m *RowChange) Reset()

func (*RowChange) String

func (m *RowChange) String() string

type RowData

type RowData struct {
	// 字段信息,增量数据(修改前,删除前)
	BeforeColumns []*Column `protobuf:"bytes,1,rep,name=beforeColumns" json:"beforeColumns,omitempty"`
	// 字段信息,增量数据(修改后,新增后)
	AfterColumns []*Column `protobuf:"bytes,2,rep,name=afterColumns" json:"afterColumns,omitempty"`
	// 预留扩展
	Props []*Pair `protobuf:"bytes,3,rep,name=props" json:"props,omitempty"`
}

func (*RowData) Descriptor

func (*RowData) Descriptor() ([]byte, []int)

func (*RowData) GetAfterColumns

func (m *RowData) GetAfterColumns() []*Column

func (*RowData) GetBeforeColumns

func (m *RowData) GetBeforeColumns() []*Column

func (*RowData) GetProps

func (m *RowData) GetProps() []*Pair

func (*RowData) ProtoMessage

func (*RowData) ProtoMessage()

func (*RowData) Reset

func (m *RowData) Reset()

func (*RowData) String

func (m *RowData) String() string

type Sub

type Sub struct {
	Destination string `protobuf:"bytes,1,opt,name=destination" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId" json:"client_id,omitempty"`
	Filter      string `protobuf:"bytes,7,opt,name=filter" json:"filter,omitempty"`
}

subscription

func (*Sub) Descriptor

func (*Sub) Descriptor() ([]byte, []int)

func (*Sub) ProtoMessage

func (*Sub) ProtoMessage()

func (*Sub) Reset

func (m *Sub) Reset()

func (*Sub) String

func (m *Sub) String() string

type TransactionBegin

type TransactionBegin struct {
	// 执行的thread Id
	ThreadId int64 `protobuf:"varint,1,opt,name=threadId" json:"threadId,omitempty"`
	// 预留扩展
	Props []*Pair `protobuf:"bytes,2,rep,name=props" json:"props,omitempty"`
}

开始事务的一些信息

func (*TransactionBegin) Descriptor

func (*TransactionBegin) Descriptor() ([]byte, []int)

func (*TransactionBegin) GetProps

func (m *TransactionBegin) GetProps() []*Pair

func (*TransactionBegin) ProtoMessage

func (*TransactionBegin) ProtoMessage()

func (*TransactionBegin) Reset

func (m *TransactionBegin) Reset()

func (*TransactionBegin) String

func (m *TransactionBegin) String() string

type TransactionEnd

type TransactionEnd struct {
	// 事务号
	TransactionId string `protobuf:"bytes,1,opt,name=transactionId" json:"transactionId,omitempty"`
	// 预留扩展
	Props []*Pair `protobuf:"bytes,2,rep,name=props" json:"props,omitempty"`
}

结束事务的一些信息

func (*TransactionEnd) Descriptor

func (*TransactionEnd) Descriptor() ([]byte, []int)

func (*TransactionEnd) GetProps

func (m *TransactionEnd) GetProps() []*Pair

func (*TransactionEnd) ProtoMessage

func (*TransactionEnd) ProtoMessage()

func (*TransactionEnd) Reset

func (m *TransactionEnd) Reset()

func (*TransactionEnd) String

func (m *TransactionEnd) String() string

type Type

type Type int32

数据库类型

const (
	Type_ORACLE Type = 0
	Type_MYSQL  Type = 1
	Type_PGSQL  Type = 2
)

func (Type) EnumDescriptor

func (Type) EnumDescriptor() ([]byte, []int)

func (Type) String

func (x Type) String() string

type Unsub

type Unsub struct {
	Destination string `protobuf:"bytes,1,opt,name=destination" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId" json:"client_id,omitempty"`
	Filter      string `protobuf:"bytes,7,opt,name=filter" json:"filter,omitempty"`
}

Unsubscription

func (*Unsub) Descriptor

func (*Unsub) Descriptor() ([]byte, []int)

func (*Unsub) ProtoMessage

func (*Unsub) ProtoMessage()

func (*Unsub) Reset

func (m *Unsub) Reset()

func (*Unsub) String

func (m *Unsub) String() string

Jump to

Keyboard shortcuts

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