diff --git a/go-binlog/pump.pb.go b/go-binlog/pump.pb.go index 26671030d..48ebaf110 100644 --- a/go-binlog/pump.pb.go +++ b/go-binlog/pump.pb.go @@ -163,6 +163,8 @@ type Entity struct { Pos Pos `protobuf:"bytes,1,opt,name=pos" json:"pos"` // The payload of binlog entity. Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + // checksum of binlog payload. + Checksum []byte `protobuf:"bytes,3,opt,name=checksum,proto3" json:"checksum,omitempty"` } func (m *Entity) Reset() { *m = Entity{} } @@ -184,6 +186,13 @@ func (m *Entity) GetPayload() []byte { return nil } +func (m *Entity) GetChecksum() []byte { + if m != nil { + return m.Checksum + } + return nil +} + func init() { proto.RegisterType((*WriteBinlogReq)(nil), "binlog.WriteBinlogReq") proto.RegisterType((*WriteBinlogResp)(nil), "binlog.WriteBinlogResp") @@ -499,6 +508,12 @@ func (m *Entity) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPump(dAtA, i, uint64(len(m.Payload))) i += copy(dAtA[i:], m.Payload) } + if len(m.Checksum) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintPump(dAtA, i, uint64(len(m.Checksum))) + i += copy(dAtA[i:], m.Checksum) + } return i, nil } @@ -574,6 +589,10 @@ func (m *Entity) Size() (n int) { if l > 0 { n += 1 + l + sovPump(uint64(l)) } + l = len(m.Checksum) + if l > 0 { + n += 1 + l + sovPump(uint64(l)) + } return n } @@ -1126,6 +1145,37 @@ func (m *Entity) Unmarshal(dAtA []byte) error { m.Payload = []byte{} } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPump + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPump + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checksum = append(m.Checksum[:0], dAtA[iNdEx:postIndex]...) + if m.Checksum == nil { + m.Checksum = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPump(dAtA[iNdEx:]) @@ -1255,27 +1305,28 @@ var ( func init() { proto.RegisterFile("pump.proto", fileDescriptorPump) } var fileDescriptorPump = []byte{ - // 341 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x4a, 0xf3, 0x40, - 0x14, 0xc5, 0x3b, 0x5f, 0x4b, 0x3e, 0x7a, 0xa3, 0x55, 0x06, 0xad, 0xa5, 0x48, 0x2c, 0xe3, 0xa6, - 0x82, 0xb4, 0x52, 0x71, 0x2b, 0x52, 0xfc, 0xbb, 0x0b, 0xd9, 0xb8, 0x13, 0x5a, 0x9d, 0x84, 0x40, - 0xd2, 0x19, 0xe7, 0x4e, 0xc0, 0xbe, 0x82, 0x4f, 0xe0, 0x23, 0x75, 0xe9, 0x13, 0x88, 0xd4, 0x17, - 0x91, 0x99, 0x4e, 0x6d, 0x0b, 0x15, 0xdc, 0xe5, 0x9c, 0xb9, 0xf3, 0xbb, 0x27, 0x27, 0x01, 0x90, - 0x45, 0x2e, 0x3b, 0x52, 0x09, 0x2d, 0xa8, 0x37, 0x4c, 0x47, 0x99, 0x48, 0x9a, 0x3b, 0x89, 0x48, - 0x84, 0xb5, 0xba, 0xe6, 0x69, 0x76, 0xca, 0x6e, 0xa1, 0x76, 0xaf, 0x52, 0xcd, 0xfb, 0x76, 0x28, - 0xe2, 0xcf, 0x74, 0x1f, 0xaa, 0x8f, 0x59, 0x81, 0x9a, 0xab, 0xbb, 0xcb, 0x06, 0x69, 0x91, 0x76, - 0x25, 0x5a, 0x18, 0xb4, 0x01, 0xff, 0xe5, 0x60, 0x9c, 0x89, 0xc1, 0x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, - 0xaf, 0xa0, 0x34, 0xf4, 0xec, 0xaf, 0x73, 0xfa, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x05, 0xc3, - 0x79, 0x66, 0x02, 0x00, 0x00, + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x4a, 0xf3, 0x40, + 0x14, 0xed, 0x7c, 0x29, 0xf9, 0xec, 0x8d, 0x56, 0x19, 0xb4, 0x86, 0x20, 0xb1, 0x8c, 0x9b, 0x0a, + 0xd2, 0x4a, 0xc5, 0xad, 0x48, 0x51, 0xd1, 0x5d, 0xc8, 0xc6, 0x9d, 0xd0, 0xc6, 0x49, 0x0c, 0x26, + 0x9d, 0x71, 0x66, 0x02, 0xf6, 0x15, 0x7c, 0x02, 0x1f, 0xa9, 0x4b, 0x9f, 0x40, 0xa4, 0xbe, 0x88, + 0x64, 0x3a, 0xfd, 0x83, 0x0a, 0xee, 0x72, 0xce, 0xbd, 0xf7, 0x9c, 0x93, 0x7b, 0x07, 0x80, 0x17, + 0x39, 0x6f, 0x73, 0xc1, 0x14, 0xc3, 0xf6, 0x20, 0x1d, 0x66, 0x2c, 0xf1, 0x76, 0x13, 0x96, 0x30, + 0x4d, 0x75, 0xca, 0xaf, 0x69, 0x95, 0xdc, 0x42, 0xfd, 0x5e, 0xa4, 0x8a, 0xf6, 0x74, 0x53, 0x48, + 0x5f, 0xf0, 0x01, 0xd4, 0xa2, 0xac, 0x90, 0x8a, 0x8a, 0xbb, 0x2b, 0x17, 0x35, 0x51, 0xab, 0x1a, + 0x2e, 0x08, 0xec, 0xc2, 0x7f, 0xde, 0x1f, 0x65, 0xac, 0xff, 0xe8, 0xfe, 0x6b, 0xa2, 0xd6, 0x66, + 0x38, 0x83, 0xe4, 0x18, 0xb6, 0x57, 0x94, 0x24, 0xc7, 0x0d, 0xb0, 0xa9, 0x10, 0xb9, 0x4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xce, 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x2c, 0x86, 0x78, 0x82, + 0x02, 0x00, 0x00, } diff --git a/proto/binlog/pump.proto b/proto/binlog/pump.proto index 42a32f976..ba059a368 100644 --- a/proto/binlog/pump.proto +++ b/proto/binlog/pump.proto @@ -62,4 +62,7 @@ message Entity { // The payload of binlog entity. bytes payload = 2; + + // checksum of binlog payload. + bytes checksum = 3; }