From c032e8ba9b524a6a698475a76cc2926db17b3cad Mon Sep 17 00:00:00 2001 From: Chunzhu Li Date: Mon, 1 Nov 2021 07:48:52 -0500 Subject: [PATCH] proto: update proto name and remove conflictPolicy (#1085) --- Makefile | 5 +- proto/binlog/binlog.pb.go | 275 +++++++++++------------- proto/{binlog.proto => pb_binlog.proto} | 0 3 files changed, 127 insertions(+), 153 deletions(-) rename proto/{binlog.proto => pb_binlog.proto} (100%) diff --git a/Makefile b/Makefile index 4be0226d5..fa23aa53f 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,7 @@ TEST_DIR := /tmp/tidb_binlog_test GO := GO111MODULE=on go GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG) -# TODO: Remove this ldflags. It is used to fix unit tests temporarily. See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict. -GOTEST := CGO_ENABLED=1 $(GO) test -p 1 -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn" +GOTEST := CGO_ENABLED=1 $(GO) test -p 1 GOVERSION := "`go version`" ARCH := "`uname -s`" @@ -28,8 +27,6 @@ FILES := $$(find . -name '*.go' -type f | grep -vE 'vendor' | grep -vE 'binlog.p LDFLAGS += -X "github.com/pingcap/tidb-binlog/pkg/version.BuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S')" LDFLAGS += -X "github.com/pingcap/tidb-binlog/pkg/version.GitHash=$(shell git rev-parse HEAD)" LDFLAGS += -X "github.com/pingcap/tidb-binlog/pkg/version.ReleaseVersion=$(shell git describe --tags --dirty)" -# TODO: Remove this ldflags. See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict. -LDFLAGS += -X "google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn" default: build buildsucc diff --git a/proto/binlog/binlog.pb.go b/proto/binlog/binlog.pb.go index 40517a528..a8d530e83 100644 --- a/proto/binlog/binlog.pb.go +++ b/proto/binlog/binlog.pb.go @@ -11,15 +11,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by protoc-gen-gogo. -// source: binlog.proto -// DO NOT EDIT! +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pb_binlog.proto /* Package pb_binlog is a generated protocol buffer package. It is generated from these files: - binlog.proto + pb_binlog.proto It has these top-level messages: Column @@ -30,15 +29,14 @@ package pb_binlog import ( - "fmt" + fmt "fmt" + io "io" + math "math" + _ "github.com/gogo/protobuf/gogoproto" proto "github.com/golang/protobuf/proto" - - math "math" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -85,7 +83,7 @@ func (x *EventType) UnmarshalJSON(data []byte) error { *x = EventType(value) return nil } -func (EventType) EnumDescriptor() ([]byte, []int) { return fileDescriptorBinlog, []int{0} } +func (EventType) EnumDescriptor() ([]byte, []int) { return fileDescriptorPbBinlog, []int{0} } type BinlogType int32 @@ -119,24 +117,24 @@ func (x *BinlogType) UnmarshalJSON(data []byte) error { *x = BinlogType(value) return nil } -func (BinlogType) EnumDescriptor() ([]byte, []int) { return fileDescriptorBinlog, []int{1} } +func (BinlogType) EnumDescriptor() ([]byte, []int) { return fileDescriptorPbBinlog, []int{1} } type Column struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name"` - // column field type in binlog + // tp[0] is the column field type in binlog, used for decode column value Tp []byte `protobuf:"bytes,2,opt,name=tp" json:"tp,omitempty"` // column field type in mysql - MysqlType string `protobuf:"bytes,3,opt,name=mysql_type,json=mysqlType" json:"mysql_type"` + MysqlType string `protobuf:"bytes,3,opt,name=mysql_type" json:"mysql_type"` Value []byte `protobuf:"bytes,4,opt,name=value" json:"value,omitempty"` // changed_value is the changed value in update - ChangedValue []byte `protobuf:"bytes,5,opt,name=changed_value,json=changedValue" json:"changed_value,omitempty"` + ChangedValue []byte `protobuf:"bytes,5,opt,name=changed_value" json:"changed_value,omitempty"` XXX_unrecognized []byte `json:"-"` } func (m *Column) Reset() { *m = Column{} } func (m *Column) String() string { return proto.CompactTextString(m) } func (*Column) ProtoMessage() {} -func (*Column) Descriptor() ([]byte, []int) { return fileDescriptorBinlog, []int{0} } +func (*Column) Descriptor() ([]byte, []int) { return fileDescriptorPbBinlog, []int{0} } func (m *Column) GetName() string { if m != nil { @@ -175,8 +173,8 @@ func (m *Column) GetChangedValue() []byte { // TableMutation contains mutations in a table. type Event struct { - SchemaName *string `protobuf:"bytes,1,opt,name=schema_name,json=schemaName" json:"schema_name,omitempty"` - TableName *string `protobuf:"bytes,2,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + SchemaName *string `protobuf:"bytes,1,opt,name=schema_name" json:"schema_name,omitempty"` + TableName *string `protobuf:"bytes,2,opt,name=table_name" json:"table_name,omitempty"` Tp EventType `protobuf:"varint,3,opt,name=tp,enum=pb_binlog.EventType" json:"tp"` Row [][]byte `protobuf:"bytes,4,rep,name=row" json:"row,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -185,7 +183,7 @@ type Event struct { func (m *Event) Reset() { *m = Event{} } func (m *Event) String() string { return proto.CompactTextString(m) } func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorBinlog, []int{1} } +func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorPbBinlog, []int{1} } func (m *Event) GetSchemaName() string { if m != nil && m.SchemaName != nil { @@ -224,7 +222,7 @@ type DMLData struct { func (m *DMLData) Reset() { *m = DMLData{} } func (m *DMLData) String() string { return proto.CompactTextString(m) } func (*DMLData) ProtoMessage() {} -func (*DMLData) Descriptor() ([]byte, []int) { return fileDescriptorBinlog, []int{2} } +func (*DMLData) Descriptor() ([]byte, []int) { return fileDescriptorPbBinlog, []int{2} } func (m *DMLData) GetEvents() []Event { if m != nil { @@ -236,18 +234,18 @@ func (m *DMLData) GetEvents() []Event { // Binlog contains all the changes in a transaction. type Binlog struct { Tp BinlogType `protobuf:"varint,1,opt,name=tp,enum=pb_binlog.BinlogType" json:"tp"` - CommitTs int64 `protobuf:"varint,2,opt,name=commit_ts,json=commitTs" json:"commit_ts"` + CommitTs int64 `protobuf:"varint,2,opt,name=commit_ts" json:"commit_ts"` // dml_data is marshalled from DML type, - DmlData *DMLData `protobuf:"bytes,3,opt,name=dml_data,json=dmlData" json:"dml_data,omitempty"` + DmlData *DMLData `protobuf:"bytes,3,opt,name=dml_data" json:"dml_data,omitempty"` // ddl_query is the original ddl statement query. - DdlQuery []byte `protobuf:"bytes,4,opt,name=ddl_query,json=ddlQuery" json:"ddl_query,omitempty"` + DdlQuery []byte `protobuf:"bytes,4,opt,name=ddl_query" json:"ddl_query,omitempty"` XXX_unrecognized []byte `json:"-"` } func (m *Binlog) Reset() { *m = Binlog{} } func (m *Binlog) String() string { return proto.CompactTextString(m) } func (*Binlog) ProtoMessage() {} -func (*Binlog) Descriptor() ([]byte, []int) { return fileDescriptorBinlog, []int{3} } +func (*Binlog) Descriptor() ([]byte, []int) { return fileDescriptorPbBinlog, []int{3} } func (m *Binlog) GetTp() BinlogType { if m != nil { @@ -302,28 +300,28 @@ func (m *Column) MarshalTo(dAtA []byte) (int, error) { _ = l dAtA[i] = 0xa i++ - i = encodeVarintBinlog(dAtA, i, uint64(len(m.Name))) + i = encodeVarintPbBinlog(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) if m.Tp != nil { dAtA[i] = 0x12 i++ - i = encodeVarintBinlog(dAtA, i, uint64(len(m.Tp))) + i = encodeVarintPbBinlog(dAtA, i, uint64(len(m.Tp))) i += copy(dAtA[i:], m.Tp) } dAtA[i] = 0x1a i++ - i = encodeVarintBinlog(dAtA, i, uint64(len(m.MysqlType))) + i = encodeVarintPbBinlog(dAtA, i, uint64(len(m.MysqlType))) i += copy(dAtA[i:], m.MysqlType) if m.Value != nil { dAtA[i] = 0x22 i++ - i = encodeVarintBinlog(dAtA, i, uint64(len(m.Value))) + i = encodeVarintPbBinlog(dAtA, i, uint64(len(m.Value))) i += copy(dAtA[i:], m.Value) } if m.ChangedValue != nil { dAtA[i] = 0x2a i++ - i = encodeVarintBinlog(dAtA, i, uint64(len(m.ChangedValue))) + i = encodeVarintPbBinlog(dAtA, i, uint64(len(m.ChangedValue))) i += copy(dAtA[i:], m.ChangedValue) } if m.XXX_unrecognized != nil { @@ -350,23 +348,23 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { if m.SchemaName != nil { dAtA[i] = 0xa i++ - i = encodeVarintBinlog(dAtA, i, uint64(len(*m.SchemaName))) + i = encodeVarintPbBinlog(dAtA, i, uint64(len(*m.SchemaName))) i += copy(dAtA[i:], *m.SchemaName) } if m.TableName != nil { dAtA[i] = 0x12 i++ - i = encodeVarintBinlog(dAtA, i, uint64(len(*m.TableName))) + i = encodeVarintPbBinlog(dAtA, i, uint64(len(*m.TableName))) i += copy(dAtA[i:], *m.TableName) } dAtA[i] = 0x18 i++ - i = encodeVarintBinlog(dAtA, i, uint64(m.Tp)) + i = encodeVarintPbBinlog(dAtA, i, uint64(m.Tp)) if len(m.Row) > 0 { for _, b := range m.Row { dAtA[i] = 0x22 i++ - i = encodeVarintBinlog(dAtA, i, uint64(len(b))) + i = encodeVarintPbBinlog(dAtA, i, uint64(len(b))) i += copy(dAtA[i:], b) } } @@ -395,7 +393,7 @@ func (m *DMLData) MarshalTo(dAtA []byte) (int, error) { for _, msg := range m.Events { dAtA[i] = 0xa i++ - i = encodeVarintBinlog(dAtA, i, uint64(msg.Size())) + i = encodeVarintPbBinlog(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err @@ -426,14 +424,14 @@ func (m *Binlog) MarshalTo(dAtA []byte) (int, error) { _ = l dAtA[i] = 0x8 i++ - i = encodeVarintBinlog(dAtA, i, uint64(m.Tp)) + i = encodeVarintPbBinlog(dAtA, i, uint64(m.Tp)) dAtA[i] = 0x10 i++ - i = encodeVarintBinlog(dAtA, i, uint64(m.CommitTs)) + i = encodeVarintPbBinlog(dAtA, i, uint64(m.CommitTs)) if m.DmlData != nil { dAtA[i] = 0x1a i++ - i = encodeVarintBinlog(dAtA, i, uint64(m.DmlData.Size())) + i = encodeVarintPbBinlog(dAtA, i, uint64(m.DmlData.Size())) n1, err := m.DmlData.MarshalTo(dAtA[i:]) if err != nil { return 0, err @@ -443,7 +441,7 @@ func (m *Binlog) MarshalTo(dAtA []byte) (int, error) { if m.DdlQuery != nil { dAtA[i] = 0x22 i++ - i = encodeVarintBinlog(dAtA, i, uint64(len(m.DdlQuery))) + i = encodeVarintPbBinlog(dAtA, i, uint64(len(m.DdlQuery))) i += copy(dAtA[i:], m.DdlQuery) } if m.XXX_unrecognized != nil { @@ -452,25 +450,7 @@ func (m *Binlog) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func encodeFixed64Binlog(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Binlog(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintBinlog(dAtA []byte, offset int, v uint64) int { +func encodeVarintPbBinlog(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 @@ -483,20 +463,20 @@ func (m *Column) Size() (n int) { var l int _ = l l = len(m.Name) - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) if m.Tp != nil { l = len(m.Tp) - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) } l = len(m.MysqlType) - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) if m.Value != nil { l = len(m.Value) - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) } if m.ChangedValue != nil { l = len(m.ChangedValue) - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -509,17 +489,17 @@ func (m *Event) Size() (n int) { _ = l if m.SchemaName != nil { l = len(*m.SchemaName) - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) } if m.TableName != nil { l = len(*m.TableName) - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) } - n += 1 + sovBinlog(uint64(m.Tp)) + n += 1 + sovPbBinlog(uint64(m.Tp)) if len(m.Row) > 0 { for _, b := range m.Row { l = len(b) - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) } } if m.XXX_unrecognized != nil { @@ -534,7 +514,7 @@ func (m *DMLData) Size() (n int) { if len(m.Events) > 0 { for _, e := range m.Events { l = e.Size() - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) } } if m.XXX_unrecognized != nil { @@ -546,15 +526,15 @@ func (m *DMLData) Size() (n int) { func (m *Binlog) Size() (n int) { var l int _ = l - n += 1 + sovBinlog(uint64(m.Tp)) - n += 1 + sovBinlog(uint64(m.CommitTs)) + n += 1 + sovPbBinlog(uint64(m.Tp)) + n += 1 + sovPbBinlog(uint64(m.CommitTs)) if m.DmlData != nil { l = m.DmlData.Size() - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) } if m.DdlQuery != nil { l = len(m.DdlQuery) - n += 1 + l + sovBinlog(uint64(l)) + n += 1 + l + sovPbBinlog(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -562,7 +542,7 @@ func (m *Binlog) Size() (n int) { return n } -func sovBinlog(x uint64) (n int) { +func sovPbBinlog(x uint64) (n int) { for { n++ x >>= 7 @@ -572,8 +552,8 @@ func sovBinlog(x uint64) (n int) { } return n } -func sozBinlog(x uint64) (n int) { - return sovBinlog(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozPbBinlog(x uint64) (n int) { + return sovPbBinlog(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *Column) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -583,7 +563,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -611,7 +591,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -625,7 +605,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + intStringLen if postIndex > l { @@ -640,7 +620,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -653,7 +633,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + byteLen if postIndex > l { @@ -671,7 +651,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -685,7 +665,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + intStringLen if postIndex > l { @@ -700,7 +680,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -713,7 +693,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + byteLen if postIndex > l { @@ -731,7 +711,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -744,7 +724,7 @@ func (m *Column) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + byteLen if postIndex > l { @@ -757,12 +737,12 @@ func (m *Column) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipBinlog(dAtA[iNdEx:]) + skippy, err := skipPbBinlog(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -785,7 +765,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -813,7 +793,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -827,7 +807,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + intStringLen if postIndex > l { @@ -843,7 +823,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -857,7 +837,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + intStringLen if postIndex > l { @@ -873,7 +853,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { m.Tp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -892,7 +872,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -905,7 +885,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + byteLen if postIndex > l { @@ -916,12 +896,12 @@ func (m *Event) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipBinlog(dAtA[iNdEx:]) + skippy, err := skipPbBinlog(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -944,7 +924,7 @@ func (m *DMLData) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -972,7 +952,7 @@ func (m *DMLData) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -985,7 +965,7 @@ func (m *DMLData) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + msglen if postIndex > l { @@ -998,12 +978,12 @@ func (m *DMLData) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipBinlog(dAtA[iNdEx:]) + skippy, err := skipPbBinlog(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1026,7 +1006,7 @@ func (m *Binlog) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1054,7 +1034,7 @@ func (m *Binlog) Unmarshal(dAtA []byte) error { m.Tp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1073,7 +1053,7 @@ func (m *Binlog) Unmarshal(dAtA []byte) error { m.CommitTs = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1092,7 +1072,7 @@ func (m *Binlog) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1105,7 +1085,7 @@ func (m *Binlog) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + msglen if postIndex > l { @@ -1125,7 +1105,7 @@ func (m *Binlog) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowBinlog + return ErrIntOverflowPbBinlog } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1138,7 +1118,7 @@ func (m *Binlog) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } postIndex := iNdEx + byteLen if postIndex > l { @@ -1151,12 +1131,12 @@ func (m *Binlog) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipBinlog(dAtA[iNdEx:]) + skippy, err := skipPbBinlog(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthBinlog + return ErrInvalidLengthPbBinlog } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1171,14 +1151,14 @@ func (m *Binlog) Unmarshal(dAtA []byte) error { } return nil } -func skipBinlog(dAtA []byte) (n int, err error) { +func skipPbBinlog(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowBinlog + return 0, ErrIntOverflowPbBinlog } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1195,7 +1175,7 @@ func skipBinlog(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowBinlog + return 0, ErrIntOverflowPbBinlog } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1213,7 +1193,7 @@ func skipBinlog(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowBinlog + return 0, ErrIntOverflowPbBinlog } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1227,7 +1207,7 @@ func skipBinlog(dAtA []byte) (n int, err error) { } iNdEx += length if length < 0 { - return 0, ErrInvalidLengthBinlog + return 0, ErrInvalidLengthPbBinlog } return iNdEx, nil case 3: @@ -1236,7 +1216,7 @@ func skipBinlog(dAtA []byte) (n int, err error) { var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowBinlog + return 0, ErrIntOverflowPbBinlog } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1252,7 +1232,7 @@ func skipBinlog(dAtA []byte) (n int, err error) { if innerWireType == 4 { break } - next, err := skipBinlog(dAtA[start:]) + next, err := skipPbBinlog(dAtA[start:]) if err != nil { return 0, err } @@ -1272,39 +1252,36 @@ func skipBinlog(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthBinlog = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBinlog = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthPbBinlog = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPbBinlog = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("binlog.proto", fileDescriptorBinlog) } +func init() { proto.RegisterFile("pb_binlog.proto", fileDescriptorPbBinlog) } -var fileDescriptorBinlog = []byte{ - // 431 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x91, 0xcf, 0x6a, 0x1b, 0x31, - 0x10, 0xc6, 0xad, 0x5d, 0xff, 0xdb, 0xb1, 0x1b, 0x84, 0x70, 0x61, 0x69, 0xe9, 0xc6, 0x75, 0x2e, - 0xc6, 0xa5, 0x0e, 0xf8, 0xd6, 0xab, 0xd9, 0x1e, 0x0a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, 0xa4, 0x0f, 0x87, 0x84, 0xfc, 0x39, 0x24, 0xe4, 0xdf, 0x21, 0x21, 0xbf, 0xfe, 0x27, - 0xad, 0xc7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdd, 0x35, 0x13, 0x38, 0x91, 0x02, 0x00, 0x00, +var fileDescriptorPbBinlog = []byte{ + // 371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x91, 0xc1, 0xae, 0x9a, 0x40, + 0x14, 0x86, 0x1d, 0x40, 0x6e, 0x39, 0x68, 0x4b, 0xa7, 0x9a, 0x92, 0x2e, 0x28, 0x21, 0x8d, 0x25, + 0x2e, 0x34, 0xf5, 0x11, 0x0c, 0x5d, 0x34, 0xd1, 0x5d, 0xbb, 0x26, 0x23, 0x9c, 0xa0, 0xc9, 0xc0, + 0x20, 0x8c, 0x36, 0xac, 0xfb, 0x12, 0x7d, 0x24, 0x97, 0x7d, 0x82, 0xa6, 0xb1, 0x2f, 0xd2, 0x30, + 0x58, 0x25, 0x77, 0x77, 0xf2, 0xcd, 0xcf, 0xf9, 0xfe, 0x61, 0xe0, 0x55, 0xb9, 0x8b, 0x77, 0x87, + 0x82, 0x8b, 0x6c, 0x51, 0x56, 0x42, 0x0a, 0x6a, 0xdd, 0xc1, 0xbb, 0x49, 0x26, 0x32, 0xa1, 0xe8, + 0xb2, 0x9d, 0xba, 0x40, 0xb0, 0x07, 0x33, 0x11, 0xfc, 0x94, 0x17, 0x94, 0x82, 0x51, 0xb0, 0x1c, + 0x5d, 0xe2, 0x93, 0xd0, 0x5a, 0x1b, 0x97, 0xdf, 0xef, 0x07, 0x14, 0x40, 0x93, 0xa5, 0xab, 0xf9, + 0x24, 0x1c, 0x51, 0x17, 0x20, 0x6f, 0xea, 0x23, 0x8f, 0x65, 0x53, 0xa2, 0xab, 0xf7, 0x52, 0x63, + 0x18, 0x9e, 0x19, 0x3f, 0xa1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xfa, 0x04, 0x7a, 0xb4, 0xdd, 0x38, + 0x03, 0x35, 0x44, 0x1b, 0x87, 0xac, 0x9d, 0xcb, 0xd5, 0x23, 0xbf, 0xae, 0x1e, 0xf9, 0x73, 0xf5, + 0xc8, 0xcf, 0xbf, 0xde, 0xe0, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0x63, 0xee, 0x09, 0x1f, + 0x02, 0x00, 0x00, } diff --git a/proto/binlog.proto b/proto/pb_binlog.proto similarity index 100% rename from proto/binlog.proto rename to proto/pb_binlog.proto