From 8022151bb1c50517011a0ca6db3ff45b5edd6625 Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Sun, 17 Apr 2022 19:02:25 +0900 Subject: [PATCH] Add ListDocuments API (#309) - Split yorkie.protobuf into separate files - Rename FetchHistory to ListChanges --- Makefile | 7 +- api/admin.pb.go | 641 + api/admin.proto | 34 + api/cluster.pb.go | 604 + api/cluster.proto | 32 + api/converter/to_pb.go | 13 + api/resources.pb.go | 13774 ++++++++++++++++++++ api/resources.proto | 291 + api/yorkie.pb.go | 17338 +++----------------------- api/yorkie.proto | 370 +- client/client.go | 6 +- pkg/document/internal_document.go | 8 +- pkg/types/auth_webhook.go | 4 +- pkg/types/document_summary.go | 17 + test/integration/history_test.go | 2 +- yorkie/admin/admin.go | 39 + yorkie/backend/db/db.go | 11 +- yorkie/backend/db/memory/db.go | 42 +- yorkie/backend/db/memory/db_test.go | 46 +- yorkie/backend/db/mongo/client.go | 47 +- yorkie/backend/db/snapshot_info.go | 20 +- yorkie/packs/packs.go | 65 + yorkie/packs/pushpull.go | 154 +- yorkie/packs/snapshots.go | 8 +- yorkie/rpc/admin_server.go | 42 + yorkie/rpc/server.go | 6 +- yorkie/rpc/yorkie_server.go | 12 +- 27 files changed, 17615 insertions(+), 16018 deletions(-) create mode 100644 api/admin.pb.go create mode 100644 api/admin.proto create mode 100644 api/cluster.pb.go create mode 100644 api/cluster.proto create mode 100644 api/resources.pb.go create mode 100644 api/resources.proto create mode 100644 pkg/types/document_summary.go create mode 100644 yorkie/admin/admin.go create mode 100644 yorkie/rpc/admin_server.go diff --git a/Makefile b/Makefile index 6942d417e..f84d9d9be 100644 --- a/Makefile +++ b/Makefile @@ -23,12 +23,13 @@ tools: ## install tools for developing yorkie go generate -tags tools tools/tools.go proto: ## generate proto files - protoc api/yorkie.proto \ --I=. \ + protoc \ +-I=./api \ -I=$(GOPATH)/src \ --gofast_out=plugins=grpc,\ Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\ -Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,:. +Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,:./api \ +api/*.proto build: ## builds an executable that runs in the current environment go build -o $(EXECUTABLE) -ldflags "${GO_LDFLAGS}" ./cmd/yorkie diff --git a/api/admin.pb.go b/api/admin.pb.go new file mode 100644 index 000000000..85c278d42 --- /dev/null +++ b/api/admin.pb.go @@ -0,0 +1,641 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: admin.proto + +package api + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type ListDocumentsRequest struct { + PreviousId string `protobuf:"bytes,1,opt,name=previous_id,json=previousId,proto3" json:"previous_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListDocumentsRequest) Reset() { *m = ListDocumentsRequest{} } +func (m *ListDocumentsRequest) String() string { return proto.CompactTextString(m) } +func (*ListDocumentsRequest) ProtoMessage() {} +func (*ListDocumentsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_73a7fc70dcc2027c, []int{0} +} +func (m *ListDocumentsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListDocumentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListDocumentsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ListDocumentsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDocumentsRequest.Merge(m, src) +} +func (m *ListDocumentsRequest) XXX_Size() int { + return m.Size() +} +func (m *ListDocumentsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListDocumentsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDocumentsRequest proto.InternalMessageInfo + +func (m *ListDocumentsRequest) GetPreviousId() string { + if m != nil { + return m.PreviousId + } + return "" +} + +func (m *ListDocumentsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +type ListDocumentsResponse struct { + Documents []*DocumentSummary `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListDocumentsResponse) Reset() { *m = ListDocumentsResponse{} } +func (m *ListDocumentsResponse) String() string { return proto.CompactTextString(m) } +func (*ListDocumentsResponse) ProtoMessage() {} +func (*ListDocumentsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73a7fc70dcc2027c, []int{1} +} +func (m *ListDocumentsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListDocumentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListDocumentsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ListDocumentsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDocumentsResponse.Merge(m, src) +} +func (m *ListDocumentsResponse) XXX_Size() int { + return m.Size() +} +func (m *ListDocumentsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListDocumentsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDocumentsResponse proto.InternalMessageInfo + +func (m *ListDocumentsResponse) GetDocuments() []*DocumentSummary { + if m != nil { + return m.Documents + } + return nil +} + +func init() { + proto.RegisterType((*ListDocumentsRequest)(nil), "api.ListDocumentsRequest") + proto.RegisterType((*ListDocumentsResponse)(nil), "api.ListDocumentsResponse") +} + +func init() { proto.RegisterFile("admin.proto", fileDescriptor_73a7fc70dcc2027c) } + +var fileDescriptor_73a7fc70dcc2027c = []byte{ + // 230 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0x4c, 0xc9, 0xcd, + 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4e, 0x2c, 0xc8, 0x94, 0xe2, 0x2f, 0x4a, + 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0x2d, 0x86, 0x88, 0x2a, 0x85, 0x70, 0x89, 0xf8, 0x64, 0x16, + 0x97, 0xb8, 0xe4, 0x27, 0x97, 0xe6, 0xa6, 0xe6, 0x95, 0x14, 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, + 0x97, 0x08, 0xc9, 0x73, 0x71, 0x17, 0x14, 0xa5, 0x96, 0x65, 0xe6, 0x97, 0x16, 0xc7, 0x67, 0xa6, + 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x71, 0xc1, 0x84, 0x3c, 0x53, 0x84, 0xa4, 0xb9, 0x38, + 0x0b, 0x12, 0xd3, 0x53, 0xe3, 0x8b, 0x33, 0xab, 0x52, 0x25, 0x98, 0x14, 0x18, 0x35, 0x58, 0x83, + 0x38, 0x40, 0x02, 0xc1, 0x99, 0x55, 0xa9, 0x4a, 0xde, 0x5c, 0xa2, 0x68, 0xa6, 0x16, 0x17, 0xe4, + 0xe7, 0x15, 0xa7, 0x0a, 0x19, 0x71, 0x71, 0xa6, 0xc0, 0x04, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, + 0x8d, 0x44, 0xf4, 0x12, 0x0b, 0x32, 0xf5, 0x60, 0x4a, 0x83, 0x4b, 0x73, 0x73, 0x13, 0x8b, 0x2a, + 0x83, 0x10, 0xca, 0x8c, 0x02, 0xb9, 0x58, 0x1d, 0x41, 0xfe, 0x10, 0xf2, 0xe0, 0xe2, 0x45, 0x31, + 0x55, 0x48, 0x12, 0xac, 0x15, 0x9b, 0xfb, 0xa5, 0xa4, 0xb0, 0x49, 0x41, 0x1c, 0xa1, 0xc4, 0xe0, + 0x24, 0x70, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xce, 0x78, + 0x2c, 0xc7, 0x90, 0xc4, 0x06, 0x0e, 0x0e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x42, 0xa1, + 0x47, 0xd0, 0x33, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// AdminClient is the client API for Admin service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AdminClient interface { + ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) +} + +type adminClient struct { + cc *grpc.ClientConn +} + +func NewAdminClient(cc *grpc.ClientConn) AdminClient { + return &adminClient{cc} +} + +func (c *adminClient) ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) { + out := new(ListDocumentsResponse) + err := c.cc.Invoke(ctx, "/api.Admin/ListDocuments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AdminServer is the server API for Admin service. +type AdminServer interface { + ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error) +} + +// UnimplementedAdminServer can be embedded to have forward compatible implementations. +type UnimplementedAdminServer struct { +} + +func (*UnimplementedAdminServer) ListDocuments(ctx context.Context, req *ListDocumentsRequest) (*ListDocumentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDocuments not implemented") +} + +func RegisterAdminServer(s *grpc.Server, srv AdminServer) { + s.RegisterService(&_Admin_serviceDesc, srv) +} + +func _Admin_ListDocuments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDocumentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).ListDocuments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Admin/ListDocuments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).ListDocuments(ctx, req.(*ListDocumentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Admin_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.Admin", + HandlerType: (*AdminServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListDocuments", + Handler: _Admin_ListDocuments_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin.proto", +} + +func (m *ListDocumentsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListDocumentsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListDocumentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.PageSize != 0 { + i = encodeVarintAdmin(dAtA, i, uint64(m.PageSize)) + i-- + dAtA[i] = 0x10 + } + if len(m.PreviousId) > 0 { + i -= len(m.PreviousId) + copy(dAtA[i:], m.PreviousId) + i = encodeVarintAdmin(dAtA, i, uint64(len(m.PreviousId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListDocumentsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListDocumentsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListDocumentsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Documents) > 0 { + for iNdEx := len(m.Documents) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Documents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAdmin(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintAdmin(dAtA []byte, offset int, v uint64) int { + offset -= sovAdmin(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ListDocumentsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PreviousId) + if l > 0 { + n += 1 + l + sovAdmin(uint64(l)) + } + if m.PageSize != 0 { + n += 1 + sovAdmin(uint64(m.PageSize)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ListDocumentsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Documents) > 0 { + for _, e := range m.Documents { + l = e.Size() + n += 1 + l + sovAdmin(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovAdmin(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAdmin(x uint64) (n int) { + return sovAdmin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ListDocumentsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAdmin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListDocumentsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListDocumentsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviousId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAdmin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAdmin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAdmin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreviousId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PageSize", wireType) + } + m.PageSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAdmin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PageSize |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAdmin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAdmin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListDocumentsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAdmin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListDocumentsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListDocumentsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Documents", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAdmin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAdmin + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAdmin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Documents = append(m.Documents, &DocumentSummary{}) + if err := m.Documents[len(m.Documents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAdmin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAdmin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAdmin(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAdmin + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAdmin + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAdmin + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAdmin + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAdmin + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAdmin + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAdmin = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAdmin = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAdmin = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/admin.proto b/api/admin.proto new file mode 100644 index 000000000..e0be2cd8e --- /dev/null +++ b/api/admin.proto @@ -0,0 +1,34 @@ +/* + * Copyright 2022 The Yorkie Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +syntax = "proto3"; + +package api; + +import "resources.proto"; + +// Admin is a service that provides a API for Admin. +service Admin { + rpc ListDocuments (ListDocumentsRequest) returns (ListDocumentsResponse) {} +} + +message ListDocumentsRequest { + string previous_id = 1; + int32 page_size = 2; +} + +message ListDocumentsResponse { + repeated DocumentSummary documents = 1; +} diff --git a/api/cluster.pb.go b/api/cluster.pb.go new file mode 100644 index 000000000..36c303a5c --- /dev/null +++ b/api/cluster.pb.go @@ -0,0 +1,604 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cluster.proto + +package api + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type BroadcastEventRequest struct { + PublisherId []byte `protobuf:"bytes,1,opt,name=publisher_id,json=publisherId,proto3" json:"publisher_id,omitempty"` + Event *DocEvent `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BroadcastEventRequest) Reset() { *m = BroadcastEventRequest{} } +func (m *BroadcastEventRequest) String() string { return proto.CompactTextString(m) } +func (*BroadcastEventRequest) ProtoMessage() {} +func (*BroadcastEventRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3cfb3b8ec240c376, []int{0} +} +func (m *BroadcastEventRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BroadcastEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BroadcastEventRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BroadcastEventRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastEventRequest.Merge(m, src) +} +func (m *BroadcastEventRequest) XXX_Size() int { + return m.Size() +} +func (m *BroadcastEventRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastEventRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BroadcastEventRequest proto.InternalMessageInfo + +func (m *BroadcastEventRequest) GetPublisherId() []byte { + if m != nil { + return m.PublisherId + } + return nil +} + +func (m *BroadcastEventRequest) GetEvent() *DocEvent { + if m != nil { + return m.Event + } + return nil +} + +type BroadcastEventResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BroadcastEventResponse) Reset() { *m = BroadcastEventResponse{} } +func (m *BroadcastEventResponse) String() string { return proto.CompactTextString(m) } +func (*BroadcastEventResponse) ProtoMessage() {} +func (*BroadcastEventResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3cfb3b8ec240c376, []int{1} +} +func (m *BroadcastEventResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BroadcastEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BroadcastEventResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BroadcastEventResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastEventResponse.Merge(m, src) +} +func (m *BroadcastEventResponse) XXX_Size() int { + return m.Size() +} +func (m *BroadcastEventResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastEventResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BroadcastEventResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*BroadcastEventRequest)(nil), "api.BroadcastEventRequest") + proto.RegisterType((*BroadcastEventResponse)(nil), "api.BroadcastEventResponse") +} + +func init() { proto.RegisterFile("cluster.proto", fileDescriptor_3cfb3b8ec240c376) } + +var fileDescriptor_3cfb3b8ec240c376 = []byte{ + // 202 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0xce, 0x29, 0x2d, + 0x2e, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4e, 0x2c, 0xc8, 0x94, 0xe2, + 0x2f, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0x2d, 0x86, 0x88, 0x2a, 0xc5, 0x73, 0x89, 0x3a, + 0x15, 0xe5, 0x27, 0xa6, 0x24, 0x27, 0x16, 0x97, 0xb8, 0x96, 0xa5, 0xe6, 0x95, 0x04, 0xa5, 0x16, + 0x96, 0xa6, 0x16, 0x97, 0x08, 0x29, 0x72, 0xf1, 0x14, 0x94, 0x26, 0xe5, 0x64, 0x16, 0x67, 0xa4, + 0x16, 0xc5, 0x67, 0xa6, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0x71, 0xc3, 0xc5, 0x3c, 0x53, + 0x84, 0x94, 0xb9, 0x58, 0x53, 0x41, 0x5a, 0x24, 0x98, 0x14, 0x18, 0x35, 0xb8, 0x8d, 0x78, 0xf5, + 0x12, 0x0b, 0x32, 0xf5, 0x5c, 0xf2, 0x93, 0x21, 0xe6, 0x40, 0xe4, 0x94, 0x24, 0xb8, 0xc4, 0xd0, + 0x2d, 0x28, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x35, 0x0a, 0xe3, 0x62, 0x77, 0x86, 0xb8, 0x50, 0xc8, + 0x9b, 0x8b, 0x0f, 0x55, 0x91, 0x90, 0x14, 0xd8, 0x30, 0xac, 0x4e, 0x93, 0x92, 0xc6, 0x2a, 0x07, + 0x31, 0x55, 0x89, 0xc1, 0x49, 0xe0, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, + 0x92, 0x63, 0x9c, 0xf1, 0x58, 0x8e, 0x21, 0x89, 0x0d, 0xec, 0x57, 0x63, 0x40, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xf9, 0x41, 0x43, 0x39, 0x12, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// ClusterClient is the client API for Cluster service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ClusterClient interface { + BroadcastEvent(ctx context.Context, in *BroadcastEventRequest, opts ...grpc.CallOption) (*BroadcastEventResponse, error) +} + +type clusterClient struct { + cc *grpc.ClientConn +} + +func NewClusterClient(cc *grpc.ClientConn) ClusterClient { + return &clusterClient{cc} +} + +func (c *clusterClient) BroadcastEvent(ctx context.Context, in *BroadcastEventRequest, opts ...grpc.CallOption) (*BroadcastEventResponse, error) { + out := new(BroadcastEventResponse) + err := c.cc.Invoke(ctx, "/api.Cluster/BroadcastEvent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ClusterServer is the server API for Cluster service. +type ClusterServer interface { + BroadcastEvent(context.Context, *BroadcastEventRequest) (*BroadcastEventResponse, error) +} + +// UnimplementedClusterServer can be embedded to have forward compatible implementations. +type UnimplementedClusterServer struct { +} + +func (*UnimplementedClusterServer) BroadcastEvent(ctx context.Context, req *BroadcastEventRequest) (*BroadcastEventResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BroadcastEvent not implemented") +} + +func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { + s.RegisterService(&_Cluster_serviceDesc, srv) +} + +func _Cluster_BroadcastEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BroadcastEventRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterServer).BroadcastEvent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Cluster/BroadcastEvent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterServer).BroadcastEvent(ctx, req.(*BroadcastEventRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Cluster_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.Cluster", + HandlerType: (*ClusterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BroadcastEvent", + Handler: _Cluster_BroadcastEvent_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cluster.proto", +} + +func (m *BroadcastEventRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BroadcastEventRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BroadcastEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Event != nil { + { + size, err := m.Event.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCluster(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.PublisherId) > 0 { + i -= len(m.PublisherId) + copy(dAtA[i:], m.PublisherId) + i = encodeVarintCluster(dAtA, i, uint64(len(m.PublisherId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BroadcastEventResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BroadcastEventResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BroadcastEventResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func encodeVarintCluster(dAtA []byte, offset int, v uint64) int { + offset -= sovCluster(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BroadcastEventRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PublisherId) + if l > 0 { + n += 1 + l + sovCluster(uint64(l)) + } + if m.Event != nil { + l = m.Event.Size() + n += 1 + l + sovCluster(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *BroadcastEventResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovCluster(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCluster(x uint64) (n int) { + return sovCluster(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BroadcastEventRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCluster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BroadcastEventRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BroadcastEventRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublisherId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCluster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCluster + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCluster + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublisherId = append(m.PublisherId[:0], dAtA[iNdEx:postIndex]...) + if m.PublisherId == nil { + m.PublisherId = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCluster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCluster + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCluster + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Event == nil { + m.Event = &DocEvent{} + } + if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCluster(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCluster + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BroadcastEventResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCluster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BroadcastEventResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BroadcastEventResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipCluster(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCluster + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCluster(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCluster + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCluster + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCluster + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthCluster + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCluster + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCluster + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCluster = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCluster = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCluster = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/cluster.proto b/api/cluster.proto new file mode 100644 index 000000000..52d8eaff5 --- /dev/null +++ b/api/cluster.proto @@ -0,0 +1,32 @@ +/* + * Copyright 2022 The Yorkie Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +syntax = "proto3"; + +package api; + +import "resources.proto"; + +// Cluster is a service that provides a API used by Yorkie Cluster. +service Cluster { + rpc BroadcastEvent (BroadcastEventRequest) returns (BroadcastEventResponse) {} +} + +message BroadcastEventRequest { + bytes publisher_id = 1; + DocEvent event = 2; +} + +message BroadcastEventResponse {} diff --git a/api/converter/to_pb.go b/api/converter/to_pb.go index a73ad83ac..c90f027b2 100644 --- a/api/converter/to_pb.go +++ b/api/converter/to_pb.go @@ -30,6 +30,19 @@ import ( "github.com/yorkie-team/yorkie/yorkie/backend/sync" ) +// ToDocumentSummaries converts the given model to Protobuf. +func ToDocumentSummaries(summaries []*types.DocumentSummary) []*api.DocumentSummary { + pbSummaries := make([]*api.DocumentSummary, 0, len(summaries)) + for _, summary := range summaries { + pbSummaries = append(pbSummaries, &api.DocumentSummary{ + Id: summary.ID, + Key: ToDocumentKey(summary.Key), + Snapshot: summary.Snapshot, + }) + } + return pbSummaries +} + // ToClient converts the given model to Protobuf format. func ToClient(client types.Client) *api.Client { return &api.Client{ diff --git a/api/resources.pb.go b/api/resources.pb.go new file mode 100644 index 000000000..8bf5b96f5 --- /dev/null +++ b/api/resources.pb.go @@ -0,0 +1,13774 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: resources.proto + +package api + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type ValueType int32 + +const ( + ValueType_NULL ValueType = 0 + ValueType_BOOLEAN ValueType = 1 + ValueType_INTEGER ValueType = 2 + ValueType_LONG ValueType = 3 + ValueType_DOUBLE ValueType = 4 + ValueType_STRING ValueType = 5 + ValueType_BYTES ValueType = 6 + ValueType_DATE ValueType = 7 + ValueType_JSON_OBJECT ValueType = 8 + ValueType_JSON_ARRAY ValueType = 9 + ValueType_TEXT ValueType = 10 + ValueType_RICH_TEXT ValueType = 11 + ValueType_INTEGER_CNT ValueType = 12 + ValueType_LONG_CNT ValueType = 13 + ValueType_DOUBLE_CNT ValueType = 14 +) + +var ValueType_name = map[int32]string{ + 0: "NULL", + 1: "BOOLEAN", + 2: "INTEGER", + 3: "LONG", + 4: "DOUBLE", + 5: "STRING", + 6: "BYTES", + 7: "DATE", + 8: "JSON_OBJECT", + 9: "JSON_ARRAY", + 10: "TEXT", + 11: "RICH_TEXT", + 12: "INTEGER_CNT", + 13: "LONG_CNT", + 14: "DOUBLE_CNT", +} + +var ValueType_value = map[string]int32{ + "NULL": 0, + "BOOLEAN": 1, + "INTEGER": 2, + "LONG": 3, + "DOUBLE": 4, + "STRING": 5, + "BYTES": 6, + "DATE": 7, + "JSON_OBJECT": 8, + "JSON_ARRAY": 9, + "TEXT": 10, + "RICH_TEXT": 11, + "INTEGER_CNT": 12, + "LONG_CNT": 13, + "DOUBLE_CNT": 14, +} + +func (x ValueType) String() string { + return proto.EnumName(ValueType_name, int32(x)) +} + +func (ValueType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{0} +} + +type DocEventType int32 + +const ( + DocEventType_DOCUMENTS_CHANGED DocEventType = 0 + DocEventType_DOCUMENTS_WATCHED DocEventType = 1 + DocEventType_DOCUMENTS_UNWATCHED DocEventType = 2 + DocEventType_METADATA_CHANGED DocEventType = 3 +) + +var DocEventType_name = map[int32]string{ + 0: "DOCUMENTS_CHANGED", + 1: "DOCUMENTS_WATCHED", + 2: "DOCUMENTS_UNWATCHED", + 3: "METADATA_CHANGED", +} + +var DocEventType_value = map[string]int32{ + "DOCUMENTS_CHANGED": 0, + "DOCUMENTS_WATCHED": 1, + "DOCUMENTS_UNWATCHED": 2, + "METADATA_CHANGED": 3, +} + +func (x DocEventType) String() string { + return proto.EnumName(DocEventType_name, int32(x)) +} + +func (DocEventType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{1} +} + +type ChangePack struct { + DocumentKey *DocumentKey `protobuf:"bytes,1,opt,name=document_key,json=documentKey,proto3" json:"document_key,omitempty"` + Checkpoint *Checkpoint `protobuf:"bytes,2,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` + Snapshot []byte `protobuf:"bytes,3,opt,name=snapshot,proto3" json:"snapshot,omitempty"` + Changes []*Change `protobuf:"bytes,4,rep,name=changes,proto3" json:"changes,omitempty"` + MinSyncedTicket *TimeTicket `protobuf:"bytes,5,opt,name=min_synced_ticket,json=minSyncedTicket,proto3" json:"min_synced_ticket,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChangePack) Reset() { *m = ChangePack{} } +func (m *ChangePack) String() string { return proto.CompactTextString(m) } +func (*ChangePack) ProtoMessage() {} +func (*ChangePack) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{0} +} +func (m *ChangePack) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChangePack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChangePack.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChangePack) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChangePack.Merge(m, src) +} +func (m *ChangePack) XXX_Size() int { + return m.Size() +} +func (m *ChangePack) XXX_DiscardUnknown() { + xxx_messageInfo_ChangePack.DiscardUnknown(m) +} + +var xxx_messageInfo_ChangePack proto.InternalMessageInfo + +func (m *ChangePack) GetDocumentKey() *DocumentKey { + if m != nil { + return m.DocumentKey + } + return nil +} + +func (m *ChangePack) GetCheckpoint() *Checkpoint { + if m != nil { + return m.Checkpoint + } + return nil +} + +func (m *ChangePack) GetSnapshot() []byte { + if m != nil { + return m.Snapshot + } + return nil +} + +func (m *ChangePack) GetChanges() []*Change { + if m != nil { + return m.Changes + } + return nil +} + +func (m *ChangePack) GetMinSyncedTicket() *TimeTicket { + if m != nil { + return m.MinSyncedTicket + } + return nil +} + +type Change struct { + Id *ChangeID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Operations []*Operation `protobuf:"bytes,3,rep,name=operations,proto3" json:"operations,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Change) Reset() { *m = Change{} } +func (m *Change) String() string { return proto.CompactTextString(m) } +func (*Change) ProtoMessage() {} +func (*Change) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{1} +} +func (m *Change) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Change) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Change.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Change) XXX_Merge(src proto.Message) { + xxx_messageInfo_Change.Merge(m, src) +} +func (m *Change) XXX_Size() int { + return m.Size() +} +func (m *Change) XXX_DiscardUnknown() { + xxx_messageInfo_Change.DiscardUnknown(m) +} + +var xxx_messageInfo_Change proto.InternalMessageInfo + +func (m *Change) GetId() *ChangeID { + if m != nil { + return m.Id + } + return nil +} + +func (m *Change) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *Change) GetOperations() []*Operation { + if m != nil { + return m.Operations + } + return nil +} + +type ChangeID struct { + ClientSeq uint32 `protobuf:"varint,1,opt,name=client_seq,json=clientSeq,proto3" json:"client_seq,omitempty"` + ServerSeq uint64 `protobuf:"varint,2,opt,name=server_seq,json=serverSeq,proto3" json:"server_seq,omitempty"` + Lamport uint64 `protobuf:"varint,3,opt,name=lamport,proto3" json:"lamport,omitempty"` + ActorId []byte `protobuf:"bytes,4,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChangeID) Reset() { *m = ChangeID{} } +func (m *ChangeID) String() string { return proto.CompactTextString(m) } +func (*ChangeID) ProtoMessage() {} +func (*ChangeID) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{2} +} +func (m *ChangeID) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChangeID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChangeID.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChangeID) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChangeID.Merge(m, src) +} +func (m *ChangeID) XXX_Size() int { + return m.Size() +} +func (m *ChangeID) XXX_DiscardUnknown() { + xxx_messageInfo_ChangeID.DiscardUnknown(m) +} + +var xxx_messageInfo_ChangeID proto.InternalMessageInfo + +func (m *ChangeID) GetClientSeq() uint32 { + if m != nil { + return m.ClientSeq + } + return 0 +} + +func (m *ChangeID) GetServerSeq() uint64 { + if m != nil { + return m.ServerSeq + } + return 0 +} + +func (m *ChangeID) GetLamport() uint64 { + if m != nil { + return m.Lamport + } + return 0 +} + +func (m *ChangeID) GetActorId() []byte { + if m != nil { + return m.ActorId + } + return nil +} + +type Operation struct { + // Types that are valid to be assigned to Body: + // *Operation_Set_ + // *Operation_Add_ + // *Operation_Move_ + // *Operation_Remove_ + // *Operation_Edit_ + // *Operation_Select_ + // *Operation_RichEdit_ + // *Operation_Style_ + // *Operation_Increase_ + Body isOperation_Body `protobuf_oneof:"body"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation) Reset() { *m = Operation{} } +func (m *Operation) String() string { return proto.CompactTextString(m) } +func (*Operation) ProtoMessage() {} +func (*Operation) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3} +} +func (m *Operation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation.Merge(m, src) +} +func (m *Operation) XXX_Size() int { + return m.Size() +} +func (m *Operation) XXX_DiscardUnknown() { + xxx_messageInfo_Operation.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation proto.InternalMessageInfo + +type isOperation_Body interface { + isOperation_Body() + MarshalTo([]byte) (int, error) + Size() int +} + +type Operation_Set_ struct { + Set *Operation_Set `protobuf:"bytes,1,opt,name=set,proto3,oneof" json:"set,omitempty"` +} +type Operation_Add_ struct { + Add *Operation_Add `protobuf:"bytes,2,opt,name=add,proto3,oneof" json:"add,omitempty"` +} +type Operation_Move_ struct { + Move *Operation_Move `protobuf:"bytes,3,opt,name=move,proto3,oneof" json:"move,omitempty"` +} +type Operation_Remove_ struct { + Remove *Operation_Remove `protobuf:"bytes,4,opt,name=remove,proto3,oneof" json:"remove,omitempty"` +} +type Operation_Edit_ struct { + Edit *Operation_Edit `protobuf:"bytes,5,opt,name=edit,proto3,oneof" json:"edit,omitempty"` +} +type Operation_Select_ struct { + Select *Operation_Select `protobuf:"bytes,6,opt,name=select,proto3,oneof" json:"select,omitempty"` +} +type Operation_RichEdit_ struct { + RichEdit *Operation_RichEdit `protobuf:"bytes,7,opt,name=rich_edit,json=richEdit,proto3,oneof" json:"rich_edit,omitempty"` +} +type Operation_Style_ struct { + Style *Operation_Style `protobuf:"bytes,8,opt,name=style,proto3,oneof" json:"style,omitempty"` +} +type Operation_Increase_ struct { + Increase *Operation_Increase `protobuf:"bytes,9,opt,name=increase,proto3,oneof" json:"increase,omitempty"` +} + +func (*Operation_Set_) isOperation_Body() {} +func (*Operation_Add_) isOperation_Body() {} +func (*Operation_Move_) isOperation_Body() {} +func (*Operation_Remove_) isOperation_Body() {} +func (*Operation_Edit_) isOperation_Body() {} +func (*Operation_Select_) isOperation_Body() {} +func (*Operation_RichEdit_) isOperation_Body() {} +func (*Operation_Style_) isOperation_Body() {} +func (*Operation_Increase_) isOperation_Body() {} + +func (m *Operation) GetBody() isOperation_Body { + if m != nil { + return m.Body + } + return nil +} + +func (m *Operation) GetSet() *Operation_Set { + if x, ok := m.GetBody().(*Operation_Set_); ok { + return x.Set + } + return nil +} + +func (m *Operation) GetAdd() *Operation_Add { + if x, ok := m.GetBody().(*Operation_Add_); ok { + return x.Add + } + return nil +} + +func (m *Operation) GetMove() *Operation_Move { + if x, ok := m.GetBody().(*Operation_Move_); ok { + return x.Move + } + return nil +} + +func (m *Operation) GetRemove() *Operation_Remove { + if x, ok := m.GetBody().(*Operation_Remove_); ok { + return x.Remove + } + return nil +} + +func (m *Operation) GetEdit() *Operation_Edit { + if x, ok := m.GetBody().(*Operation_Edit_); ok { + return x.Edit + } + return nil +} + +func (m *Operation) GetSelect() *Operation_Select { + if x, ok := m.GetBody().(*Operation_Select_); ok { + return x.Select + } + return nil +} + +func (m *Operation) GetRichEdit() *Operation_RichEdit { + if x, ok := m.GetBody().(*Operation_RichEdit_); ok { + return x.RichEdit + } + return nil +} + +func (m *Operation) GetStyle() *Operation_Style { + if x, ok := m.GetBody().(*Operation_Style_); ok { + return x.Style + } + return nil +} + +func (m *Operation) GetIncrease() *Operation_Increase { + if x, ok := m.GetBody().(*Operation_Increase_); ok { + return x.Increase + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Operation) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Operation_Set_)(nil), + (*Operation_Add_)(nil), + (*Operation_Move_)(nil), + (*Operation_Remove_)(nil), + (*Operation_Edit_)(nil), + (*Operation_Select_)(nil), + (*Operation_RichEdit_)(nil), + (*Operation_Style_)(nil), + (*Operation_Increase_)(nil), + } +} + +type Operation_Set struct { + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Value *JSONElementSimple `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + ExecutedAt *TimeTicket `protobuf:"bytes,4,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation_Set) Reset() { *m = Operation_Set{} } +func (m *Operation_Set) String() string { return proto.CompactTextString(m) } +func (*Operation_Set) ProtoMessage() {} +func (*Operation_Set) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3, 0} +} +func (m *Operation_Set) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation_Set) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation_Set.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation_Set) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation_Set.Merge(m, src) +} +func (m *Operation_Set) XXX_Size() int { + return m.Size() +} +func (m *Operation_Set) XXX_DiscardUnknown() { + xxx_messageInfo_Operation_Set.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation_Set proto.InternalMessageInfo + +func (m *Operation_Set) GetParentCreatedAt() *TimeTicket { + if m != nil { + return m.ParentCreatedAt + } + return nil +} + +func (m *Operation_Set) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *Operation_Set) GetValue() *JSONElementSimple { + if m != nil { + return m.Value + } + return nil +} + +func (m *Operation_Set) GetExecutedAt() *TimeTicket { + if m != nil { + return m.ExecutedAt + } + return nil +} + +type Operation_Add struct { + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + PrevCreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=prev_created_at,json=prevCreatedAt,proto3" json:"prev_created_at,omitempty"` + Value *JSONElementSimple `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + ExecutedAt *TimeTicket `protobuf:"bytes,4,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation_Add) Reset() { *m = Operation_Add{} } +func (m *Operation_Add) String() string { return proto.CompactTextString(m) } +func (*Operation_Add) ProtoMessage() {} +func (*Operation_Add) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3, 1} +} +func (m *Operation_Add) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation_Add) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation_Add.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation_Add) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation_Add.Merge(m, src) +} +func (m *Operation_Add) XXX_Size() int { + return m.Size() +} +func (m *Operation_Add) XXX_DiscardUnknown() { + xxx_messageInfo_Operation_Add.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation_Add proto.InternalMessageInfo + +func (m *Operation_Add) GetParentCreatedAt() *TimeTicket { + if m != nil { + return m.ParentCreatedAt + } + return nil +} + +func (m *Operation_Add) GetPrevCreatedAt() *TimeTicket { + if m != nil { + return m.PrevCreatedAt + } + return nil +} + +func (m *Operation_Add) GetValue() *JSONElementSimple { + if m != nil { + return m.Value + } + return nil +} + +func (m *Operation_Add) GetExecutedAt() *TimeTicket { + if m != nil { + return m.ExecutedAt + } + return nil +} + +type Operation_Move struct { + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + PrevCreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=prev_created_at,json=prevCreatedAt,proto3" json:"prev_created_at,omitempty"` + CreatedAt *TimeTicket `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + ExecutedAt *TimeTicket `protobuf:"bytes,4,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation_Move) Reset() { *m = Operation_Move{} } +func (m *Operation_Move) String() string { return proto.CompactTextString(m) } +func (*Operation_Move) ProtoMessage() {} +func (*Operation_Move) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3, 2} +} +func (m *Operation_Move) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation_Move) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation_Move.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation_Move) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation_Move.Merge(m, src) +} +func (m *Operation_Move) XXX_Size() int { + return m.Size() +} +func (m *Operation_Move) XXX_DiscardUnknown() { + xxx_messageInfo_Operation_Move.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation_Move proto.InternalMessageInfo + +func (m *Operation_Move) GetParentCreatedAt() *TimeTicket { + if m != nil { + return m.ParentCreatedAt + } + return nil +} + +func (m *Operation_Move) GetPrevCreatedAt() *TimeTicket { + if m != nil { + return m.PrevCreatedAt + } + return nil +} + +func (m *Operation_Move) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Operation_Move) GetExecutedAt() *TimeTicket { + if m != nil { + return m.ExecutedAt + } + return nil +} + +type Operation_Remove struct { + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + ExecutedAt *TimeTicket `protobuf:"bytes,3,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation_Remove) Reset() { *m = Operation_Remove{} } +func (m *Operation_Remove) String() string { return proto.CompactTextString(m) } +func (*Operation_Remove) ProtoMessage() {} +func (*Operation_Remove) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3, 3} +} +func (m *Operation_Remove) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation_Remove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation_Remove.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation_Remove) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation_Remove.Merge(m, src) +} +func (m *Operation_Remove) XXX_Size() int { + return m.Size() +} +func (m *Operation_Remove) XXX_DiscardUnknown() { + xxx_messageInfo_Operation_Remove.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation_Remove proto.InternalMessageInfo + +func (m *Operation_Remove) GetParentCreatedAt() *TimeTicket { + if m != nil { + return m.ParentCreatedAt + } + return nil +} + +func (m *Operation_Remove) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *Operation_Remove) GetExecutedAt() *TimeTicket { + if m != nil { + return m.ExecutedAt + } + return nil +} + +type Operation_Edit struct { + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + CreatedAtMapByActor map[string]*TimeTicket `protobuf:"bytes,4,rep,name=created_at_map_by_actor,json=createdAtMapByActor,proto3" json:"created_at_map_by_actor,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` + ExecutedAt *TimeTicket `protobuf:"bytes,6,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation_Edit) Reset() { *m = Operation_Edit{} } +func (m *Operation_Edit) String() string { return proto.CompactTextString(m) } +func (*Operation_Edit) ProtoMessage() {} +func (*Operation_Edit) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3, 4} +} +func (m *Operation_Edit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation_Edit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation_Edit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation_Edit) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation_Edit.Merge(m, src) +} +func (m *Operation_Edit) XXX_Size() int { + return m.Size() +} +func (m *Operation_Edit) XXX_DiscardUnknown() { + xxx_messageInfo_Operation_Edit.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation_Edit proto.InternalMessageInfo + +func (m *Operation_Edit) GetParentCreatedAt() *TimeTicket { + if m != nil { + return m.ParentCreatedAt + } + return nil +} + +func (m *Operation_Edit) GetFrom() *TextNodePos { + if m != nil { + return m.From + } + return nil +} + +func (m *Operation_Edit) GetTo() *TextNodePos { + if m != nil { + return m.To + } + return nil +} + +func (m *Operation_Edit) GetCreatedAtMapByActor() map[string]*TimeTicket { + if m != nil { + return m.CreatedAtMapByActor + } + return nil +} + +func (m *Operation_Edit) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *Operation_Edit) GetExecutedAt() *TimeTicket { + if m != nil { + return m.ExecutedAt + } + return nil +} + +type Operation_Select struct { + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + ExecutedAt *TimeTicket `protobuf:"bytes,4,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation_Select) Reset() { *m = Operation_Select{} } +func (m *Operation_Select) String() string { return proto.CompactTextString(m) } +func (*Operation_Select) ProtoMessage() {} +func (*Operation_Select) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3, 5} +} +func (m *Operation_Select) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation_Select) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation_Select.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation_Select) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation_Select.Merge(m, src) +} +func (m *Operation_Select) XXX_Size() int { + return m.Size() +} +func (m *Operation_Select) XXX_DiscardUnknown() { + xxx_messageInfo_Operation_Select.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation_Select proto.InternalMessageInfo + +func (m *Operation_Select) GetParentCreatedAt() *TimeTicket { + if m != nil { + return m.ParentCreatedAt + } + return nil +} + +func (m *Operation_Select) GetFrom() *TextNodePos { + if m != nil { + return m.From + } + return nil +} + +func (m *Operation_Select) GetTo() *TextNodePos { + if m != nil { + return m.To + } + return nil +} + +func (m *Operation_Select) GetExecutedAt() *TimeTicket { + if m != nil { + return m.ExecutedAt + } + return nil +} + +type Operation_RichEdit struct { + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + CreatedAtMapByActor map[string]*TimeTicket `protobuf:"bytes,4,rep,name=created_at_map_by_actor,json=createdAtMapByActor,proto3" json:"created_at_map_by_actor,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` + Attributes map[string]string `protobuf:"bytes,6,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ExecutedAt *TimeTicket `protobuf:"bytes,7,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation_RichEdit) Reset() { *m = Operation_RichEdit{} } +func (m *Operation_RichEdit) String() string { return proto.CompactTextString(m) } +func (*Operation_RichEdit) ProtoMessage() {} +func (*Operation_RichEdit) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3, 6} +} +func (m *Operation_RichEdit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation_RichEdit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation_RichEdit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation_RichEdit) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation_RichEdit.Merge(m, src) +} +func (m *Operation_RichEdit) XXX_Size() int { + return m.Size() +} +func (m *Operation_RichEdit) XXX_DiscardUnknown() { + xxx_messageInfo_Operation_RichEdit.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation_RichEdit proto.InternalMessageInfo + +func (m *Operation_RichEdit) GetParentCreatedAt() *TimeTicket { + if m != nil { + return m.ParentCreatedAt + } + return nil +} + +func (m *Operation_RichEdit) GetFrom() *TextNodePos { + if m != nil { + return m.From + } + return nil +} + +func (m *Operation_RichEdit) GetTo() *TextNodePos { + if m != nil { + return m.To + } + return nil +} + +func (m *Operation_RichEdit) GetCreatedAtMapByActor() map[string]*TimeTicket { + if m != nil { + return m.CreatedAtMapByActor + } + return nil +} + +func (m *Operation_RichEdit) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *Operation_RichEdit) GetAttributes() map[string]string { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *Operation_RichEdit) GetExecutedAt() *TimeTicket { + if m != nil { + return m.ExecutedAt + } + return nil +} + +type Operation_Style struct { + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + Attributes map[string]string `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ExecutedAt *TimeTicket `protobuf:"bytes,5,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation_Style) Reset() { *m = Operation_Style{} } +func (m *Operation_Style) String() string { return proto.CompactTextString(m) } +func (*Operation_Style) ProtoMessage() {} +func (*Operation_Style) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3, 7} +} +func (m *Operation_Style) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation_Style) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation_Style.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation_Style) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation_Style.Merge(m, src) +} +func (m *Operation_Style) XXX_Size() int { + return m.Size() +} +func (m *Operation_Style) XXX_DiscardUnknown() { + xxx_messageInfo_Operation_Style.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation_Style proto.InternalMessageInfo + +func (m *Operation_Style) GetParentCreatedAt() *TimeTicket { + if m != nil { + return m.ParentCreatedAt + } + return nil +} + +func (m *Operation_Style) GetFrom() *TextNodePos { + if m != nil { + return m.From + } + return nil +} + +func (m *Operation_Style) GetTo() *TextNodePos { + if m != nil { + return m.To + } + return nil +} + +func (m *Operation_Style) GetAttributes() map[string]string { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *Operation_Style) GetExecutedAt() *TimeTicket { + if m != nil { + return m.ExecutedAt + } + return nil +} + +type Operation_Increase struct { + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + Value *JSONElementSimple `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + ExecutedAt *TimeTicket `protobuf:"bytes,3,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation_Increase) Reset() { *m = Operation_Increase{} } +func (m *Operation_Increase) String() string { return proto.CompactTextString(m) } +func (*Operation_Increase) ProtoMessage() {} +func (*Operation_Increase) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{3, 8} +} +func (m *Operation_Increase) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Operation_Increase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Operation_Increase.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Operation_Increase) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation_Increase.Merge(m, src) +} +func (m *Operation_Increase) XXX_Size() int { + return m.Size() +} +func (m *Operation_Increase) XXX_DiscardUnknown() { + xxx_messageInfo_Operation_Increase.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation_Increase proto.InternalMessageInfo + +func (m *Operation_Increase) GetParentCreatedAt() *TimeTicket { + if m != nil { + return m.ParentCreatedAt + } + return nil +} + +func (m *Operation_Increase) GetValue() *JSONElementSimple { + if m != nil { + return m.Value + } + return nil +} + +func (m *Operation_Increase) GetExecutedAt() *TimeTicket { + if m != nil { + return m.ExecutedAt + } + return nil +} + +type JSONElementSimple struct { + CreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + MovedAt *TimeTicket `protobuf:"bytes,2,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` + RemovedAt *TimeTicket `protobuf:"bytes,3,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` + Type ValueType `protobuf:"varint,4,opt,name=type,proto3,enum=api.ValueType" json:"type,omitempty"` + Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JSONElementSimple) Reset() { *m = JSONElementSimple{} } +func (m *JSONElementSimple) String() string { return proto.CompactTextString(m) } +func (*JSONElementSimple) ProtoMessage() {} +func (*JSONElementSimple) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{4} +} +func (m *JSONElementSimple) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JSONElementSimple) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_JSONElementSimple.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *JSONElementSimple) XXX_Merge(src proto.Message) { + xxx_messageInfo_JSONElementSimple.Merge(m, src) +} +func (m *JSONElementSimple) XXX_Size() int { + return m.Size() +} +func (m *JSONElementSimple) XXX_DiscardUnknown() { + xxx_messageInfo_JSONElementSimple.DiscardUnknown(m) +} + +var xxx_messageInfo_JSONElementSimple proto.InternalMessageInfo + +func (m *JSONElementSimple) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *JSONElementSimple) GetMovedAt() *TimeTicket { + if m != nil { + return m.MovedAt + } + return nil +} + +func (m *JSONElementSimple) GetRemovedAt() *TimeTicket { + if m != nil { + return m.RemovedAt + } + return nil +} + +func (m *JSONElementSimple) GetType() ValueType { + if m != nil { + return m.Type + } + return ValueType_NULL +} + +func (m *JSONElementSimple) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +type JSONElement struct { + // Types that are valid to be assigned to Body: + // *JSONElement_JsonObject + // *JSONElement_JsonArray + // *JSONElement_Primitive_ + // *JSONElement_Text_ + // *JSONElement_RichText_ + // *JSONElement_Counter_ + Body isJSONElement_Body `protobuf_oneof:"Body"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JSONElement) Reset() { *m = JSONElement{} } +func (m *JSONElement) String() string { return proto.CompactTextString(m) } +func (*JSONElement) ProtoMessage() {} +func (*JSONElement) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{5} +} +func (m *JSONElement) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JSONElement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_JSONElement.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *JSONElement) XXX_Merge(src proto.Message) { + xxx_messageInfo_JSONElement.Merge(m, src) +} +func (m *JSONElement) XXX_Size() int { + return m.Size() +} +func (m *JSONElement) XXX_DiscardUnknown() { + xxx_messageInfo_JSONElement.DiscardUnknown(m) +} + +var xxx_messageInfo_JSONElement proto.InternalMessageInfo + +type isJSONElement_Body interface { + isJSONElement_Body() + MarshalTo([]byte) (int, error) + Size() int +} + +type JSONElement_JsonObject struct { + JsonObject *JSONElement_JSONObject `protobuf:"bytes,1,opt,name=json_object,json=jsonObject,proto3,oneof" json:"json_object,omitempty"` +} +type JSONElement_JsonArray struct { + JsonArray *JSONElement_JSONArray `protobuf:"bytes,2,opt,name=json_array,json=jsonArray,proto3,oneof" json:"json_array,omitempty"` +} +type JSONElement_Primitive_ struct { + Primitive *JSONElement_Primitive `protobuf:"bytes,3,opt,name=primitive,proto3,oneof" json:"primitive,omitempty"` +} +type JSONElement_Text_ struct { + Text *JSONElement_Text `protobuf:"bytes,4,opt,name=text,proto3,oneof" json:"text,omitempty"` +} +type JSONElement_RichText_ struct { + RichText *JSONElement_RichText `protobuf:"bytes,5,opt,name=rich_text,json=richText,proto3,oneof" json:"rich_text,omitempty"` +} +type JSONElement_Counter_ struct { + Counter *JSONElement_Counter `protobuf:"bytes,6,opt,name=counter,proto3,oneof" json:"counter,omitempty"` +} + +func (*JSONElement_JsonObject) isJSONElement_Body() {} +func (*JSONElement_JsonArray) isJSONElement_Body() {} +func (*JSONElement_Primitive_) isJSONElement_Body() {} +func (*JSONElement_Text_) isJSONElement_Body() {} +func (*JSONElement_RichText_) isJSONElement_Body() {} +func (*JSONElement_Counter_) isJSONElement_Body() {} + +func (m *JSONElement) GetBody() isJSONElement_Body { + if m != nil { + return m.Body + } + return nil +} + +func (m *JSONElement) GetJsonObject() *JSONElement_JSONObject { + if x, ok := m.GetBody().(*JSONElement_JsonObject); ok { + return x.JsonObject + } + return nil +} + +func (m *JSONElement) GetJsonArray() *JSONElement_JSONArray { + if x, ok := m.GetBody().(*JSONElement_JsonArray); ok { + return x.JsonArray + } + return nil +} + +func (m *JSONElement) GetPrimitive() *JSONElement_Primitive { + if x, ok := m.GetBody().(*JSONElement_Primitive_); ok { + return x.Primitive + } + return nil +} + +func (m *JSONElement) GetText() *JSONElement_Text { + if x, ok := m.GetBody().(*JSONElement_Text_); ok { + return x.Text + } + return nil +} + +func (m *JSONElement) GetRichText() *JSONElement_RichText { + if x, ok := m.GetBody().(*JSONElement_RichText_); ok { + return x.RichText + } + return nil +} + +func (m *JSONElement) GetCounter() *JSONElement_Counter { + if x, ok := m.GetBody().(*JSONElement_Counter_); ok { + return x.Counter + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*JSONElement) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*JSONElement_JsonObject)(nil), + (*JSONElement_JsonArray)(nil), + (*JSONElement_Primitive_)(nil), + (*JSONElement_Text_)(nil), + (*JSONElement_RichText_)(nil), + (*JSONElement_Counter_)(nil), + } +} + +type JSONElement_JSONObject struct { + Nodes []*RHTNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` + CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + MovedAt *TimeTicket `protobuf:"bytes,3,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` + RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JSONElement_JSONObject) Reset() { *m = JSONElement_JSONObject{} } +func (m *JSONElement_JSONObject) String() string { return proto.CompactTextString(m) } +func (*JSONElement_JSONObject) ProtoMessage() {} +func (*JSONElement_JSONObject) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{5, 0} +} +func (m *JSONElement_JSONObject) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JSONElement_JSONObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_JSONElement_JSONObject.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *JSONElement_JSONObject) XXX_Merge(src proto.Message) { + xxx_messageInfo_JSONElement_JSONObject.Merge(m, src) +} +func (m *JSONElement_JSONObject) XXX_Size() int { + return m.Size() +} +func (m *JSONElement_JSONObject) XXX_DiscardUnknown() { + xxx_messageInfo_JSONElement_JSONObject.DiscardUnknown(m) +} + +var xxx_messageInfo_JSONElement_JSONObject proto.InternalMessageInfo + +func (m *JSONElement_JSONObject) GetNodes() []*RHTNode { + if m != nil { + return m.Nodes + } + return nil +} + +func (m *JSONElement_JSONObject) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *JSONElement_JSONObject) GetMovedAt() *TimeTicket { + if m != nil { + return m.MovedAt + } + return nil +} + +func (m *JSONElement_JSONObject) GetRemovedAt() *TimeTicket { + if m != nil { + return m.RemovedAt + } + return nil +} + +type JSONElement_JSONArray struct { + Nodes []*RGANode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` + CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + MovedAt *TimeTicket `protobuf:"bytes,3,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` + RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JSONElement_JSONArray) Reset() { *m = JSONElement_JSONArray{} } +func (m *JSONElement_JSONArray) String() string { return proto.CompactTextString(m) } +func (*JSONElement_JSONArray) ProtoMessage() {} +func (*JSONElement_JSONArray) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{5, 1} +} +func (m *JSONElement_JSONArray) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JSONElement_JSONArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_JSONElement_JSONArray.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *JSONElement_JSONArray) XXX_Merge(src proto.Message) { + xxx_messageInfo_JSONElement_JSONArray.Merge(m, src) +} +func (m *JSONElement_JSONArray) XXX_Size() int { + return m.Size() +} +func (m *JSONElement_JSONArray) XXX_DiscardUnknown() { + xxx_messageInfo_JSONElement_JSONArray.DiscardUnknown(m) +} + +var xxx_messageInfo_JSONElement_JSONArray proto.InternalMessageInfo + +func (m *JSONElement_JSONArray) GetNodes() []*RGANode { + if m != nil { + return m.Nodes + } + return nil +} + +func (m *JSONElement_JSONArray) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *JSONElement_JSONArray) GetMovedAt() *TimeTicket { + if m != nil { + return m.MovedAt + } + return nil +} + +func (m *JSONElement_JSONArray) GetRemovedAt() *TimeTicket { + if m != nil { + return m.RemovedAt + } + return nil +} + +type JSONElement_Primitive struct { + Type ValueType `protobuf:"varint,1,opt,name=type,proto3,enum=api.ValueType" json:"type,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + CreatedAt *TimeTicket `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + MovedAt *TimeTicket `protobuf:"bytes,4,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` + RemovedAt *TimeTicket `protobuf:"bytes,5,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JSONElement_Primitive) Reset() { *m = JSONElement_Primitive{} } +func (m *JSONElement_Primitive) String() string { return proto.CompactTextString(m) } +func (*JSONElement_Primitive) ProtoMessage() {} +func (*JSONElement_Primitive) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{5, 2} +} +func (m *JSONElement_Primitive) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JSONElement_Primitive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_JSONElement_Primitive.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *JSONElement_Primitive) XXX_Merge(src proto.Message) { + xxx_messageInfo_JSONElement_Primitive.Merge(m, src) +} +func (m *JSONElement_Primitive) XXX_Size() int { + return m.Size() +} +func (m *JSONElement_Primitive) XXX_DiscardUnknown() { + xxx_messageInfo_JSONElement_Primitive.DiscardUnknown(m) +} + +var xxx_messageInfo_JSONElement_Primitive proto.InternalMessageInfo + +func (m *JSONElement_Primitive) GetType() ValueType { + if m != nil { + return m.Type + } + return ValueType_NULL +} + +func (m *JSONElement_Primitive) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *JSONElement_Primitive) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *JSONElement_Primitive) GetMovedAt() *TimeTicket { + if m != nil { + return m.MovedAt + } + return nil +} + +func (m *JSONElement_Primitive) GetRemovedAt() *TimeTicket { + if m != nil { + return m.RemovedAt + } + return nil +} + +type JSONElement_Text struct { + Nodes []*TextNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` + CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + MovedAt *TimeTicket `protobuf:"bytes,3,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` + RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JSONElement_Text) Reset() { *m = JSONElement_Text{} } +func (m *JSONElement_Text) String() string { return proto.CompactTextString(m) } +func (*JSONElement_Text) ProtoMessage() {} +func (*JSONElement_Text) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{5, 3} +} +func (m *JSONElement_Text) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JSONElement_Text) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_JSONElement_Text.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *JSONElement_Text) XXX_Merge(src proto.Message) { + xxx_messageInfo_JSONElement_Text.Merge(m, src) +} +func (m *JSONElement_Text) XXX_Size() int { + return m.Size() +} +func (m *JSONElement_Text) XXX_DiscardUnknown() { + xxx_messageInfo_JSONElement_Text.DiscardUnknown(m) +} + +var xxx_messageInfo_JSONElement_Text proto.InternalMessageInfo + +func (m *JSONElement_Text) GetNodes() []*TextNode { + if m != nil { + return m.Nodes + } + return nil +} + +func (m *JSONElement_Text) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *JSONElement_Text) GetMovedAt() *TimeTicket { + if m != nil { + return m.MovedAt + } + return nil +} + +func (m *JSONElement_Text) GetRemovedAt() *TimeTicket { + if m != nil { + return m.RemovedAt + } + return nil +} + +type JSONElement_RichText struct { + Nodes []*RichTextNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` + CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + MovedAt *TimeTicket `protobuf:"bytes,3,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` + RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JSONElement_RichText) Reset() { *m = JSONElement_RichText{} } +func (m *JSONElement_RichText) String() string { return proto.CompactTextString(m) } +func (*JSONElement_RichText) ProtoMessage() {} +func (*JSONElement_RichText) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{5, 4} +} +func (m *JSONElement_RichText) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JSONElement_RichText) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_JSONElement_RichText.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *JSONElement_RichText) XXX_Merge(src proto.Message) { + xxx_messageInfo_JSONElement_RichText.Merge(m, src) +} +func (m *JSONElement_RichText) XXX_Size() int { + return m.Size() +} +func (m *JSONElement_RichText) XXX_DiscardUnknown() { + xxx_messageInfo_JSONElement_RichText.DiscardUnknown(m) +} + +var xxx_messageInfo_JSONElement_RichText proto.InternalMessageInfo + +func (m *JSONElement_RichText) GetNodes() []*RichTextNode { + if m != nil { + return m.Nodes + } + return nil +} + +func (m *JSONElement_RichText) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *JSONElement_RichText) GetMovedAt() *TimeTicket { + if m != nil { + return m.MovedAt + } + return nil +} + +func (m *JSONElement_RichText) GetRemovedAt() *TimeTicket { + if m != nil { + return m.RemovedAt + } + return nil +} + +type JSONElement_Counter struct { + Type ValueType `protobuf:"varint,1,opt,name=type,proto3,enum=api.ValueType" json:"type,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + CreatedAt *TimeTicket `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + MovedAt *TimeTicket `protobuf:"bytes,4,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` + RemovedAt *TimeTicket `protobuf:"bytes,5,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JSONElement_Counter) Reset() { *m = JSONElement_Counter{} } +func (m *JSONElement_Counter) String() string { return proto.CompactTextString(m) } +func (*JSONElement_Counter) ProtoMessage() {} +func (*JSONElement_Counter) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{5, 5} +} +func (m *JSONElement_Counter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JSONElement_Counter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_JSONElement_Counter.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *JSONElement_Counter) XXX_Merge(src proto.Message) { + xxx_messageInfo_JSONElement_Counter.Merge(m, src) +} +func (m *JSONElement_Counter) XXX_Size() int { + return m.Size() +} +func (m *JSONElement_Counter) XXX_DiscardUnknown() { + xxx_messageInfo_JSONElement_Counter.DiscardUnknown(m) +} + +var xxx_messageInfo_JSONElement_Counter proto.InternalMessageInfo + +func (m *JSONElement_Counter) GetType() ValueType { + if m != nil { + return m.Type + } + return ValueType_NULL +} + +func (m *JSONElement_Counter) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *JSONElement_Counter) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *JSONElement_Counter) GetMovedAt() *TimeTicket { + if m != nil { + return m.MovedAt + } + return nil +} + +func (m *JSONElement_Counter) GetRemovedAt() *TimeTicket { + if m != nil { + return m.RemovedAt + } + return nil +} + +type RHTNode struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Element *JSONElement `protobuf:"bytes,2,opt,name=element,proto3" json:"element,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RHTNode) Reset() { *m = RHTNode{} } +func (m *RHTNode) String() string { return proto.CompactTextString(m) } +func (*RHTNode) ProtoMessage() {} +func (*RHTNode) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{6} +} +func (m *RHTNode) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RHTNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RHTNode.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RHTNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_RHTNode.Merge(m, src) +} +func (m *RHTNode) XXX_Size() int { + return m.Size() +} +func (m *RHTNode) XXX_DiscardUnknown() { + xxx_messageInfo_RHTNode.DiscardUnknown(m) +} + +var xxx_messageInfo_RHTNode proto.InternalMessageInfo + +func (m *RHTNode) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *RHTNode) GetElement() *JSONElement { + if m != nil { + return m.Element + } + return nil +} + +type RGANode struct { + Next *RGANode `protobuf:"bytes,1,opt,name=next,proto3" json:"next,omitempty"` + Element *JSONElement `protobuf:"bytes,2,opt,name=element,proto3" json:"element,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RGANode) Reset() { *m = RGANode{} } +func (m *RGANode) String() string { return proto.CompactTextString(m) } +func (*RGANode) ProtoMessage() {} +func (*RGANode) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{7} +} +func (m *RGANode) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RGANode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RGANode.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RGANode) XXX_Merge(src proto.Message) { + xxx_messageInfo_RGANode.Merge(m, src) +} +func (m *RGANode) XXX_Size() int { + return m.Size() +} +func (m *RGANode) XXX_DiscardUnknown() { + xxx_messageInfo_RGANode.DiscardUnknown(m) +} + +var xxx_messageInfo_RGANode proto.InternalMessageInfo + +func (m *RGANode) GetNext() *RGANode { + if m != nil { + return m.Next + } + return nil +} + +func (m *RGANode) GetElement() *JSONElement { + if m != nil { + return m.Element + } + return nil +} + +type TextNode struct { + Id *TextNodeID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + RemovedAt *TimeTicket `protobuf:"bytes,3,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` + InsPrevId *TextNodeID `protobuf:"bytes,4,opt,name=ins_prev_id,json=insPrevId,proto3" json:"ins_prev_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TextNode) Reset() { *m = TextNode{} } +func (m *TextNode) String() string { return proto.CompactTextString(m) } +func (*TextNode) ProtoMessage() {} +func (*TextNode) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{8} +} +func (m *TextNode) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TextNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TextNode.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TextNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_TextNode.Merge(m, src) +} +func (m *TextNode) XXX_Size() int { + return m.Size() +} +func (m *TextNode) XXX_DiscardUnknown() { + xxx_messageInfo_TextNode.DiscardUnknown(m) +} + +var xxx_messageInfo_TextNode proto.InternalMessageInfo + +func (m *TextNode) GetId() *TextNodeID { + if m != nil { + return m.Id + } + return nil +} + +func (m *TextNode) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *TextNode) GetRemovedAt() *TimeTicket { + if m != nil { + return m.RemovedAt + } + return nil +} + +func (m *TextNode) GetInsPrevId() *TextNodeID { + if m != nil { + return m.InsPrevId + } + return nil +} + +type RichTextNodeAttr 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"` + UpdatedAt *TimeTicket `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RichTextNodeAttr) Reset() { *m = RichTextNodeAttr{} } +func (m *RichTextNodeAttr) String() string { return proto.CompactTextString(m) } +func (*RichTextNodeAttr) ProtoMessage() {} +func (*RichTextNodeAttr) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{9} +} +func (m *RichTextNodeAttr) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RichTextNodeAttr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RichTextNodeAttr.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RichTextNodeAttr) XXX_Merge(src proto.Message) { + xxx_messageInfo_RichTextNodeAttr.Merge(m, src) +} +func (m *RichTextNodeAttr) XXX_Size() int { + return m.Size() +} +func (m *RichTextNodeAttr) XXX_DiscardUnknown() { + xxx_messageInfo_RichTextNodeAttr.DiscardUnknown(m) +} + +var xxx_messageInfo_RichTextNodeAttr proto.InternalMessageInfo + +func (m *RichTextNodeAttr) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *RichTextNodeAttr) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *RichTextNodeAttr) GetUpdatedAt() *TimeTicket { + if m != nil { + return m.UpdatedAt + } + return nil +} + +type RichTextNode struct { + Id *TextNodeID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Attributes map[string]*RichTextNodeAttr `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` + InsPrevId *TextNodeID `protobuf:"bytes,5,opt,name=ins_prev_id,json=insPrevId,proto3" json:"ins_prev_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RichTextNode) Reset() { *m = RichTextNode{} } +func (m *RichTextNode) String() string { return proto.CompactTextString(m) } +func (*RichTextNode) ProtoMessage() {} +func (*RichTextNode) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{10} +} +func (m *RichTextNode) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RichTextNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RichTextNode.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RichTextNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_RichTextNode.Merge(m, src) +} +func (m *RichTextNode) XXX_Size() int { + return m.Size() +} +func (m *RichTextNode) XXX_DiscardUnknown() { + xxx_messageInfo_RichTextNode.DiscardUnknown(m) +} + +var xxx_messageInfo_RichTextNode proto.InternalMessageInfo + +func (m *RichTextNode) GetId() *TextNodeID { + if m != nil { + return m.Id + } + return nil +} + +func (m *RichTextNode) GetAttributes() map[string]*RichTextNodeAttr { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *RichTextNode) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *RichTextNode) GetRemovedAt() *TimeTicket { + if m != nil { + return m.RemovedAt + } + return nil +} + +func (m *RichTextNode) GetInsPrevId() *TextNodeID { + if m != nil { + return m.InsPrevId + } + return nil +} + +type TextNodeID struct { + CreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TextNodeID) Reset() { *m = TextNodeID{} } +func (m *TextNodeID) String() string { return proto.CompactTextString(m) } +func (*TextNodeID) ProtoMessage() {} +func (*TextNodeID) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{11} +} +func (m *TextNodeID) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TextNodeID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TextNodeID.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TextNodeID) XXX_Merge(src proto.Message) { + xxx_messageInfo_TextNodeID.Merge(m, src) +} +func (m *TextNodeID) XXX_Size() int { + return m.Size() +} +func (m *TextNodeID) XXX_DiscardUnknown() { + xxx_messageInfo_TextNodeID.DiscardUnknown(m) +} + +var xxx_messageInfo_TextNodeID proto.InternalMessageInfo + +func (m *TextNodeID) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *TextNodeID) GetOffset() int32 { + if m != nil { + return m.Offset + } + return 0 +} + +type DocumentSummary struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Key *DocumentKey `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Snapshot string `protobuf:"bytes,3,opt,name=snapshot,proto3" json:"snapshot,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DocumentSummary) Reset() { *m = DocumentSummary{} } +func (m *DocumentSummary) String() string { return proto.CompactTextString(m) } +func (*DocumentSummary) ProtoMessage() {} +func (*DocumentSummary) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{12} +} +func (m *DocumentSummary) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DocumentSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DocumentSummary.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DocumentSummary) XXX_Merge(src proto.Message) { + xxx_messageInfo_DocumentSummary.Merge(m, src) +} +func (m *DocumentSummary) XXX_Size() int { + return m.Size() +} +func (m *DocumentSummary) XXX_DiscardUnknown() { + xxx_messageInfo_DocumentSummary.DiscardUnknown(m) +} + +var xxx_messageInfo_DocumentSummary proto.InternalMessageInfo + +func (m *DocumentSummary) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *DocumentSummary) GetKey() *DocumentKey { + if m != nil { + return m.Key + } + return nil +} + +func (m *DocumentSummary) GetSnapshot() string { + if m != nil { + return m.Snapshot + } + return "" +} + +type Metadata struct { + Clock int32 `protobuf:"varint,1,opt,name=clock,proto3" json:"clock,omitempty"` + Data map[string]string `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Metadata) Reset() { *m = Metadata{} } +func (m *Metadata) String() string { return proto.CompactTextString(m) } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{13} +} +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(m, src) +} +func (m *Metadata) XXX_Size() int { + return m.Size() +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Metadata proto.InternalMessageInfo + +func (m *Metadata) GetClock() int32 { + if m != nil { + return m.Clock + } + return 0 +} + +func (m *Metadata) GetData() map[string]string { + if m != nil { + return m.Data + } + return nil +} + +type Client struct { + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Client) Reset() { *m = Client{} } +func (m *Client) String() string { return proto.CompactTextString(m) } +func (*Client) ProtoMessage() {} +func (*Client) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{14} +} +func (m *Client) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Client) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Client.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Client) XXX_Merge(src proto.Message) { + xxx_messageInfo_Client.Merge(m, src) +} +func (m *Client) XXX_Size() int { + return m.Size() +} +func (m *Client) XXX_DiscardUnknown() { + xxx_messageInfo_Client.DiscardUnknown(m) +} + +var xxx_messageInfo_Client proto.InternalMessageInfo + +func (m *Client) GetId() []byte { + if m != nil { + return m.Id + } + return nil +} + +func (m *Client) GetMetadata() *Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +type Clients struct { + Clients []*Client `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Clients) Reset() { *m = Clients{} } +func (m *Clients) String() string { return proto.CompactTextString(m) } +func (*Clients) ProtoMessage() {} +func (*Clients) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{15} +} +func (m *Clients) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Clients) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Clients.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Clients) XXX_Merge(src proto.Message) { + xxx_messageInfo_Clients.Merge(m, src) +} +func (m *Clients) XXX_Size() int { + return m.Size() +} +func (m *Clients) XXX_DiscardUnknown() { + xxx_messageInfo_Clients.DiscardUnknown(m) +} + +var xxx_messageInfo_Clients proto.InternalMessageInfo + +func (m *Clients) GetClients() []*Client { + if m != nil { + return m.Clients + } + return nil +} + +type DocumentKey struct { + Collection string `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"` + Document string `protobuf:"bytes,2,opt,name=document,proto3" json:"document,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DocumentKey) Reset() { *m = DocumentKey{} } +func (m *DocumentKey) String() string { return proto.CompactTextString(m) } +func (*DocumentKey) ProtoMessage() {} +func (*DocumentKey) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{16} +} +func (m *DocumentKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DocumentKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DocumentKey.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DocumentKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_DocumentKey.Merge(m, src) +} +func (m *DocumentKey) XXX_Size() int { + return m.Size() +} +func (m *DocumentKey) XXX_DiscardUnknown() { + xxx_messageInfo_DocumentKey.DiscardUnknown(m) +} + +var xxx_messageInfo_DocumentKey proto.InternalMessageInfo + +func (m *DocumentKey) GetCollection() string { + if m != nil { + return m.Collection + } + return "" +} + +func (m *DocumentKey) GetDocument() string { + if m != nil { + return m.Document + } + return "" +} + +type Checkpoint struct { + ServerSeq uint64 `protobuf:"varint,1,opt,name=server_seq,json=serverSeq,proto3" json:"server_seq,omitempty"` + ClientSeq uint32 `protobuf:"varint,2,opt,name=client_seq,json=clientSeq,proto3" json:"client_seq,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Checkpoint) Reset() { *m = Checkpoint{} } +func (m *Checkpoint) String() string { return proto.CompactTextString(m) } +func (*Checkpoint) ProtoMessage() {} +func (*Checkpoint) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{17} +} +func (m *Checkpoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Checkpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Checkpoint.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Checkpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_Checkpoint.Merge(m, src) +} +func (m *Checkpoint) XXX_Size() int { + return m.Size() +} +func (m *Checkpoint) XXX_DiscardUnknown() { + xxx_messageInfo_Checkpoint.DiscardUnknown(m) +} + +var xxx_messageInfo_Checkpoint proto.InternalMessageInfo + +func (m *Checkpoint) GetServerSeq() uint64 { + if m != nil { + return m.ServerSeq + } + return 0 +} + +func (m *Checkpoint) GetClientSeq() uint32 { + if m != nil { + return m.ClientSeq + } + return 0 +} + +type TextNodePos struct { + CreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + RelativeOffset int32 `protobuf:"varint,3,opt,name=relative_offset,json=relativeOffset,proto3" json:"relative_offset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TextNodePos) Reset() { *m = TextNodePos{} } +func (m *TextNodePos) String() string { return proto.CompactTextString(m) } +func (*TextNodePos) ProtoMessage() {} +func (*TextNodePos) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{18} +} +func (m *TextNodePos) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TextNodePos) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TextNodePos.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TextNodePos) XXX_Merge(src proto.Message) { + xxx_messageInfo_TextNodePos.Merge(m, src) +} +func (m *TextNodePos) XXX_Size() int { + return m.Size() +} +func (m *TextNodePos) XXX_DiscardUnknown() { + xxx_messageInfo_TextNodePos.DiscardUnknown(m) +} + +var xxx_messageInfo_TextNodePos proto.InternalMessageInfo + +func (m *TextNodePos) GetCreatedAt() *TimeTicket { + if m != nil { + return m.CreatedAt + } + return nil +} + +func (m *TextNodePos) GetOffset() int32 { + if m != nil { + return m.Offset + } + return 0 +} + +func (m *TextNodePos) GetRelativeOffset() int32 { + if m != nil { + return m.RelativeOffset + } + return 0 +} + +type TimeTicket struct { + Lamport uint64 `protobuf:"varint,1,opt,name=lamport,proto3" json:"lamport,omitempty"` + Delimiter uint32 `protobuf:"varint,2,opt,name=delimiter,proto3" json:"delimiter,omitempty"` + ActorId []byte `protobuf:"bytes,3,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TimeTicket) Reset() { *m = TimeTicket{} } +func (m *TimeTicket) String() string { return proto.CompactTextString(m) } +func (*TimeTicket) ProtoMessage() {} +func (*TimeTicket) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{19} +} +func (m *TimeTicket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TimeTicket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TimeTicket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TimeTicket) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimeTicket.Merge(m, src) +} +func (m *TimeTicket) XXX_Size() int { + return m.Size() +} +func (m *TimeTicket) XXX_DiscardUnknown() { + xxx_messageInfo_TimeTicket.DiscardUnknown(m) +} + +var xxx_messageInfo_TimeTicket proto.InternalMessageInfo + +func (m *TimeTicket) GetLamport() uint64 { + if m != nil { + return m.Lamport + } + return 0 +} + +func (m *TimeTicket) GetDelimiter() uint32 { + if m != nil { + return m.Delimiter + } + return 0 +} + +func (m *TimeTicket) GetActorId() []byte { + if m != nil { + return m.ActorId + } + return nil +} + +type DocEvent struct { + Type DocEventType `protobuf:"varint,1,opt,name=type,proto3,enum=api.DocEventType" json:"type,omitempty"` + Publisher *Client `protobuf:"bytes,2,opt,name=publisher,proto3" json:"publisher,omitempty"` + DocumentKeys []*DocumentKey `protobuf:"bytes,3,rep,name=document_keys,json=documentKeys,proto3" json:"document_keys,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DocEvent) Reset() { *m = DocEvent{} } +func (m *DocEvent) String() string { return proto.CompactTextString(m) } +func (*DocEvent) ProtoMessage() {} +func (*DocEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_cf1b13971fe4c19d, []int{20} +} +func (m *DocEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DocEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DocEvent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DocEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_DocEvent.Merge(m, src) +} +func (m *DocEvent) XXX_Size() int { + return m.Size() +} +func (m *DocEvent) XXX_DiscardUnknown() { + xxx_messageInfo_DocEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_DocEvent proto.InternalMessageInfo + +func (m *DocEvent) GetType() DocEventType { + if m != nil { + return m.Type + } + return DocEventType_DOCUMENTS_CHANGED +} + +func (m *DocEvent) GetPublisher() *Client { + if m != nil { + return m.Publisher + } + return nil +} + +func (m *DocEvent) GetDocumentKeys() []*DocumentKey { + if m != nil { + return m.DocumentKeys + } + return nil +} + +func init() { + proto.RegisterEnum("api.ValueType", ValueType_name, ValueType_value) + proto.RegisterEnum("api.DocEventType", DocEventType_name, DocEventType_value) + proto.RegisterType((*ChangePack)(nil), "api.ChangePack") + proto.RegisterType((*Change)(nil), "api.Change") + proto.RegisterType((*ChangeID)(nil), "api.ChangeID") + proto.RegisterType((*Operation)(nil), "api.Operation") + proto.RegisterType((*Operation_Set)(nil), "api.Operation.Set") + proto.RegisterType((*Operation_Add)(nil), "api.Operation.Add") + proto.RegisterType((*Operation_Move)(nil), "api.Operation.Move") + proto.RegisterType((*Operation_Remove)(nil), "api.Operation.Remove") + proto.RegisterType((*Operation_Edit)(nil), "api.Operation.Edit") + proto.RegisterMapType((map[string]*TimeTicket)(nil), "api.Operation.Edit.CreatedAtMapByActorEntry") + proto.RegisterType((*Operation_Select)(nil), "api.Operation.Select") + proto.RegisterType((*Operation_RichEdit)(nil), "api.Operation.RichEdit") + proto.RegisterMapType((map[string]string)(nil), "api.Operation.RichEdit.AttributesEntry") + proto.RegisterMapType((map[string]*TimeTicket)(nil), "api.Operation.RichEdit.CreatedAtMapByActorEntry") + proto.RegisterType((*Operation_Style)(nil), "api.Operation.Style") + proto.RegisterMapType((map[string]string)(nil), "api.Operation.Style.AttributesEntry") + proto.RegisterType((*Operation_Increase)(nil), "api.Operation.Increase") + proto.RegisterType((*JSONElementSimple)(nil), "api.JSONElementSimple") + proto.RegisterType((*JSONElement)(nil), "api.JSONElement") + proto.RegisterType((*JSONElement_JSONObject)(nil), "api.JSONElement.JSONObject") + proto.RegisterType((*JSONElement_JSONArray)(nil), "api.JSONElement.JSONArray") + proto.RegisterType((*JSONElement_Primitive)(nil), "api.JSONElement.Primitive") + proto.RegisterType((*JSONElement_Text)(nil), "api.JSONElement.Text") + proto.RegisterType((*JSONElement_RichText)(nil), "api.JSONElement.RichText") + proto.RegisterType((*JSONElement_Counter)(nil), "api.JSONElement.Counter") + proto.RegisterType((*RHTNode)(nil), "api.RHTNode") + proto.RegisterType((*RGANode)(nil), "api.RGANode") + proto.RegisterType((*TextNode)(nil), "api.TextNode") + proto.RegisterType((*RichTextNodeAttr)(nil), "api.RichTextNodeAttr") + proto.RegisterType((*RichTextNode)(nil), "api.RichTextNode") + proto.RegisterMapType((map[string]*RichTextNodeAttr)(nil), "api.RichTextNode.AttributesEntry") + proto.RegisterType((*TextNodeID)(nil), "api.TextNodeID") + proto.RegisterType((*DocumentSummary)(nil), "api.DocumentSummary") + proto.RegisterType((*Metadata)(nil), "api.Metadata") + proto.RegisterMapType((map[string]string)(nil), "api.Metadata.DataEntry") + proto.RegisterType((*Client)(nil), "api.Client") + proto.RegisterType((*Clients)(nil), "api.Clients") + proto.RegisterType((*DocumentKey)(nil), "api.DocumentKey") + proto.RegisterType((*Checkpoint)(nil), "api.Checkpoint") + proto.RegisterType((*TextNodePos)(nil), "api.TextNodePos") + proto.RegisterType((*TimeTicket)(nil), "api.TimeTicket") + proto.RegisterType((*DocEvent)(nil), "api.DocEvent") +} + +func init() { proto.RegisterFile("resources.proto", fileDescriptor_cf1b13971fe4c19d) } + +var fileDescriptor_cf1b13971fe4c19d = []byte{ + // 1958 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcd, 0x8f, 0xdb, 0xc6, + 0x15, 0x17, 0x25, 0xea, 0x83, 0x4f, 0xda, 0x5d, 0xee, 0xf8, 0x4b, 0x51, 0x93, 0xed, 0x86, 0x8d, + 0xeb, 0x8f, 0x18, 0x6b, 0xc3, 0x69, 0x9a, 0x20, 0x41, 0x0b, 0x50, 0x1f, 0x58, 0x6d, 0xba, 0x2b, + 0x19, 0x23, 0xba, 0x6e, 0x4e, 0x04, 0x97, 0x1c, 0x67, 0xe9, 0x95, 0x48, 0x99, 0xa4, 0x16, 0xd6, + 0xa5, 0xb7, 0xf6, 0xd0, 0x6b, 0x7b, 0xe8, 0xb9, 0x28, 0x90, 0x7f, 0xa0, 0x40, 0x0f, 0x2d, 0xe0, + 0x43, 0x2f, 0xb9, 0xa5, 0x3d, 0x16, 0x05, 0x8a, 0xc2, 0xfd, 0x0f, 0xfa, 0x17, 0x14, 0xf3, 0x41, + 0x8a, 0x94, 0xb4, 0x96, 0x85, 0x4d, 0x91, 0x45, 0x6f, 0x9c, 0x79, 0xbf, 0xf7, 0x35, 0xef, 0xcd, + 0xbc, 0xc7, 0x19, 0xd8, 0x0a, 0x48, 0xe8, 0x4f, 0x02, 0x9b, 0x84, 0x7b, 0xe3, 0xc0, 0x8f, 0x7c, + 0x54, 0xb0, 0xc6, 0xae, 0xf6, 0x1f, 0x09, 0xa0, 0x75, 0x62, 0x79, 0x5f, 0x90, 0x47, 0x96, 0x7d, + 0x8a, 0x3e, 0x80, 0x9a, 0xe3, 0xdb, 0x93, 0x11, 0xf1, 0x22, 0xf3, 0x94, 0x4c, 0xeb, 0xd2, 0xae, + 0x74, 0xbb, 0xfa, 0x50, 0xdd, 0xb3, 0xc6, 0xee, 0x5e, 0x5b, 0x10, 0x7e, 0x42, 0xa6, 0xb8, 0xea, + 0xcc, 0x06, 0xe8, 0x3e, 0x80, 0x7d, 0x42, 0xec, 0xd3, 0xb1, 0xef, 0x7a, 0x51, 0x3d, 0xcf, 0x58, + 0xb6, 0x18, 0x4b, 0x2b, 0x99, 0xc6, 0x29, 0x08, 0x6a, 0x40, 0x25, 0xf4, 0xac, 0x71, 0x78, 0xe2, + 0x47, 0xf5, 0xc2, 0xae, 0x74, 0xbb, 0x86, 0x93, 0x31, 0xba, 0x09, 0x65, 0x9b, 0xd9, 0x13, 0xd6, + 0xe5, 0xdd, 0xc2, 0xed, 0xea, 0xc3, 0xaa, 0x90, 0x44, 0xe7, 0x70, 0x4c, 0x43, 0x9f, 0xc2, 0xf6, + 0xc8, 0xf5, 0xcc, 0x70, 0xea, 0xd9, 0xc4, 0x31, 0x23, 0xd7, 0x3e, 0x25, 0x51, 0xbd, 0x98, 0x52, + 0x6d, 0xb8, 0x23, 0x62, 0xb0, 0x69, 0xbc, 0x35, 0x72, 0xbd, 0x01, 0x03, 0xf2, 0x09, 0xed, 0x39, + 0x94, 0xb8, 0x3c, 0xf4, 0x0e, 0xe4, 0x5d, 0x47, 0x78, 0xb9, 0x91, 0x52, 0x74, 0xd0, 0xc6, 0x79, + 0xd7, 0x41, 0x75, 0x28, 0x8f, 0x48, 0x18, 0x5a, 0x5f, 0x10, 0xe6, 0x96, 0x82, 0xe3, 0x21, 0xda, + 0x03, 0xf0, 0xc7, 0x24, 0xb0, 0x22, 0xd7, 0xf7, 0xc2, 0x7a, 0x81, 0x59, 0xba, 0xc9, 0x04, 0xf4, + 0xe3, 0x69, 0x9c, 0x42, 0x68, 0xbf, 0x90, 0xa0, 0x12, 0x8b, 0x46, 0xef, 0x00, 0xd8, 0x43, 0x97, + 0xae, 0x71, 0x48, 0x9e, 0x33, 0xed, 0x1b, 0x58, 0xe1, 0x33, 0x03, 0xf2, 0x1c, 0xbd, 0x0b, 0x10, + 0x92, 0xe0, 0x8c, 0x04, 0x8c, 0x4c, 0x15, 0xcb, 0xcd, 0xfc, 0x03, 0x09, 0x2b, 0x7c, 0x96, 0x42, + 0xde, 0x86, 0xf2, 0xd0, 0x1a, 0x8d, 0xfd, 0x80, 0x2f, 0x20, 0xa7, 0xc7, 0x53, 0xe8, 0x2d, 0xa8, + 0x58, 0x76, 0xe4, 0x07, 0xa6, 0xeb, 0xd4, 0x65, 0xb6, 0xbe, 0x65, 0x36, 0x3e, 0x70, 0xb4, 0xaf, + 0xae, 0x83, 0x92, 0x58, 0x88, 0xbe, 0x0f, 0x85, 0x90, 0x44, 0xc2, 0x7f, 0x94, 0x35, 0x7f, 0x6f, + 0x40, 0xa2, 0x6e, 0x0e, 0x53, 0x00, 0xc5, 0x59, 0x8e, 0x23, 0x42, 0x3b, 0x8f, 0xd3, 0x1d, 0x87, + 0xe2, 0x2c, 0xc7, 0x41, 0x77, 0x40, 0x1e, 0xf9, 0x67, 0x84, 0xd9, 0x54, 0x7d, 0x78, 0x65, 0x0e, + 0x78, 0xe4, 0x9f, 0x91, 0x6e, 0x0e, 0x33, 0x08, 0xba, 0x0f, 0xa5, 0x80, 0x30, 0xb0, 0xcc, 0xc0, + 0xd7, 0xe6, 0xc0, 0x98, 0x11, 0xbb, 0x39, 0x2c, 0x60, 0x54, 0x36, 0x71, 0xdc, 0x38, 0xc8, 0xf3, + 0xb2, 0x3b, 0x8e, 0x4b, 0xad, 0x65, 0x10, 0x2a, 0x3b, 0x24, 0x43, 0x62, 0x47, 0xf5, 0xd2, 0x52, + 0xd9, 0x03, 0x46, 0xa4, 0xb2, 0x39, 0x0c, 0xfd, 0x10, 0x94, 0xc0, 0xb5, 0x4f, 0x4c, 0xa6, 0xa0, + 0xcc, 0x78, 0x6e, 0xcc, 0xdb, 0xe3, 0xda, 0x27, 0x42, 0x49, 0x25, 0x10, 0xdf, 0xe8, 0x1e, 0x14, + 0xc3, 0x68, 0x3a, 0x24, 0xf5, 0x0a, 0xe3, 0xb9, 0x3a, 0xaf, 0x87, 0xd2, 0xba, 0x39, 0xcc, 0x41, + 0xe8, 0x43, 0xa8, 0xb8, 0x9e, 0x1d, 0x10, 0x2b, 0x24, 0x75, 0x65, 0xa9, 0x92, 0x03, 0x41, 0xa6, + 0x4a, 0x62, 0x68, 0xe3, 0x0f, 0x12, 0x14, 0x06, 0x24, 0xa2, 0x29, 0x3f, 0xb6, 0x02, 0x9a, 0x35, + 0x94, 0x10, 0x11, 0xc7, 0xb4, 0xe2, 0xd0, 0x2d, 0xa6, 0x3c, 0x47, 0xb6, 0x38, 0x50, 0x8f, 0x90, + 0x0a, 0x05, 0xba, 0x9f, 0x79, 0x16, 0xd3, 0x4f, 0x6a, 0xfb, 0x99, 0x35, 0x9c, 0xc4, 0xc1, 0xba, + 0xce, 0x44, 0x7c, 0x36, 0xe8, 0xf7, 0x3a, 0x43, 0x42, 0x77, 0xf6, 0xc0, 0x1d, 0x8d, 0x87, 0x04, + 0x73, 0x10, 0x7a, 0x00, 0x55, 0xf2, 0x82, 0xd8, 0x13, 0xa1, 0x56, 0x5e, 0xae, 0x16, 0x62, 0x8c, + 0x1e, 0x35, 0xfe, 0x21, 0x41, 0x41, 0x77, 0x9c, 0x8b, 0x99, 0xfd, 0x11, 0x6c, 0x8d, 0x03, 0x72, + 0x96, 0x66, 0xcd, 0x2f, 0x67, 0xdd, 0xa0, 0xb8, 0x19, 0xe3, 0xff, 0xda, 0xbb, 0x7f, 0x4a, 0x20, + 0xd3, 0x7c, 0xfe, 0x96, 0xdc, 0xdb, 0x03, 0x48, 0xf1, 0x14, 0x96, 0xf3, 0x28, 0x76, 0x82, 0x5f, + 0xdf, 0xc1, 0x2f, 0x25, 0x28, 0xf1, 0x3d, 0x78, 0x31, 0x17, 0xb3, 0x96, 0xe6, 0xd7, 0xb5, 0xb4, + 0xb0, 0xda, 0xd2, 0xdf, 0x14, 0x40, 0x66, 0xbb, 0xf1, 0x42, 0x76, 0xbe, 0x07, 0xf2, 0xd3, 0xc0, + 0x1f, 0x09, 0x0b, 0x79, 0xc5, 0x33, 0xc8, 0x8b, 0xa8, 0xe7, 0x3b, 0xe4, 0x91, 0x1f, 0x62, 0x46, + 0x45, 0xbb, 0x90, 0x8f, 0x7c, 0x61, 0xd4, 0x22, 0x26, 0x1f, 0xf9, 0xe8, 0x18, 0x6e, 0xcc, 0xb4, + 0x9b, 0x23, 0x6b, 0x6c, 0x1e, 0x4f, 0x4d, 0x76, 0xfa, 0x8a, 0x7a, 0x76, 0x6f, 0xc9, 0xc9, 0xb5, + 0x97, 0xd8, 0x71, 0x64, 0x8d, 0x9b, 0x53, 0x9d, 0xc2, 0x3b, 0x5e, 0x14, 0x4c, 0xf1, 0x15, 0x7b, + 0x91, 0x42, 0xcb, 0x92, 0xed, 0x7b, 0x11, 0xf1, 0xf8, 0x69, 0xa8, 0xe0, 0x78, 0x38, 0xbf, 0x7a, + 0xa5, 0xd5, 0xab, 0xf7, 0x04, 0xea, 0xe7, 0x29, 0x8f, 0x0f, 0x0d, 0x69, 0x76, 0x68, 0xdc, 0x8c, + 0xb7, 0xd5, 0x39, 0x81, 0xe4, 0xd4, 0x4f, 0xf2, 0x1f, 0x4b, 0x8d, 0x97, 0x12, 0x94, 0xf8, 0x41, + 0x7b, 0x39, 0x02, 0xb3, 0xfe, 0x16, 0xf8, 0xbd, 0x0c, 0x95, 0xf8, 0xd8, 0xbf, 0x1c, 0x3e, 0x3c, + 0x5d, 0x95, 0x5c, 0x0f, 0xce, 0xa9, 0x5a, 0xdf, 0x58, 0x82, 0xed, 0x03, 0x58, 0x51, 0x14, 0xb8, + 0xc7, 0x93, 0x88, 0x84, 0xf5, 0x12, 0x53, 0x7a, 0xeb, 0x3c, 0xa5, 0x7a, 0x82, 0xe4, 0xba, 0x52, + 0xac, 0xf3, 0xe1, 0x28, 0x7f, 0x8b, 0x99, 0xfa, 0x23, 0xd8, 0x9a, 0xb3, 0x74, 0x89, 0xbc, 0xab, + 0x69, 0x79, 0x4a, 0x9a, 0xfd, 0x2f, 0x79, 0x28, 0xb2, 0x4a, 0x7f, 0x39, 0x72, 0xa4, 0x9d, 0x89, + 0x10, 0x4f, 0x8b, 0xf7, 0x96, 0x35, 0x26, 0xeb, 0x84, 0xa7, 0xb8, 0x3a, 0x3c, 0x17, 0x5c, 0xc5, + 0x2f, 0x25, 0xa8, 0xc4, 0xed, 0xcf, 0xc5, 0x16, 0xf2, 0x5e, 0x36, 0xf2, 0xeb, 0x95, 0xfe, 0xd5, + 0xf5, 0xa6, 0x59, 0x02, 0xf9, 0xd8, 0x77, 0xa6, 0xda, 0xdf, 0x25, 0xd8, 0x5e, 0x10, 0x3b, 0x57, + 0xef, 0xa4, 0x95, 0xf5, 0xee, 0x2e, 0x54, 0x68, 0x91, 0x7d, 0x5d, 0x75, 0x2c, 0x33, 0x00, 0xaf, + 0xa5, 0xbc, 0x19, 0x7e, 0x6d, 0xd5, 0x17, 0x10, 0x3d, 0x42, 0x1a, 0xc8, 0xd1, 0x74, 0xcc, 0x3b, + 0xec, 0x4d, 0xf1, 0x7b, 0xf2, 0x53, 0xea, 0xb5, 0x31, 0x1d, 0x13, 0xcc, 0x68, 0xb3, 0x88, 0x14, + 0xd9, 0x8f, 0x02, 0x1f, 0x68, 0xbf, 0xaa, 0x41, 0x35, 0xe5, 0x1b, 0xfa, 0x31, 0x54, 0x9f, 0x85, + 0xbe, 0x67, 0xfa, 0xc7, 0xcf, 0x68, 0x5b, 0xcd, 0xdd, 0xfa, 0xce, 0xfc, 0xca, 0xb2, 0xef, 0x3e, + 0x83, 0x74, 0x73, 0x18, 0x28, 0x07, 0x1f, 0xa1, 0x4f, 0x81, 0x8d, 0x4c, 0x2b, 0x08, 0xac, 0xa9, + 0xf0, 0xb3, 0xb1, 0x94, 0x5d, 0xa7, 0x88, 0x6e, 0x0e, 0x2b, 0x14, 0xcf, 0x06, 0xe8, 0x13, 0x50, + 0xc6, 0x81, 0x3b, 0x72, 0x23, 0x37, 0xf9, 0xb5, 0x58, 0xe4, 0x7d, 0x14, 0x23, 0x28, 0x6f, 0x02, + 0x47, 0xef, 0x83, 0x1c, 0x91, 0x17, 0x51, 0xe6, 0x27, 0x23, 0xcd, 0x46, 0x77, 0x0f, 0xfd, 0x6f, + 0xa0, 0x20, 0xf4, 0xb1, 0xf8, 0x0d, 0x60, 0x1c, 0x3c, 0xe5, 0xdf, 0x5a, 0xe0, 0xa0, 0xa7, 0x9b, + 0xe0, 0x62, 0x3f, 0x02, 0xf4, 0x1b, 0xfd, 0x80, 0x1e, 0x98, 0x13, 0x2f, 0x22, 0x81, 0xa8, 0xb9, + 0xf5, 0x05, 0xbe, 0x16, 0xa7, 0x77, 0x73, 0x38, 0x86, 0x36, 0xfe, 0x2c, 0x01, 0xcc, 0x96, 0x0c, + 0x69, 0x50, 0xf4, 0x7c, 0x87, 0x84, 0x75, 0x89, 0x6d, 0xda, 0x1a, 0x13, 0x81, 0xbb, 0x06, 0xdd, + 0xdd, 0x98, 0x93, 0xd6, 0x6e, 0xa7, 0xd2, 0xe9, 0x55, 0x58, 0x2b, 0xbd, 0xe4, 0x55, 0xe9, 0xd5, + 0xf8, 0x93, 0x04, 0x4a, 0x12, 0xb2, 0x73, 0xac, 0xdf, 0xd7, 0x2f, 0xab, 0xf5, 0x7f, 0x93, 0x40, + 0x49, 0x92, 0x26, 0xd9, 0x2a, 0xd2, 0x9b, 0x6c, 0x95, 0x7c, 0x6a, 0xab, 0xac, 0xdd, 0x8a, 0xa7, + 0x7d, 0x92, 0xd7, 0xf2, 0xa9, 0xb8, 0xd2, 0xa7, 0x3f, 0x4a, 0x20, 0xb3, 0x7c, 0xfc, 0x5e, 0x36, + 0x18, 0x1b, 0x99, 0x4a, 0x71, 0x19, 0xa3, 0xf1, 0x52, 0xe2, 0xbd, 0x16, 0xb3, 0xfe, 0x56, 0xd6, + 0xfa, 0x6d, 0x9e, 0x4a, 0x82, 0x7a, 0x59, 0x3d, 0xf8, 0x5a, 0x82, 0xb2, 0xd8, 0xe3, 0xff, 0x1f, + 0xd9, 0x44, 0x0b, 0x5d, 0x93, 0x16, 0xba, 0x7d, 0x28, 0x8b, 0x53, 0x68, 0x49, 0x45, 0xbf, 0x0b, + 0x65, 0xc2, 0x4f, 0xb8, 0x4c, 0xe7, 0x92, 0x3a, 0xf9, 0x70, 0x0c, 0xd0, 0x9e, 0x40, 0x59, 0x1c, + 0x08, 0x68, 0x17, 0x64, 0x8f, 0x9e, 0xb2, 0xbc, 0x92, 0x64, 0x0f, 0x0b, 0x46, 0x59, 0x4b, 0xf0, + 0xef, 0x24, 0xa8, 0xc4, 0xb9, 0x81, 0xbe, 0x9b, 0xba, 0xd3, 0xdb, 0xca, 0x24, 0xbe, 0xb8, 0xd5, + 0x5b, 0xda, 0x84, 0xac, 0x5d, 0x5c, 0xef, 0x43, 0xd5, 0xf5, 0x42, 0x93, 0xfd, 0xbf, 0x8b, 0x7b, + 0xb6, 0x25, 0xfa, 0x14, 0xd7, 0x0b, 0x1f, 0x05, 0xe4, 0xec, 0xc0, 0xd1, 0x9e, 0x81, 0x9a, 0xce, + 0x61, 0xda, 0x2c, 0xbd, 0x69, 0x87, 0x44, 0x8d, 0x9b, 0x8c, 0x9d, 0x55, 0x69, 0x21, 0x20, 0x7a, + 0xa4, 0xbd, 0xcc, 0x43, 0x2d, 0xad, 0x6c, 0xf5, 0xa2, 0xe8, 0x99, 0xb6, 0x31, 0xcf, 0x36, 0xde, + 0xbb, 0x0b, 0x1b, 0xef, 0xb5, 0x3d, 0xe3, 0xd5, 0xf4, 0x9d, 0xcb, 0x39, 0xeb, 0x2a, 0xaf, 0xbb, + 0xae, 0xc5, 0x55, 0xeb, 0xda, 0x30, 0xde, 0xa4, 0xf1, 0x7c, 0x3f, 0xdb, 0x14, 0x5e, 0x5b, 0xf0, + 0x8c, 0x8a, 0x48, 0xf5, 0xa3, 0x9a, 0x01, 0x30, 0x53, 0xb7, 0x76, 0x57, 0x77, 0x1d, 0x4a, 0xfe, + 0xd3, 0xa7, 0x21, 0xe1, 0xb9, 0x5b, 0xc4, 0x62, 0xa4, 0x59, 0xb0, 0x15, 0x5f, 0xa3, 0x0f, 0x26, + 0xa3, 0x91, 0x15, 0x4c, 0xd1, 0x66, 0x12, 0x19, 0x85, 0x05, 0x42, 0x9b, 0xdd, 0xd4, 0x2d, 0xbb, + 0x79, 0x67, 0xde, 0xcc, 0x5f, 0xa0, 0x2b, 0xb3, 0x0b, 0x74, 0xed, 0x97, 0x12, 0x54, 0x8e, 0x48, + 0x64, 0x39, 0x56, 0x64, 0xd1, 0x90, 0xd8, 0x43, 0xdf, 0x3e, 0x65, 0xf2, 0x8b, 0x98, 0x0f, 0x68, + 0x53, 0x44, 0xa9, 0x22, 0xca, 0xfc, 0x12, 0x32, 0x66, 0xd9, 0x6b, 0x5b, 0x91, 0xc5, 0x63, 0xcb, + 0x40, 0x8d, 0x8f, 0x40, 0x49, 0xa6, 0xd6, 0xe9, 0xe8, 0xb5, 0x16, 0x94, 0x5a, 0xec, 0x4e, 0x3b, + 0xe5, 0x62, 0x8d, 0xb9, 0x78, 0x07, 0x2a, 0x23, 0xa1, 0x4e, 0xf8, 0xb9, 0x91, 0xb1, 0x01, 0x27, + 0x64, 0xed, 0x01, 0x94, 0xb9, 0x90, 0x90, 0xbd, 0x0c, 0xf0, 0x4f, 0x51, 0x17, 0xc4, 0xcb, 0x00, + 0x9b, 0xc3, 0x31, 0x4d, 0x3b, 0x80, 0x6a, 0x6a, 0xbd, 0xd0, 0x0e, 0x80, 0xed, 0x0f, 0x87, 0xc4, + 0xa6, 0x3f, 0x3e, 0xc2, 0xf0, 0xd4, 0x0c, 0x5d, 0xca, 0xf8, 0x2d, 0x43, 0xb8, 0x90, 0x8c, 0xb5, + 0x1e, 0xc0, 0xec, 0x05, 0x63, 0xee, 0x5a, 0x5e, 0x5a, 0x76, 0x2d, 0x9f, 0xbd, 0xd8, 0xcf, 0xcf, + 0x5d, 0xec, 0x6b, 0x3f, 0x87, 0x6a, 0xea, 0x6f, 0xed, 0x9b, 0x4a, 0x2a, 0x74, 0x0b, 0xb6, 0x02, + 0x32, 0xb4, 0x68, 0x1f, 0x63, 0x0a, 0x40, 0x81, 0x01, 0x36, 0xe3, 0xe9, 0x3e, 0xcf, 0x3e, 0x1b, + 0x60, 0x26, 0x39, 0xfd, 0x86, 0x20, 0x2d, 0xbe, 0x21, 0xbc, 0x0d, 0x8a, 0x43, 0x86, 0xb4, 0x3d, + 0x22, 0x41, 0xec, 0x49, 0x32, 0x91, 0x79, 0x61, 0x28, 0x64, 0x5f, 0x18, 0x7e, 0x2d, 0x41, 0xa5, + 0xed, 0xdb, 0x9d, 0x33, 0x1a, 0xf9, 0x9b, 0x99, 0x42, 0xb8, 0x1d, 0x67, 0x33, 0x23, 0xa6, 0x6a, + 0xe1, 0x1d, 0x50, 0xc6, 0x93, 0xe3, 0xa1, 0x1b, 0x9e, 0x08, 0x65, 0x73, 0xc1, 0x9d, 0x51, 0xd1, + 0x87, 0xb0, 0x91, 0x7e, 0xa1, 0x8a, 0xdf, 0x5e, 0x16, 0x37, 0x4a, 0x2d, 0xf5, 0x44, 0x15, 0xde, + 0xfd, 0x5a, 0x02, 0x25, 0xa9, 0xc0, 0xa8, 0x02, 0x72, 0xef, 0xf1, 0xe1, 0xa1, 0x9a, 0x43, 0x55, + 0x28, 0x37, 0xfb, 0xfd, 0xc3, 0x8e, 0xde, 0x53, 0x25, 0x3a, 0x38, 0xe8, 0x19, 0x9d, 0xfd, 0x0e, + 0x56, 0xf3, 0x14, 0x73, 0xd8, 0xef, 0xed, 0xab, 0x05, 0x04, 0x50, 0x6a, 0xf7, 0x1f, 0x37, 0x0f, + 0x3b, 0xaa, 0x4c, 0xbf, 0x07, 0x06, 0x3e, 0xe8, 0xed, 0xab, 0x45, 0xa4, 0x40, 0xb1, 0xf9, 0xb9, + 0xd1, 0x19, 0xa8, 0x25, 0x0a, 0x6e, 0xeb, 0x46, 0x47, 0x2d, 0xa3, 0x2d, 0xfe, 0xe3, 0x64, 0xf6, + 0x9b, 0x9f, 0x75, 0x5a, 0x86, 0x5a, 0x41, 0x9b, 0xbc, 0xc7, 0x37, 0x75, 0x8c, 0xf5, 0xcf, 0x55, + 0x85, 0x42, 0x8d, 0xce, 0xcf, 0x0c, 0x15, 0xd0, 0x06, 0x28, 0xf8, 0xa0, 0xd5, 0x35, 0xd9, 0xb0, + 0x4a, 0x39, 0x85, 0x76, 0xb3, 0xd5, 0x33, 0xd4, 0x1a, 0xaa, 0x41, 0x85, 0x5a, 0xc0, 0x46, 0x1b, + 0x54, 0x0e, 0xb7, 0x82, 0x8d, 0x37, 0xef, 0x9e, 0x42, 0x2d, 0xbd, 0x92, 0xe8, 0x1a, 0x6c, 0xb7, + 0xfb, 0xad, 0xc7, 0x47, 0x9d, 0x9e, 0x31, 0x30, 0x5b, 0x5d, 0xbd, 0xb7, 0xdf, 0x69, 0xab, 0xb9, + 0xec, 0xf4, 0x13, 0xdd, 0x68, 0x75, 0x3b, 0x6d, 0x55, 0x42, 0x37, 0xe0, 0xca, 0x6c, 0xfa, 0x71, + 0x2f, 0x26, 0xe4, 0xd1, 0x55, 0x50, 0x8f, 0x3a, 0x86, 0xde, 0xd6, 0x0d, 0x3d, 0x91, 0x52, 0x68, + 0xaa, 0x5f, 0xbd, 0xda, 0x91, 0xfe, 0xfa, 0x6a, 0x47, 0xfa, 0xd7, 0xab, 0x1d, 0xe9, 0xb7, 0xff, + 0xde, 0xc9, 0x1d, 0x97, 0xd8, 0x23, 0xe2, 0x07, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xcc, + 0xdd, 0x1b, 0x57, 0x1c, 0x00, 0x00, +} + +func (m *ChangePack) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChangePack) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChangePack) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.MinSyncedTicket != nil { + { + size, err := m.MinSyncedTicket.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Changes) > 0 { + for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Snapshot) > 0 { + i -= len(m.Snapshot) + copy(dAtA[i:], m.Snapshot) + i = encodeVarintResources(dAtA, i, uint64(len(m.Snapshot))) + i-- + dAtA[i] = 0x1a + } + if m.Checkpoint != nil { + { + size, err := m.Checkpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.DocumentKey != nil { + { + size, err := m.DocumentKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Change) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Change) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Change) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Operations) > 0 { + for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintResources(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x12 + } + if m.Id != nil { + { + size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChangeID) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChangeID) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChangeID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ActorId) > 0 { + i -= len(m.ActorId) + copy(dAtA[i:], m.ActorId) + i = encodeVarintResources(dAtA, i, uint64(len(m.ActorId))) + i-- + dAtA[i] = 0x22 + } + if m.Lamport != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Lamport)) + i-- + dAtA[i] = 0x18 + } + if m.ServerSeq != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.ServerSeq)) + i-- + dAtA[i] = 0x10 + } + if m.ClientSeq != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.ClientSeq)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Operation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Body != nil { + { + size := m.Body.Size() + i -= size + if _, err := m.Body.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Operation_Set_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Set_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Set != nil { + { + size, err := m.Set.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Operation_Add_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Add_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Add != nil { + { + size, err := m.Add.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Operation_Move_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Move_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Move != nil { + { + size, err := m.Move.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Operation_Remove_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Remove_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Remove != nil { + { + size, err := m.Remove.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *Operation_Edit_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Edit_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Edit != nil { + { + size, err := m.Edit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *Operation_Select_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Select_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Select != nil { + { + size, err := m.Select.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *Operation_RichEdit_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_RichEdit_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RichEdit != nil { + { + size, err := m.RichEdit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *Operation_Style_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Style_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Style != nil { + { + size, err := m.Style.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + return len(dAtA) - i, nil +} +func (m *Operation_Increase_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Increase_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Increase != nil { + { + size, err := m.Increase.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + return len(dAtA) - i, nil +} +func (m *Operation_Set) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation_Set) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Set) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecutedAt != nil { + { + size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintResources(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x12 + } + if m.ParentCreatedAt != nil { + { + size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Operation_Add) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation_Add) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Add) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecutedAt != nil { + { + size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.PrevCreatedAt != nil { + { + size, err := m.PrevCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCreatedAt != nil { + { + size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Operation_Move) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation_Move) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Move) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecutedAt != nil { + { + size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.PrevCreatedAt != nil { + { + size, err := m.PrevCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCreatedAt != nil { + { + size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Operation_Remove) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation_Remove) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Remove) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecutedAt != nil { + { + size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCreatedAt != nil { + { + size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Operation_Edit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation_Edit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Edit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecutedAt != nil { + { + size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = encodeVarintResources(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x2a + } + if len(m.CreatedAtMapByActor) > 0 { + for k := range m.CreatedAtMapByActor { + v := m.CreatedAtMapByActor[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintResources(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintResources(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if m.To != nil { + { + size, err := m.To.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.From != nil { + { + size, err := m.From.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCreatedAt != nil { + { + size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Operation_Select) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation_Select) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Select) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecutedAt != nil { + { + size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.To != nil { + { + size, err := m.To.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.From != nil { + { + size, err := m.From.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCreatedAt != nil { + { + size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Operation_RichEdit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation_RichEdit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_RichEdit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecutedAt != nil { + { + size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.Attributes) > 0 { + for k := range m.Attributes { + v := m.Attributes[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintResources(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintResources(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintResources(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = encodeVarintResources(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x2a + } + if len(m.CreatedAtMapByActor) > 0 { + for k := range m.CreatedAtMapByActor { + v := m.CreatedAtMapByActor[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintResources(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintResources(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if m.To != nil { + { + size, err := m.To.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.From != nil { + { + size, err := m.From.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCreatedAt != nil { + { + size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Operation_Style) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation_Style) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Style) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecutedAt != nil { + { + size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Attributes) > 0 { + for k := range m.Attributes { + v := m.Attributes[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintResources(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintResources(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintResources(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if m.To != nil { + { + size, err := m.To.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.From != nil { + { + size, err := m.From.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCreatedAt != nil { + { + size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Operation_Increase) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation_Increase) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation_Increase) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecutedAt != nil { + { + size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCreatedAt != nil { + { + size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *JSONElementSimple) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JSONElementSimple) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElementSimple) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintResources(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x2a + } + if m.Type != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x20 + } + if m.RemovedAt != nil { + { + size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.MovedAt != nil { + { + size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *JSONElement) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JSONElement) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Body != nil { + { + size := m.Body.Size() + i -= size + if _, err := m.Body.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *JSONElement_JsonObject) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_JsonObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.JsonObject != nil { + { + size, err := m.JsonObject.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *JSONElement_JsonArray) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_JsonArray) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.JsonArray != nil { + { + size, err := m.JsonArray.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *JSONElement_Primitive_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_Primitive_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Primitive != nil { + { + size, err := m.Primitive.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *JSONElement_Text_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_Text_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Text != nil { + { + size, err := m.Text.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *JSONElement_RichText_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_RichText_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RichText != nil { + { + size, err := m.RichText.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *JSONElement_Counter_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_Counter_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Counter != nil { + { + size, err := m.Counter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *JSONElement_JSONObject) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JSONElement_JSONObject) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_JSONObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RemovedAt != nil { + { + size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.MovedAt != nil { + { + size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Nodes) > 0 { + for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *JSONElement_JSONArray) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JSONElement_JSONArray) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_JSONArray) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RemovedAt != nil { + { + size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.MovedAt != nil { + { + size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Nodes) > 0 { + for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *JSONElement_Primitive) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JSONElement_Primitive) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_Primitive) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RemovedAt != nil { + { + size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.MovedAt != nil { + { + size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintResources(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *JSONElement_Text) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JSONElement_Text) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_Text) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RemovedAt != nil { + { + size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.MovedAt != nil { + { + size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Nodes) > 0 { + for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *JSONElement_RichText) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JSONElement_RichText) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_RichText) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RemovedAt != nil { + { + size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.MovedAt != nil { + { + size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Nodes) > 0 { + for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *JSONElement_Counter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JSONElement_Counter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JSONElement_Counter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RemovedAt != nil { + { + size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.MovedAt != nil { + { + size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintResources(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *RHTNode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RHTNode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RHTNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Element != nil { + { + size, err := m.Element.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintResources(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RGANode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RGANode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RGANode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Element != nil { + { + size, err := m.Element.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Next != nil { + { + size, err := m.Next.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TextNode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TextNode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TextNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.InsPrevId != nil { + { + size, err := m.InsPrevId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.RemovedAt != nil { + { + size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintResources(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if m.Id != nil { + { + size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RichTextNodeAttr) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RichTextNodeAttr) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RichTextNodeAttr) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.UpdatedAt != nil { + { + size, err := m.UpdatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintResources(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintResources(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RichTextNode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RichTextNode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RichTextNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.InsPrevId != nil { + { + size, err := m.InsPrevId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.RemovedAt != nil { + { + size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintResources(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a + } + if len(m.Attributes) > 0 { + for k := range m.Attributes { + v := m.Attributes[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintResources(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintResources(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.Id != nil { + { + size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TextNodeID) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TextNodeID) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TextNodeID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Offset != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Offset)) + i-- + dAtA[i] = 0x10 + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DocumentSummary) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DocumentSummary) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DocumentSummary) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Snapshot) > 0 { + i -= len(m.Snapshot) + copy(dAtA[i:], m.Snapshot) + i = encodeVarintResources(dAtA, i, uint64(len(m.Snapshot))) + i-- + dAtA[i] = 0x1a + } + if m.Key != nil { + { + size, err := m.Key.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintResources(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Metadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Data) > 0 { + for k := range m.Data { + v := m.Data[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintResources(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintResources(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintResources(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.Clock != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Client) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Client) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Client) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintResources(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Clients) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Clients) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Clients) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Clients) > 0 { + for iNdEx := len(m.Clients) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Clients[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DocumentKey) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DocumentKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DocumentKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Document) > 0 { + i -= len(m.Document) + copy(dAtA[i:], m.Document) + i = encodeVarintResources(dAtA, i, uint64(len(m.Document))) + i-- + dAtA[i] = 0x12 + } + if len(m.Collection) > 0 { + i -= len(m.Collection) + copy(dAtA[i:], m.Collection) + i = encodeVarintResources(dAtA, i, uint64(len(m.Collection))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Checkpoint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Checkpoint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Checkpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ClientSeq != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.ClientSeq)) + i-- + dAtA[i] = 0x10 + } + if m.ServerSeq != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.ServerSeq)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TextNodePos) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TextNodePos) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TextNodePos) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RelativeOffset != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.RelativeOffset)) + i-- + dAtA[i] = 0x18 + } + if m.Offset != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Offset)) + i-- + dAtA[i] = 0x10 + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TimeTicket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TimeTicket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TimeTicket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ActorId) > 0 { + i -= len(m.ActorId) + copy(dAtA[i:], m.ActorId) + i = encodeVarintResources(dAtA, i, uint64(len(m.ActorId))) + i-- + dAtA[i] = 0x1a + } + if m.Delimiter != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Delimiter)) + i-- + dAtA[i] = 0x10 + } + if m.Lamport != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Lamport)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DocEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DocEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.DocumentKeys) > 0 { + for iNdEx := len(m.DocumentKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DocumentKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Publisher != nil { + { + size, err := m.Publisher.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintResources(dAtA []byte, offset int, v uint64) int { + offset -= sovResources(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ChangePack) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DocumentKey != nil { + l = m.DocumentKey.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.Checkpoint != nil { + l = m.Checkpoint.Size() + n += 1 + l + sovResources(uint64(l)) + } + l = len(m.Snapshot) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if len(m.Changes) > 0 { + for _, e := range m.Changes { + l = e.Size() + n += 1 + l + sovResources(uint64(l)) + } + } + if m.MinSyncedTicket != nil { + l = m.MinSyncedTicket.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Change) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovResources(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if len(m.Operations) > 0 { + for _, e := range m.Operations { + l = e.Size() + n += 1 + l + sovResources(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ChangeID) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ClientSeq != 0 { + n += 1 + sovResources(uint64(m.ClientSeq)) + } + if m.ServerSeq != 0 { + n += 1 + sovResources(uint64(m.ServerSeq)) + } + if m.Lamport != 0 { + n += 1 + sovResources(uint64(m.Lamport)) + } + l = len(m.ActorId) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Body != nil { + n += m.Body.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation_Set_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Set != nil { + l = m.Set.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *Operation_Add_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Add != nil { + l = m.Add.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *Operation_Move_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Move != nil { + l = m.Move.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *Operation_Remove_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Remove != nil { + l = m.Remove.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *Operation_Edit_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Edit != nil { + l = m.Edit.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *Operation_Select_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Select != nil { + l = m.Select.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *Operation_RichEdit_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RichEdit != nil { + l = m.RichEdit.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *Operation_Style_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Style != nil { + l = m.Style.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *Operation_Increase_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Increase != nil { + l = m.Increase.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *Operation_Set) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCreatedAt != nil { + l = m.ParentCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.ExecutedAt != nil { + l = m.ExecutedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation_Add) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCreatedAt != nil { + l = m.ParentCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.PrevCreatedAt != nil { + l = m.PrevCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.ExecutedAt != nil { + l = m.ExecutedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation_Move) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCreatedAt != nil { + l = m.ParentCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.PrevCreatedAt != nil { + l = m.PrevCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.ExecutedAt != nil { + l = m.ExecutedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation_Remove) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCreatedAt != nil { + l = m.ParentCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.ExecutedAt != nil { + l = m.ExecutedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation_Edit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCreatedAt != nil { + l = m.ParentCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.From != nil { + l = m.From.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.To != nil { + l = m.To.Size() + n += 1 + l + sovResources(uint64(l)) + } + if len(m.CreatedAtMapByActor) > 0 { + for k, v := range m.CreatedAtMapByActor { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovResources(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovResources(uint64(len(k))) + l + n += mapEntrySize + 1 + sovResources(uint64(mapEntrySize)) + } + } + l = len(m.Content) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.ExecutedAt != nil { + l = m.ExecutedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation_Select) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCreatedAt != nil { + l = m.ParentCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.From != nil { + l = m.From.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.To != nil { + l = m.To.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.ExecutedAt != nil { + l = m.ExecutedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation_RichEdit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCreatedAt != nil { + l = m.ParentCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.From != nil { + l = m.From.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.To != nil { + l = m.To.Size() + n += 1 + l + sovResources(uint64(l)) + } + if len(m.CreatedAtMapByActor) > 0 { + for k, v := range m.CreatedAtMapByActor { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovResources(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovResources(uint64(len(k))) + l + n += mapEntrySize + 1 + sovResources(uint64(mapEntrySize)) + } + } + l = len(m.Content) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovResources(uint64(len(k))) + 1 + len(v) + sovResources(uint64(len(v))) + n += mapEntrySize + 1 + sovResources(uint64(mapEntrySize)) + } + } + if m.ExecutedAt != nil { + l = m.ExecutedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation_Style) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCreatedAt != nil { + l = m.ParentCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.From != nil { + l = m.From.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.To != nil { + l = m.To.Size() + n += 1 + l + sovResources(uint64(l)) + } + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovResources(uint64(len(k))) + 1 + len(v) + sovResources(uint64(len(v))) + n += mapEntrySize + 1 + sovResources(uint64(mapEntrySize)) + } + } + if m.ExecutedAt != nil { + l = m.ExecutedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Operation_Increase) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCreatedAt != nil { + l = m.ParentCreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.ExecutedAt != nil { + l = m.ExecutedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *JSONElementSimple) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.MovedAt != nil { + l = m.MovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.RemovedAt != nil { + l = m.RemovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.Type != 0 { + n += 1 + sovResources(uint64(m.Type)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *JSONElement) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Body != nil { + n += m.Body.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *JSONElement_JsonObject) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.JsonObject != nil { + l = m.JsonObject.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *JSONElement_JsonArray) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.JsonArray != nil { + l = m.JsonArray.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *JSONElement_Primitive_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Primitive != nil { + l = m.Primitive.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *JSONElement_Text_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Text != nil { + l = m.Text.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *JSONElement_RichText_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RichText != nil { + l = m.RichText.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *JSONElement_Counter_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Counter != nil { + l = m.Counter.Size() + n += 1 + l + sovResources(uint64(l)) + } + return n +} +func (m *JSONElement_JSONObject) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Nodes) > 0 { + for _, e := range m.Nodes { + l = e.Size() + n += 1 + l + sovResources(uint64(l)) + } + } + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.MovedAt != nil { + l = m.MovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.RemovedAt != nil { + l = m.RemovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *JSONElement_JSONArray) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Nodes) > 0 { + for _, e := range m.Nodes { + l = e.Size() + n += 1 + l + sovResources(uint64(l)) + } + } + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.MovedAt != nil { + l = m.MovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.RemovedAt != nil { + l = m.RemovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *JSONElement_Primitive) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovResources(uint64(m.Type)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.MovedAt != nil { + l = m.MovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.RemovedAt != nil { + l = m.RemovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *JSONElement_Text) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Nodes) > 0 { + for _, e := range m.Nodes { + l = e.Size() + n += 1 + l + sovResources(uint64(l)) + } + } + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.MovedAt != nil { + l = m.MovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.RemovedAt != nil { + l = m.RemovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *JSONElement_RichText) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Nodes) > 0 { + for _, e := range m.Nodes { + l = e.Size() + n += 1 + l + sovResources(uint64(l)) + } + } + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.MovedAt != nil { + l = m.MovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.RemovedAt != nil { + l = m.RemovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *JSONElement_Counter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovResources(uint64(m.Type)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.MovedAt != nil { + l = m.MovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.RemovedAt != nil { + l = m.RemovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RHTNode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.Element != nil { + l = m.Element.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RGANode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Next != nil { + l = m.Next.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.Element != nil { + l = m.Element.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TextNode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovResources(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.RemovedAt != nil { + l = m.RemovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.InsPrevId != nil { + l = m.InsPrevId.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RichTextNodeAttr) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.UpdatedAt != nil { + l = m.UpdatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RichTextNode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovResources(uint64(l)) + } + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovResources(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovResources(uint64(len(k))) + l + n += mapEntrySize + 1 + sovResources(uint64(mapEntrySize)) + } + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.RemovedAt != nil { + l = m.RemovedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.InsPrevId != nil { + l = m.InsPrevId.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TextNodeID) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.Offset != 0 { + n += 1 + sovResources(uint64(m.Offset)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DocumentSummary) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.Key != nil { + l = m.Key.Size() + n += 1 + l + sovResources(uint64(l)) + } + l = len(m.Snapshot) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovResources(uint64(m.Clock)) + } + if len(m.Data) > 0 { + for k, v := range m.Data { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovResources(uint64(len(k))) + 1 + len(v) + sovResources(uint64(len(v))) + n += mapEntrySize + 1 + sovResources(uint64(mapEntrySize)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Client) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Clients) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Clients) > 0 { + for _, e := range m.Clients { + l = e.Size() + n += 1 + l + sovResources(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DocumentKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Collection) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + l = len(m.Document) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Checkpoint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ServerSeq != 0 { + n += 1 + sovResources(uint64(m.ServerSeq)) + } + if m.ClientSeq != 0 { + n += 1 + sovResources(uint64(m.ClientSeq)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TextNodePos) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovResources(uint64(l)) + } + if m.Offset != 0 { + n += 1 + sovResources(uint64(m.Offset)) + } + if m.RelativeOffset != 0 { + n += 1 + sovResources(uint64(m.RelativeOffset)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TimeTicket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Lamport != 0 { + n += 1 + sovResources(uint64(m.Lamport)) + } + if m.Delimiter != 0 { + n += 1 + sovResources(uint64(m.Delimiter)) + } + l = len(m.ActorId) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DocEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovResources(uint64(m.Type)) + } + if m.Publisher != nil { + l = m.Publisher.Size() + n += 1 + l + sovResources(uint64(l)) + } + if len(m.DocumentKeys) > 0 { + for _, e := range m.DocumentKeys { + l = e.Size() + n += 1 + l + sovResources(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovResources(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozResources(x uint64) (n int) { + return sovResources(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ChangePack) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChangePack: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChangePack: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DocumentKey == nil { + m.DocumentKey = &DocumentKey{} + } + if err := m.DocumentKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Checkpoint == nil { + m.Checkpoint = &Checkpoint{} + } + if err := m.Checkpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Snapshot = append(m.Snapshot[:0], dAtA[iNdEx:postIndex]...) + if m.Snapshot == nil { + m.Snapshot = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Changes = append(m.Changes, &Change{}) + if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinSyncedTicket", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MinSyncedTicket == nil { + m.MinSyncedTicket = &TimeTicket{} + } + if err := m.MinSyncedTicket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Change) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Change: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Change: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &ChangeID{} + } + if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operations = append(m.Operations, &Operation{}) + if err := m.Operations[len(m.Operations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChangeID) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChangeID: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChangeID: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientSeq", wireType) + } + m.ClientSeq = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClientSeq |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerSeq", wireType) + } + m.ServerSeq = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ServerSeq |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Lamport", wireType) + } + m.Lamport = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Lamport |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActorId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActorId = append(m.ActorId[:0], dAtA[iNdEx:postIndex]...) + if m.ActorId == nil { + m.ActorId = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Operation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Operation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Operation_Set{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &Operation_Set_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Add", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Operation_Add{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &Operation_Add_{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Move", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Operation_Move{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &Operation_Move_{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Remove", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Operation_Remove{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &Operation_Remove_{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Edit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Operation_Edit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &Operation_Edit_{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Select", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Operation_Select{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &Operation_Select_{v} + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RichEdit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Operation_RichEdit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &Operation_RichEdit_{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Style", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Operation_Style{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &Operation_Style_{v} + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Increase", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Operation_Increase{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &Operation_Increase_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation_Set) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Set: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Set: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentCreatedAt == nil { + m.ParentCreatedAt = &TimeTicket{} + } + if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &JSONElementSimple{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutedAt == nil { + m.ExecutedAt = &TimeTicket{} + } + if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation_Add) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Add: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Add: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentCreatedAt == nil { + m.ParentCreatedAt = &TimeTicket{} + } + if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrevCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PrevCreatedAt == nil { + m.PrevCreatedAt = &TimeTicket{} + } + if err := m.PrevCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &JSONElementSimple{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutedAt == nil { + m.ExecutedAt = &TimeTicket{} + } + if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation_Move) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Move: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Move: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentCreatedAt == nil { + m.ParentCreatedAt = &TimeTicket{} + } + if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrevCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PrevCreatedAt == nil { + m.PrevCreatedAt = &TimeTicket{} + } + if err := m.PrevCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutedAt == nil { + m.ExecutedAt = &TimeTicket{} + } + if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation_Remove) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Remove: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Remove: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentCreatedAt == nil { + m.ParentCreatedAt = &TimeTicket{} + } + if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutedAt == nil { + m.ExecutedAt = &TimeTicket{} + } + if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation_Edit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Edit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Edit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentCreatedAt == nil { + m.ParentCreatedAt = &TimeTicket{} + } + if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.From == nil { + m.From = &TextNodePos{} + } + if err := m.From.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.To == nil { + m.To = &TextNodePos{} + } + if err := m.To.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAtMapByActor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAtMapByActor == nil { + m.CreatedAtMapByActor = make(map[string]*TimeTicket) + } + var mapkey string + var mapvalue *TimeTicket + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthResources + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthResources + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &TimeTicket{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.CreatedAtMapByActor[mapkey] = mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutedAt == nil { + m.ExecutedAt = &TimeTicket{} + } + if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation_Select) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Select: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Select: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentCreatedAt == nil { + m.ParentCreatedAt = &TimeTicket{} + } + if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.From == nil { + m.From = &TextNodePos{} + } + if err := m.From.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.To == nil { + m.To = &TextNodePos{} + } + if err := m.To.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutedAt == nil { + m.ExecutedAt = &TimeTicket{} + } + if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation_RichEdit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RichEdit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RichEdit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentCreatedAt == nil { + m.ParentCreatedAt = &TimeTicket{} + } + if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.From == nil { + m.From = &TextNodePos{} + } + if err := m.From.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.To == nil { + m.To = &TextNodePos{} + } + if err := m.To.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAtMapByActor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAtMapByActor == nil { + m.CreatedAtMapByActor = make(map[string]*TimeTicket) + } + var mapkey string + var mapvalue *TimeTicket + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthResources + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthResources + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &TimeTicket{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.CreatedAtMapByActor[mapkey] = mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Attributes == nil { + m.Attributes = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Attributes[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutedAt == nil { + m.ExecutedAt = &TimeTicket{} + } + if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation_Style) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Style: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Style: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentCreatedAt == nil { + m.ParentCreatedAt = &TimeTicket{} + } + if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.From == nil { + m.From = &TextNodePos{} + } + if err := m.From.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.To == nil { + m.To = &TextNodePos{} + } + if err := m.To.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Attributes == nil { + m.Attributes = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Attributes[mapkey] = mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutedAt == nil { + m.ExecutedAt = &TimeTicket{} + } + if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation_Increase) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Increase: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Increase: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentCreatedAt == nil { + m.ParentCreatedAt = &TimeTicket{} + } + if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &JSONElementSimple{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutedAt == nil { + m.ExecutedAt = &TimeTicket{} + } + if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JSONElementSimple) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JSONElementSimple: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JSONElementSimple: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MovedAt == nil { + m.MovedAt = &TimeTicket{} + } + if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RemovedAt == nil { + m.RemovedAt = &TimeTicket{} + } + if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= ValueType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JSONElement) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JSONElement: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JSONElement: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JsonObject", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &JSONElement_JSONObject{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &JSONElement_JsonObject{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JsonArray", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &JSONElement_JSONArray{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &JSONElement_JsonArray{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Primitive", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &JSONElement_Primitive{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &JSONElement_Primitive_{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &JSONElement_Text{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &JSONElement_Text_{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RichText", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &JSONElement_RichText{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &JSONElement_RichText_{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &JSONElement_Counter{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &JSONElement_Counter_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JSONElement_JSONObject) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JSONObject: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JSONObject: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nodes = append(m.Nodes, &RHTNode{}) + if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MovedAt == nil { + m.MovedAt = &TimeTicket{} + } + if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RemovedAt == nil { + m.RemovedAt = &TimeTicket{} + } + if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JSONElement_JSONArray) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JSONArray: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JSONArray: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nodes = append(m.Nodes, &RGANode{}) + if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MovedAt == nil { + m.MovedAt = &TimeTicket{} + } + if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RemovedAt == nil { + m.RemovedAt = &TimeTicket{} + } + if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JSONElement_Primitive) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Primitive: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Primitive: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= ValueType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MovedAt == nil { + m.MovedAt = &TimeTicket{} + } + if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RemovedAt == nil { + m.RemovedAt = &TimeTicket{} + } + if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JSONElement_Text) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Text: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Text: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nodes = append(m.Nodes, &TextNode{}) + if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MovedAt == nil { + m.MovedAt = &TimeTicket{} + } + if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RemovedAt == nil { + m.RemovedAt = &TimeTicket{} + } + if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JSONElement_RichText) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RichText: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RichText: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nodes = append(m.Nodes, &RichTextNode{}) + if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MovedAt == nil { + m.MovedAt = &TimeTicket{} + } + if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RemovedAt == nil { + m.RemovedAt = &TimeTicket{} + } + if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JSONElement_Counter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Counter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Counter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= ValueType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MovedAt == nil { + m.MovedAt = &TimeTicket{} + } + if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RemovedAt == nil { + m.RemovedAt = &TimeTicket{} + } + if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RHTNode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RHTNode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RHTNode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Element", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Element == nil { + m.Element = &JSONElement{} + } + if err := m.Element.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RGANode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RGANode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RGANode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Next", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Next == nil { + m.Next = &RGANode{} + } + if err := m.Next.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Element", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Element == nil { + m.Element = &JSONElement{} + } + if err := m.Element.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TextNode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TextNode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TextNode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &TextNodeID{} + } + if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RemovedAt == nil { + m.RemovedAt = &TimeTicket{} + } + if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InsPrevId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InsPrevId == nil { + m.InsPrevId = &TextNodeID{} + } + if err := m.InsPrevId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RichTextNodeAttr) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RichTextNodeAttr: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RichTextNodeAttr: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UpdatedAt == nil { + m.UpdatedAt = &TimeTicket{} + } + if err := m.UpdatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RichTextNode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RichTextNode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RichTextNode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &TextNodeID{} + } + if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Attributes == nil { + m.Attributes = make(map[string]*RichTextNodeAttr) + } + var mapkey string + var mapvalue *RichTextNodeAttr + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthResources + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthResources + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &RichTextNodeAttr{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Attributes[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RemovedAt == nil { + m.RemovedAt = &TimeTicket{} + } + if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InsPrevId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InsPrevId == nil { + m.InsPrevId = &TextNodeID{} + } + if err := m.InsPrevId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TextNodeID) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TextNodeID: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TextNodeID: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + } + m.Offset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Offset |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DocumentSummary) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DocumentSummary: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DocumentSummary: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Key == nil { + m.Key = &DocumentKey{} + } + if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Snapshot = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Metadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Data[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Client) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Client: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Client: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) + if m.Id == nil { + m.Id = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Clients) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Clients: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Clients: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Clients", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Clients = append(m.Clients, &Client{}) + if err := m.Clients[len(m.Clients)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DocumentKey) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DocumentKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DocumentKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Collection", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Collection = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Document = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Checkpoint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Checkpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Checkpoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerSeq", wireType) + } + m.ServerSeq = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ServerSeq |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientSeq", wireType) + } + m.ClientSeq = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClientSeq |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TextNodePos) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TextNodePos: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TextNodePos: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &TimeTicket{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + } + m.Offset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Offset |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RelativeOffset", wireType) + } + m.RelativeOffset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RelativeOffset |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TimeTicket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TimeTicket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TimeTicket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Lamport", wireType) + } + m.Lamport = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Lamport |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Delimiter", wireType) + } + m.Delimiter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Delimiter |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActorId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActorId = append(m.ActorId[:0], dAtA[iNdEx:postIndex]...) + if m.ActorId == nil { + m.ActorId = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DocEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DocEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DocEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= DocEventType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Publisher == nil { + m.Publisher = &Client{} + } + if err := m.Publisher.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentKeys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DocumentKeys = append(m.DocumentKeys, &DocumentKey{}) + if err := m.DocumentKeys[len(m.DocumentKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipResources(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowResources + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowResources + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowResources + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthResources + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupResources + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthResources + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthResources = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowResources = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupResources = fmt.Errorf("proto: unexpected end of group") +) diff --git a/api/resources.proto b/api/resources.proto new file mode 100644 index 000000000..17ea44c42 --- /dev/null +++ b/api/resources.proto @@ -0,0 +1,291 @@ +/* + * Copyright 2022 The Yorkie Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +syntax = "proto3"; + +package api; + +///////////////////////////////////////// +// Messages for ChangePack // +///////////////////////////////////////// + +message ChangePack { + DocumentKey document_key = 1; + Checkpoint checkpoint = 2; + bytes snapshot = 3; + repeated Change changes = 4; + TimeTicket min_synced_ticket = 5; +} + +message Change { + ChangeID id = 1; + string message = 2; + repeated Operation operations = 3; +} + +message ChangeID { + uint32 client_seq = 1; + uint64 server_seq = 2 [jstype = JS_STRING]; + uint64 lamport = 3 [jstype = JS_STRING]; + bytes actor_id = 4; +} + +message Operation { + message Set { + TimeTicket parent_created_at = 1; + string key = 2; + JSONElementSimple value = 3; + TimeTicket executed_at = 4; + } + message Add { + TimeTicket parent_created_at = 1; + TimeTicket prev_created_at = 2; + JSONElementSimple value = 3; + TimeTicket executed_at = 4; + } + message Move { + TimeTicket parent_created_at = 1; + TimeTicket prev_created_at = 2; + TimeTicket created_at = 3; + TimeTicket executed_at = 4; + } + message Remove { + TimeTicket parent_created_at = 1; + TimeTicket created_at = 2; + TimeTicket executed_at = 3; + } + message Edit { + TimeTicket parent_created_at = 1; + TextNodePos from = 2; + TextNodePos to = 3; + map created_at_map_by_actor = 4; + string content = 5; + TimeTicket executed_at = 6; + } + message Select { + TimeTicket parent_created_at = 1; + TextNodePos from = 2; + TextNodePos to = 3; + TimeTicket executed_at = 4; + } + message RichEdit { + TimeTicket parent_created_at = 1; + TextNodePos from = 2; + TextNodePos to = 3; + map created_at_map_by_actor = 4; + string content = 5; + map attributes = 6; + TimeTicket executed_at = 7; + } + message Style { + TimeTicket parent_created_at = 1; + TextNodePos from = 2; + TextNodePos to = 3; + map attributes = 4; + TimeTicket executed_at = 5; + } + message Increase { + TimeTicket parent_created_at = 1; + JSONElementSimple value = 2; + TimeTicket executed_at = 3; + } + + oneof body { + Set set = 1; + Add add = 2; + Move move = 3; + Remove remove = 4; + Edit edit = 5; + Select select = 6; + RichEdit rich_edit = 7; + Style style = 8; + Increase increase = 9; + } +} + +message JSONElementSimple { + TimeTicket created_at = 1; + TimeTicket moved_at = 2; + TimeTicket removed_at = 3; + ValueType type = 4; + bytes value = 5; +} + +///////////////////////////////////////// +// Messages for JSON // +///////////////////////////////////////// + +message JSONElement { + message JSONObject { + repeated RHTNode nodes = 1; + TimeTicket created_at = 2; + TimeTicket moved_at = 3; + TimeTicket removed_at = 4; + } + message JSONArray { + repeated RGANode nodes = 1; + TimeTicket created_at = 2; + TimeTicket moved_at = 3; + TimeTicket removed_at = 4; + } + message Primitive { + ValueType type = 1; + bytes value = 2; + TimeTicket created_at = 3; + TimeTicket moved_at = 4; + TimeTicket removed_at = 5; + } + message Text { + repeated TextNode nodes = 1; + TimeTicket created_at = 2; + TimeTicket moved_at = 3; + TimeTicket removed_at = 4; + } + message RichText { + repeated RichTextNode nodes = 1; + TimeTicket created_at = 2; + TimeTicket moved_at = 3; + TimeTicket removed_at = 4; + } + message Counter { + ValueType type = 1; + bytes value = 2; + TimeTicket created_at = 3; + TimeTicket moved_at = 4; + TimeTicket removed_at = 5; + } + + oneof Body { + JSONObject json_object = 1; + JSONArray json_array = 2; + Primitive primitive = 3; + Text text = 4; + RichText rich_text = 5; + Counter counter = 6; + } +} + +message RHTNode { + string key = 1; + JSONElement element = 2; +} + +message RGANode { + RGANode next = 1; + JSONElement element = 2; +} + +message TextNode { + TextNodeID id = 1; + string value = 2; + TimeTicket removed_at = 3; + TextNodeID ins_prev_id = 4; +} + +message RichTextNodeAttr { + string key = 1; + string value = 2; + TimeTicket updated_at = 3; +} + +message RichTextNode { + TextNodeID id = 1; + map attributes = 2; + string value = 3; + TimeTicket removed_at = 4; + TextNodeID ins_prev_id = 5; +} + +message TextNodeID { + TimeTicket created_at = 1; + int32 offset = 2; +} + +///////////////////////////////////////// +// Messages for Common // +///////////////////////////////////////// + +message DocumentSummary { + string id = 1; + DocumentKey key = 2; + string snapshot = 3; +} + +message Metadata { + int32 clock = 1; + map data = 2; +} + +message Client { + bytes id = 1; + Metadata metadata = 2; +} + +message Clients { + repeated Client clients = 1; +} + +message DocumentKey { + string collection = 1; + string document = 2; +} + +message Checkpoint { + uint64 server_seq = 1 [jstype = JS_STRING]; + uint32 client_seq = 2; +} + +message TextNodePos { + TimeTicket created_at = 1; + int32 offset = 2; + int32 relative_offset = 3; +} + +message TimeTicket { + uint64 lamport = 1 [jstype = JS_STRING]; + uint32 delimiter = 2; + bytes actor_id = 3; +} + +enum ValueType { + NULL = 0; + BOOLEAN = 1; + INTEGER = 2; + LONG = 3; + DOUBLE = 4; + STRING = 5; + BYTES = 6; + DATE = 7; + JSON_OBJECT = 8; + JSON_ARRAY = 9; + TEXT = 10; + RICH_TEXT = 11; + INTEGER_CNT = 12; + LONG_CNT = 13; + DOUBLE_CNT = 14; +} + +enum DocEventType { + DOCUMENTS_CHANGED = 0; + DOCUMENTS_WATCHED = 1; + DOCUMENTS_UNWATCHED = 2; + METADATA_CHANGED = 3; +} + +message DocEvent { + DocEventType type = 1; + Client publisher = 2; + repeated DocumentKey document_keys = 3; +} diff --git a/api/yorkie.pb.go b/api/yorkie.pb.go index 06c050a58..c8e9faf15 100644 --- a/api/yorkie.pb.go +++ b/api/yorkie.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: api/yorkie.proto +// source: yorkie.proto package api @@ -26,195 +26,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package -type ValueType int32 - -const ( - ValueType_NULL ValueType = 0 - ValueType_BOOLEAN ValueType = 1 - ValueType_INTEGER ValueType = 2 - ValueType_LONG ValueType = 3 - ValueType_DOUBLE ValueType = 4 - ValueType_STRING ValueType = 5 - ValueType_BYTES ValueType = 6 - ValueType_DATE ValueType = 7 - ValueType_JSON_OBJECT ValueType = 8 - ValueType_JSON_ARRAY ValueType = 9 - ValueType_TEXT ValueType = 10 - ValueType_RICH_TEXT ValueType = 11 - ValueType_INTEGER_CNT ValueType = 12 - ValueType_LONG_CNT ValueType = 13 - ValueType_DOUBLE_CNT ValueType = 14 -) - -var ValueType_name = map[int32]string{ - 0: "NULL", - 1: "BOOLEAN", - 2: "INTEGER", - 3: "LONG", - 4: "DOUBLE", - 5: "STRING", - 6: "BYTES", - 7: "DATE", - 8: "JSON_OBJECT", - 9: "JSON_ARRAY", - 10: "TEXT", - 11: "RICH_TEXT", - 12: "INTEGER_CNT", - 13: "LONG_CNT", - 14: "DOUBLE_CNT", -} - -var ValueType_value = map[string]int32{ - "NULL": 0, - "BOOLEAN": 1, - "INTEGER": 2, - "LONG": 3, - "DOUBLE": 4, - "STRING": 5, - "BYTES": 6, - "DATE": 7, - "JSON_OBJECT": 8, - "JSON_ARRAY": 9, - "TEXT": 10, - "RICH_TEXT": 11, - "INTEGER_CNT": 12, - "LONG_CNT": 13, - "DOUBLE_CNT": 14, -} - -func (x ValueType) String() string { - return proto.EnumName(ValueType_name, int32(x)) -} - -func (ValueType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{0} -} - -type DocEventType int32 - -const ( - DocEventType_DOCUMENTS_CHANGED DocEventType = 0 - DocEventType_DOCUMENTS_WATCHED DocEventType = 1 - DocEventType_DOCUMENTS_UNWATCHED DocEventType = 2 - DocEventType_METADATA_CHANGED DocEventType = 3 -) - -var DocEventType_name = map[int32]string{ - 0: "DOCUMENTS_CHANGED", - 1: "DOCUMENTS_WATCHED", - 2: "DOCUMENTS_UNWATCHED", - 3: "METADATA_CHANGED", -} - -var DocEventType_value = map[string]int32{ - "DOCUMENTS_CHANGED": 0, - "DOCUMENTS_WATCHED": 1, - "DOCUMENTS_UNWATCHED": 2, - "METADATA_CHANGED": 3, -} - -func (x DocEventType) String() string { - return proto.EnumName(DocEventType_name, int32(x)) -} - -func (DocEventType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{1} -} - -type BroadcastEventRequest struct { - PublisherId []byte `protobuf:"bytes,1,opt,name=publisher_id,json=publisherId,proto3" json:"publisher_id,omitempty"` - Event *DocEvent `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BroadcastEventRequest) Reset() { *m = BroadcastEventRequest{} } -func (m *BroadcastEventRequest) String() string { return proto.CompactTextString(m) } -func (*BroadcastEventRequest) ProtoMessage() {} -func (*BroadcastEventRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{0} -} -func (m *BroadcastEventRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BroadcastEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BroadcastEventRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BroadcastEventRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_BroadcastEventRequest.Merge(m, src) -} -func (m *BroadcastEventRequest) XXX_Size() int { - return m.Size() -} -func (m *BroadcastEventRequest) XXX_DiscardUnknown() { - xxx_messageInfo_BroadcastEventRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_BroadcastEventRequest proto.InternalMessageInfo - -func (m *BroadcastEventRequest) GetPublisherId() []byte { - if m != nil { - return m.PublisherId - } - return nil -} - -func (m *BroadcastEventRequest) GetEvent() *DocEvent { - if m != nil { - return m.Event - } - return nil -} - -type BroadcastEventResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BroadcastEventResponse) Reset() { *m = BroadcastEventResponse{} } -func (m *BroadcastEventResponse) String() string { return proto.CompactTextString(m) } -func (*BroadcastEventResponse) ProtoMessage() {} -func (*BroadcastEventResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{1} -} -func (m *BroadcastEventResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BroadcastEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BroadcastEventResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BroadcastEventResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_BroadcastEventResponse.Merge(m, src) -} -func (m *BroadcastEventResponse) XXX_Size() int { - return m.Size() -} -func (m *BroadcastEventResponse) XXX_DiscardUnknown() { - xxx_messageInfo_BroadcastEventResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_BroadcastEventResponse proto.InternalMessageInfo - type ActivateClientRequest struct { ClientKey string `protobuf:"bytes,1,opt,name=client_key,json=clientKey,proto3" json:"client_key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -226,7 +37,7 @@ func (m *ActivateClientRequest) Reset() { *m = ActivateClientRequest{} } func (m *ActivateClientRequest) String() string { return proto.CompactTextString(m) } func (*ActivateClientRequest) ProtoMessage() {} func (*ActivateClientRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{2} + return fileDescriptor_b60f170c5b305914, []int{0} } func (m *ActivateClientRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -274,7 +85,7 @@ func (m *ActivateClientResponse) Reset() { *m = ActivateClientResponse{} func (m *ActivateClientResponse) String() string { return proto.CompactTextString(m) } func (*ActivateClientResponse) ProtoMessage() {} func (*ActivateClientResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{3} + return fileDescriptor_b60f170c5b305914, []int{1} } func (m *ActivateClientResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -328,7 +139,7 @@ func (m *DeactivateClientRequest) Reset() { *m = DeactivateClientRequest func (m *DeactivateClientRequest) String() string { return proto.CompactTextString(m) } func (*DeactivateClientRequest) ProtoMessage() {} func (*DeactivateClientRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{4} + return fileDescriptor_b60f170c5b305914, []int{2} } func (m *DeactivateClientRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -375,7 +186,7 @@ func (m *DeactivateClientResponse) Reset() { *m = DeactivateClientRespon func (m *DeactivateClientResponse) String() string { return proto.CompactTextString(m) } func (*DeactivateClientResponse) ProtoMessage() {} func (*DeactivateClientResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{5} + return fileDescriptor_b60f170c5b305914, []int{3} } func (m *DeactivateClientResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -423,7 +234,7 @@ func (m *AttachDocumentRequest) Reset() { *m = AttachDocumentRequest{} } func (m *AttachDocumentRequest) String() string { return proto.CompactTextString(m) } func (*AttachDocumentRequest) ProtoMessage() {} func (*AttachDocumentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{6} + return fileDescriptor_b60f170c5b305914, []int{4} } func (m *AttachDocumentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -478,7 +289,7 @@ func (m *AttachDocumentResponse) Reset() { *m = AttachDocumentResponse{} func (m *AttachDocumentResponse) String() string { return proto.CompactTextString(m) } func (*AttachDocumentResponse) ProtoMessage() {} func (*AttachDocumentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{7} + return fileDescriptor_b60f170c5b305914, []int{5} } func (m *AttachDocumentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -533,7 +344,7 @@ func (m *DetachDocumentRequest) Reset() { *m = DetachDocumentRequest{} } func (m *DetachDocumentRequest) String() string { return proto.CompactTextString(m) } func (*DetachDocumentRequest) ProtoMessage() {} func (*DetachDocumentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{8} + return fileDescriptor_b60f170c5b305914, []int{6} } func (m *DetachDocumentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -588,7 +399,7 @@ func (m *DetachDocumentResponse) Reset() { *m = DetachDocumentResponse{} func (m *DetachDocumentResponse) String() string { return proto.CompactTextString(m) } func (*DetachDocumentResponse) ProtoMessage() {} func (*DetachDocumentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{9} + return fileDescriptor_b60f170c5b305914, []int{7} } func (m *DetachDocumentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -643,7 +454,7 @@ func (m *WatchDocumentsRequest) Reset() { *m = WatchDocumentsRequest{} } func (m *WatchDocumentsRequest) String() string { return proto.CompactTextString(m) } func (*WatchDocumentsRequest) ProtoMessage() {} func (*WatchDocumentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{10} + return fileDescriptor_b60f170c5b305914, []int{8} } func (m *WatchDocumentsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -700,7 +511,7 @@ func (m *WatchDocumentsResponse) Reset() { *m = WatchDocumentsResponse{} func (m *WatchDocumentsResponse) String() string { return proto.CompactTextString(m) } func (*WatchDocumentsResponse) ProtoMessage() {} func (*WatchDocumentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{11} + return fileDescriptor_b60f170c5b305914, []int{9} } func (m *WatchDocumentsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -785,7 +596,7 @@ func (m *WatchDocumentsResponse_Initialization) Reset() { *m = WatchDocu func (m *WatchDocumentsResponse_Initialization) String() string { return proto.CompactTextString(m) } func (*WatchDocumentsResponse_Initialization) ProtoMessage() {} func (*WatchDocumentsResponse_Initialization) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{11, 0} + return fileDescriptor_b60f170c5b305914, []int{9, 0} } func (m *WatchDocumentsResponse_Initialization) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -833,7 +644,7 @@ func (m *PushPullRequest) Reset() { *m = PushPullRequest{} } func (m *PushPullRequest) String() string { return proto.CompactTextString(m) } func (*PushPullRequest) ProtoMessage() {} func (*PushPullRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{12} + return fileDescriptor_b60f170c5b305914, []int{10} } func (m *PushPullRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -888,7 +699,7 @@ func (m *PushPullResponse) Reset() { *m = PushPullResponse{} } func (m *PushPullResponse) String() string { return proto.CompactTextString(m) } func (*PushPullResponse) ProtoMessage() {} func (*PushPullResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{13} + return fileDescriptor_b60f170c5b305914, []int{11} } func (m *PushPullResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -943,7 +754,7 @@ func (m *UpdateMetadataRequest) Reset() { *m = UpdateMetadataRequest{} } func (m *UpdateMetadataRequest) String() string { return proto.CompactTextString(m) } func (*UpdateMetadataRequest) ProtoMessage() {} func (*UpdateMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{14} + return fileDescriptor_b60f170c5b305914, []int{12} } func (m *UpdateMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -996,7 +807,7 @@ func (m *UpdateMetadataResponse) Reset() { *m = UpdateMetadataResponse{} func (m *UpdateMetadataResponse) String() string { return proto.CompactTextString(m) } func (*UpdateMetadataResponse) ProtoMessage() {} func (*UpdateMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15} + return fileDescriptor_b60f170c5b305914, []int{13} } func (m *UpdateMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1025,7 +836,7 @@ func (m *UpdateMetadataResponse) XXX_DiscardUnknown() { var xxx_messageInfo_UpdateMetadataResponse proto.InternalMessageInfo -type FetchHistoryRequest struct { +type ListChangesRequest struct { ClientId []byte `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` DocumentKey *DocumentKey `protobuf:"bytes,2,opt,name=document_key,json=documentKey,proto3" json:"document_key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -1033,18 +844,18 @@ type FetchHistoryRequest struct { XXX_sizecache int32 `json:"-"` } -func (m *FetchHistoryRequest) Reset() { *m = FetchHistoryRequest{} } -func (m *FetchHistoryRequest) String() string { return proto.CompactTextString(m) } -func (*FetchHistoryRequest) ProtoMessage() {} -func (*FetchHistoryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{16} +func (m *ListChangesRequest) Reset() { *m = ListChangesRequest{} } +func (m *ListChangesRequest) String() string { return proto.CompactTextString(m) } +func (*ListChangesRequest) ProtoMessage() {} +func (*ListChangesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b60f170c5b305914, []int{14} } -func (m *FetchHistoryRequest) XXX_Unmarshal(b []byte) error { +func (m *ListChangesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *FetchHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ListChangesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_FetchHistoryRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_ListChangesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1054,51 +865,51 @@ func (m *FetchHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *FetchHistoryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FetchHistoryRequest.Merge(m, src) +func (m *ListChangesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListChangesRequest.Merge(m, src) } -func (m *FetchHistoryRequest) XXX_Size() int { +func (m *ListChangesRequest) XXX_Size() int { return m.Size() } -func (m *FetchHistoryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FetchHistoryRequest.DiscardUnknown(m) +func (m *ListChangesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListChangesRequest.DiscardUnknown(m) } -var xxx_messageInfo_FetchHistoryRequest proto.InternalMessageInfo +var xxx_messageInfo_ListChangesRequest proto.InternalMessageInfo -func (m *FetchHistoryRequest) GetClientId() []byte { +func (m *ListChangesRequest) GetClientId() []byte { if m != nil { return m.ClientId } return nil } -func (m *FetchHistoryRequest) GetDocumentKey() *DocumentKey { +func (m *ListChangesRequest) GetDocumentKey() *DocumentKey { if m != nil { return m.DocumentKey } return nil } -type FetchHistoryResponse struct { +type ListChangesResponse struct { Changes []*Change `protobuf:"bytes,1,rep,name=changes,proto3" json:"changes,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *FetchHistoryResponse) Reset() { *m = FetchHistoryResponse{} } -func (m *FetchHistoryResponse) String() string { return proto.CompactTextString(m) } -func (*FetchHistoryResponse) ProtoMessage() {} -func (*FetchHistoryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{17} +func (m *ListChangesResponse) Reset() { *m = ListChangesResponse{} } +func (m *ListChangesResponse) String() string { return proto.CompactTextString(m) } +func (*ListChangesResponse) ProtoMessage() {} +func (*ListChangesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b60f170c5b305914, []int{15} } -func (m *FetchHistoryResponse) XXX_Unmarshal(b []byte) error { +func (m *ListChangesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *FetchHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ListChangesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_FetchHistoryResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_ListChangesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1108,15018 +919,1623 @@ func (m *FetchHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *FetchHistoryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_FetchHistoryResponse.Merge(m, src) +func (m *ListChangesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListChangesResponse.Merge(m, src) } -func (m *FetchHistoryResponse) XXX_Size() int { +func (m *ListChangesResponse) XXX_Size() int { return m.Size() } -func (m *FetchHistoryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_FetchHistoryResponse.DiscardUnknown(m) +func (m *ListChangesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListChangesResponse.DiscardUnknown(m) } -var xxx_messageInfo_FetchHistoryResponse proto.InternalMessageInfo +var xxx_messageInfo_ListChangesResponse proto.InternalMessageInfo -func (m *FetchHistoryResponse) GetChanges() []*Change { +func (m *ListChangesResponse) GetChanges() []*Change { if m != nil { return m.Changes } return nil } -type ChangePack struct { - DocumentKey *DocumentKey `protobuf:"bytes,1,opt,name=document_key,json=documentKey,proto3" json:"document_key,omitempty"` - Checkpoint *Checkpoint `protobuf:"bytes,2,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` - Snapshot []byte `protobuf:"bytes,3,opt,name=snapshot,proto3" json:"snapshot,omitempty"` - Changes []*Change `protobuf:"bytes,4,rep,name=changes,proto3" json:"changes,omitempty"` - MinSyncedTicket *TimeTicket `protobuf:"bytes,5,opt,name=min_synced_ticket,json=minSyncedTicket,proto3" json:"min_synced_ticket,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func init() { + proto.RegisterType((*ActivateClientRequest)(nil), "api.ActivateClientRequest") + proto.RegisterType((*ActivateClientResponse)(nil), "api.ActivateClientResponse") + proto.RegisterType((*DeactivateClientRequest)(nil), "api.DeactivateClientRequest") + proto.RegisterType((*DeactivateClientResponse)(nil), "api.DeactivateClientResponse") + proto.RegisterType((*AttachDocumentRequest)(nil), "api.AttachDocumentRequest") + proto.RegisterType((*AttachDocumentResponse)(nil), "api.AttachDocumentResponse") + proto.RegisterType((*DetachDocumentRequest)(nil), "api.DetachDocumentRequest") + proto.RegisterType((*DetachDocumentResponse)(nil), "api.DetachDocumentResponse") + proto.RegisterType((*WatchDocumentsRequest)(nil), "api.WatchDocumentsRequest") + proto.RegisterType((*WatchDocumentsResponse)(nil), "api.WatchDocumentsResponse") + proto.RegisterType((*WatchDocumentsResponse_Initialization)(nil), "api.WatchDocumentsResponse.Initialization") + proto.RegisterMapType((map[string]*Clients)(nil), "api.WatchDocumentsResponse.Initialization.PeersMapByDocEntry") + proto.RegisterType((*PushPullRequest)(nil), "api.PushPullRequest") + proto.RegisterType((*PushPullResponse)(nil), "api.PushPullResponse") + proto.RegisterType((*UpdateMetadataRequest)(nil), "api.UpdateMetadataRequest") + proto.RegisterType((*UpdateMetadataResponse)(nil), "api.UpdateMetadataResponse") + proto.RegisterType((*ListChangesRequest)(nil), "api.ListChangesRequest") + proto.RegisterType((*ListChangesResponse)(nil), "api.ListChangesResponse") +} + +func init() { proto.RegisterFile("yorkie.proto", fileDescriptor_b60f170c5b305914) } + +var fileDescriptor_b60f170c5b305914 = []byte{ + // 704 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xdd, 0x4e, 0x13, 0x41, + 0x14, 0xee, 0x16, 0xa8, 0x70, 0xb6, 0x94, 0x66, 0xb4, 0x65, 0xb3, 0x48, 0x43, 0xd6, 0x90, 0x10, + 0x2f, 0x1a, 0x52, 0x22, 0xfe, 0x44, 0x2f, 0x28, 0x98, 0x40, 0x2a, 0xa6, 0x6e, 0x30, 0xc6, 0xab, + 0x3a, 0xec, 0x4e, 0x61, 0xd2, 0xd2, 0x5d, 0x3b, 0x53, 0x92, 0xf5, 0x49, 0x7c, 0x24, 0x2e, 0x7d, + 0x01, 0x13, 0x83, 0x37, 0x3e, 0x86, 0xe9, 0xcc, 0x6c, 0xdb, 0xdd, 0x0e, 0x5a, 0x4d, 0xe0, 0xae, + 0x7b, 0xce, 0x9c, 0xef, 0x67, 0xce, 0xcc, 0x9c, 0x42, 0x3e, 0x0a, 0xfa, 0x1d, 0x4a, 0xaa, 0x61, + 0x3f, 0xe0, 0x01, 0x9a, 0xc3, 0x21, 0xb5, 0x57, 0xfa, 0x84, 0x05, 0x83, 0xbe, 0x47, 0x98, 0x8c, + 0x3a, 0xbb, 0x50, 0xda, 0xf3, 0x38, 0xbd, 0xc4, 0x9c, 0xec, 0x77, 0x29, 0xe9, 0x71, 0x97, 0x7c, + 0x1e, 0x10, 0xc6, 0xd1, 0x3a, 0x80, 0x27, 0x02, 0xad, 0x0e, 0x89, 0x2c, 0x63, 0xc3, 0xd8, 0x5a, + 0x72, 0x97, 0x64, 0xa4, 0x41, 0x22, 0xe7, 0x04, 0xca, 0xe9, 0x3a, 0x16, 0x06, 0x3d, 0x46, 0xfe, + 0x52, 0x88, 0xd6, 0x40, 0x7d, 0xb4, 0xa8, 0x6f, 0x65, 0x37, 0x8c, 0xad, 0xbc, 0xbb, 0x28, 0x03, + 0x47, 0xbe, 0xb3, 0x0b, 0xab, 0x07, 0x04, 0x6b, 0xf5, 0x24, 0xea, 0x8c, 0x54, 0xdd, 0x53, 0xb0, + 0xa6, 0xeb, 0x94, 0x9e, 0x3f, 0x16, 0xb6, 0xa1, 0xb4, 0xc7, 0x39, 0xf6, 0xce, 0x0f, 0x02, 0x6f, + 0x70, 0x31, 0x23, 0x1d, 0xda, 0x06, 0xd3, 0x3b, 0xc7, 0xbd, 0x33, 0xd2, 0x0a, 0xb1, 0xd7, 0x11, + 0x2e, 0xcc, 0xda, 0x4a, 0x15, 0x87, 0xb4, 0xba, 0x2f, 0xe2, 0x4d, 0xec, 0x75, 0x5c, 0xf0, 0x46, + 0xbf, 0x9d, 0x33, 0x28, 0xa7, 0x79, 0x66, 0x90, 0xf7, 0x1f, 0x44, 0x6d, 0x28, 0x1d, 0x90, 0x3b, + 0x30, 0x44, 0xa1, 0x9c, 0xe6, 0x99, 0xad, 0xff, 0xff, 0x4e, 0xc5, 0xa0, 0xf4, 0x01, 0xf3, 0x31, + 0x13, 0x8b, 0x2d, 0x3d, 0x82, 0x9c, 0xc4, 0x15, 0x2c, 0x66, 0xcd, 0x94, 0x28, 0xb2, 0xfd, 0x2a, + 0x85, 0x9e, 0xc0, 0xb2, 0xaf, 0x0a, 0x87, 0x82, 0x98, 0x95, 0xdd, 0x98, 0xdb, 0x32, 0x6b, 0x45, + 0xb1, 0x36, 0x86, 0x6c, 0x90, 0xc8, 0xcd, 0xfb, 0xe3, 0x0f, 0xe6, 0xfc, 0xca, 0x42, 0x39, 0xcd, + 0xaa, 0x0c, 0x9e, 0x40, 0x81, 0xf6, 0x28, 0xa7, 0xb8, 0x4b, 0xbf, 0x60, 0x4e, 0x83, 0x9e, 0xa2, + 0x7f, 0x2c, 0x20, 0xf5, 0x45, 0xd5, 0xa3, 0x44, 0xc5, 0x61, 0xc6, 0x4d, 0x61, 0xa0, 0x4d, 0x58, + 0x20, 0x97, 0x43, 0x2f, 0x72, 0x47, 0x96, 0x63, 0x7d, 0xaf, 0x87, 0xc1, 0xc3, 0x8c, 0x2b, 0xb3, + 0xf6, 0x95, 0x01, 0x85, 0x24, 0x16, 0x6a, 0x43, 0x31, 0x24, 0xa4, 0xcf, 0x5a, 0x17, 0x38, 0x6c, + 0x9d, 0x46, 0x2d, 0x3f, 0xf0, 0x2c, 0x43, 0x98, 0x7c, 0x35, 0xbb, 0xa2, 0x6a, 0x73, 0x08, 0x71, + 0x8c, 0xc3, 0x7a, 0x34, 0x24, 0xed, 0xf1, 0x7e, 0xe4, 0x2e, 0x87, 0x93, 0x31, 0xfb, 0x2d, 0xa0, + 0xe9, 0x45, 0xa8, 0x08, 0x73, 0xe3, 0x3e, 0x0f, 0x7f, 0x22, 0x07, 0x16, 0x2e, 0x71, 0x77, 0x40, + 0x94, 0x93, 0xfc, 0x44, 0x57, 0x98, 0x2b, 0x53, 0x2f, 0xb2, 0xcf, 0x8c, 0x7a, 0x0e, 0xe6, 0x4f, + 0x03, 0x3f, 0x72, 0x3e, 0xc1, 0x4a, 0x73, 0xc0, 0xce, 0x9b, 0x83, 0x6e, 0xf7, 0x96, 0x0e, 0x2b, + 0x86, 0xe2, 0x98, 0xe1, 0x76, 0xee, 0x1d, 0x83, 0xd2, 0xfb, 0xd0, 0xc7, 0x9c, 0x1c, 0x13, 0x8e, + 0x7d, 0xcc, 0xf1, 0x5d, 0x1c, 0x52, 0x0b, 0xca, 0x69, 0x52, 0xe9, 0xce, 0x69, 0x03, 0x7a, 0x43, + 0x19, 0x97, 0x62, 0xd9, 0x4c, 0xdb, 0xba, 0x03, 0xf9, 0x49, 0x0d, 0xca, 0xf4, 0xb4, 0x04, 0x73, + 0x42, 0x82, 0xf3, 0x12, 0xee, 0x27, 0x78, 0xd4, 0xe6, 0x6e, 0xc2, 0x3d, 0xb9, 0x37, 0x4c, 0x9d, + 0x44, 0x73, 0x62, 0xef, 0xdc, 0x38, 0x57, 0xfb, 0x3e, 0x0f, 0xb9, 0x8f, 0x62, 0x46, 0xa1, 0x06, + 0x14, 0x92, 0xf3, 0x04, 0xd9, 0xa2, 0x44, 0x3b, 0x9c, 0xec, 0x35, 0x6d, 0x4e, 0x79, 0xcf, 0xa0, + 0x77, 0x50, 0x4c, 0x8f, 0x03, 0xf4, 0x50, 0x1a, 0xd1, 0x4f, 0x17, 0x7b, 0xfd, 0x86, 0xec, 0x08, + 0xb2, 0x01, 0x85, 0xe4, 0x56, 0x2b, 0x7d, 0xda, 0xa6, 0x2b, 0x7d, 0x37, 0xf4, 0x46, 0x80, 0x25, + 0xa7, 0x41, 0x6c, 0x56, 0x37, 0x8a, 0x62, 0xb3, 0xda, 0xf1, 0x21, 0xc1, 0x92, 0x2f, 0xb1, 0x02, + 0xd3, 0x8e, 0x01, 0x05, 0xa6, 0x7f, 0xba, 0x9d, 0x0c, 0x3a, 0x86, 0x42, 0xf2, 0xb9, 0x50, 0x60, + 0xda, 0x07, 0x58, 0x81, 0xe9, 0xdf, 0x17, 0x27, 0xb3, 0x6d, 0xa0, 0xe7, 0xb0, 0x18, 0x5f, 0x3c, + 0xf4, 0x40, 0x2c, 0x4e, 0xdd, 0x74, 0xbb, 0x94, 0x8a, 0x8e, 0x94, 0xd4, 0xc1, 0x9c, 0x38, 0x59, + 0x68, 0x55, 0xac, 0x9b, 0x3e, 0xd3, 0xb6, 0x35, 0x9d, 0x88, 0x31, 0xea, 0xc5, 0xab, 0xeb, 0x8a, + 0xf1, 0xed, 0xba, 0x62, 0xfc, 0xb8, 0xae, 0x18, 0x5f, 0x7f, 0x56, 0x32, 0xa7, 0x39, 0xf1, 0xaf, + 0x67, 0xe7, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xad, 0x85, 0x1f, 0x1b, 0x09, 0x00, 0x00, } -func (m *ChangePack) Reset() { *m = ChangePack{} } -func (m *ChangePack) String() string { return proto.CompactTextString(m) } -func (*ChangePack) ProtoMessage() {} -func (*ChangePack) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{18} -} -func (m *ChangePack) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChangePack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChangePack.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ChangePack) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChangePack.Merge(m, src) -} -func (m *ChangePack) XXX_Size() int { - return m.Size() +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// YorkieClient is the client API for Yorkie service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type YorkieClient interface { + ActivateClient(ctx context.Context, in *ActivateClientRequest, opts ...grpc.CallOption) (*ActivateClientResponse, error) + DeactivateClient(ctx context.Context, in *DeactivateClientRequest, opts ...grpc.CallOption) (*DeactivateClientResponse, error) + UpdateMetadata(ctx context.Context, in *UpdateMetadataRequest, opts ...grpc.CallOption) (*UpdateMetadataResponse, error) + AttachDocument(ctx context.Context, in *AttachDocumentRequest, opts ...grpc.CallOption) (*AttachDocumentResponse, error) + DetachDocument(ctx context.Context, in *DetachDocumentRequest, opts ...grpc.CallOption) (*DetachDocumentResponse, error) + WatchDocuments(ctx context.Context, in *WatchDocumentsRequest, opts ...grpc.CallOption) (Yorkie_WatchDocumentsClient, error) + PushPull(ctx context.Context, in *PushPullRequest, opts ...grpc.CallOption) (*PushPullResponse, error) + ListChanges(ctx context.Context, in *ListChangesRequest, opts ...grpc.CallOption) (*ListChangesResponse, error) } -func (m *ChangePack) XXX_DiscardUnknown() { - xxx_messageInfo_ChangePack.DiscardUnknown(m) + +type yorkieClient struct { + cc *grpc.ClientConn } -var xxx_messageInfo_ChangePack proto.InternalMessageInfo +func NewYorkieClient(cc *grpc.ClientConn) YorkieClient { + return &yorkieClient{cc} +} -func (m *ChangePack) GetDocumentKey() *DocumentKey { - if m != nil { - return m.DocumentKey +func (c *yorkieClient) ActivateClient(ctx context.Context, in *ActivateClientRequest, opts ...grpc.CallOption) (*ActivateClientResponse, error) { + out := new(ActivateClientResponse) + err := c.cc.Invoke(ctx, "/api.Yorkie/ActivateClient", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *ChangePack) GetCheckpoint() *Checkpoint { - if m != nil { - return m.Checkpoint +func (c *yorkieClient) DeactivateClient(ctx context.Context, in *DeactivateClientRequest, opts ...grpc.CallOption) (*DeactivateClientResponse, error) { + out := new(DeactivateClientResponse) + err := c.cc.Invoke(ctx, "/api.Yorkie/DeactivateClient", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *ChangePack) GetSnapshot() []byte { - if m != nil { - return m.Snapshot +func (c *yorkieClient) UpdateMetadata(ctx context.Context, in *UpdateMetadataRequest, opts ...grpc.CallOption) (*UpdateMetadataResponse, error) { + out := new(UpdateMetadataResponse) + err := c.cc.Invoke(ctx, "/api.Yorkie/UpdateMetadata", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *ChangePack) GetChanges() []*Change { - if m != nil { - return m.Changes +func (c *yorkieClient) AttachDocument(ctx context.Context, in *AttachDocumentRequest, opts ...grpc.CallOption) (*AttachDocumentResponse, error) { + out := new(AttachDocumentResponse) + err := c.cc.Invoke(ctx, "/api.Yorkie/AttachDocument", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *ChangePack) GetMinSyncedTicket() *TimeTicket { - if m != nil { - return m.MinSyncedTicket +func (c *yorkieClient) DetachDocument(ctx context.Context, in *DetachDocumentRequest, opts ...grpc.CallOption) (*DetachDocumentResponse, error) { + out := new(DetachDocumentResponse) + err := c.cc.Invoke(ctx, "/api.Yorkie/DetachDocument", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -type Change struct { - Id *ChangeID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - Operations []*Operation `protobuf:"bytes,3,rep,name=operations,proto3" json:"operations,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (c *yorkieClient) WatchDocuments(ctx context.Context, in *WatchDocumentsRequest, opts ...grpc.CallOption) (Yorkie_WatchDocumentsClient, error) { + stream, err := c.cc.NewStream(ctx, &_Yorkie_serviceDesc.Streams[0], "/api.Yorkie/WatchDocuments", opts...) + if err != nil { + return nil, err + } + x := &yorkieWatchDocumentsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil } -func (m *Change) Reset() { *m = Change{} } -func (m *Change) String() string { return proto.CompactTextString(m) } -func (*Change) ProtoMessage() {} -func (*Change) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{19} +type Yorkie_WatchDocumentsClient interface { + Recv() (*WatchDocumentsResponse, error) + grpc.ClientStream } -func (m *Change) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +type yorkieWatchDocumentsClient struct { + grpc.ClientStream } -func (m *Change) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Change.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + +func (x *yorkieWatchDocumentsClient) Recv() (*WatchDocumentsResponse, error) { + m := new(WatchDocumentsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err } + return m, nil } -func (m *Change) XXX_Merge(src proto.Message) { - xxx_messageInfo_Change.Merge(m, src) -} -func (m *Change) XXX_Size() int { - return m.Size() -} -func (m *Change) XXX_DiscardUnknown() { - xxx_messageInfo_Change.DiscardUnknown(m) -} - -var xxx_messageInfo_Change proto.InternalMessageInfo -func (m *Change) GetId() *ChangeID { - if m != nil { - return m.Id +func (c *yorkieClient) PushPull(ctx context.Context, in *PushPullRequest, opts ...grpc.CallOption) (*PushPullResponse, error) { + out := new(PushPullResponse) + err := c.cc.Invoke(ctx, "/api.Yorkie/PushPull", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *Change) GetMessage() string { - if m != nil { - return m.Message +func (c *yorkieClient) ListChanges(ctx context.Context, in *ListChangesRequest, opts ...grpc.CallOption) (*ListChangesResponse, error) { + out := new(ListChangesResponse) + err := c.cc.Invoke(ctx, "/api.Yorkie/ListChanges", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -func (m *Change) GetOperations() []*Operation { - if m != nil { - return m.Operations - } - return nil +// YorkieServer is the server API for Yorkie service. +type YorkieServer interface { + ActivateClient(context.Context, *ActivateClientRequest) (*ActivateClientResponse, error) + DeactivateClient(context.Context, *DeactivateClientRequest) (*DeactivateClientResponse, error) + UpdateMetadata(context.Context, *UpdateMetadataRequest) (*UpdateMetadataResponse, error) + AttachDocument(context.Context, *AttachDocumentRequest) (*AttachDocumentResponse, error) + DetachDocument(context.Context, *DetachDocumentRequest) (*DetachDocumentResponse, error) + WatchDocuments(*WatchDocumentsRequest, Yorkie_WatchDocumentsServer) error + PushPull(context.Context, *PushPullRequest) (*PushPullResponse, error) + ListChanges(context.Context, *ListChangesRequest) (*ListChangesResponse, error) } -type ChangeID struct { - ClientSeq uint32 `protobuf:"varint,1,opt,name=client_seq,json=clientSeq,proto3" json:"client_seq,omitempty"` - ServerSeq uint64 `protobuf:"varint,2,opt,name=server_seq,json=serverSeq,proto3" json:"server_seq,omitempty"` - Lamport uint64 `protobuf:"varint,3,opt,name=lamport,proto3" json:"lamport,omitempty"` - ActorId []byte `protobuf:"bytes,4,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +// UnimplementedYorkieServer can be embedded to have forward compatible implementations. +type UnimplementedYorkieServer struct { } -func (m *ChangeID) Reset() { *m = ChangeID{} } -func (m *ChangeID) String() string { return proto.CompactTextString(m) } -func (*ChangeID) ProtoMessage() {} -func (*ChangeID) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{20} +func (*UnimplementedYorkieServer) ActivateClient(ctx context.Context, req *ActivateClientRequest) (*ActivateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ActivateClient not implemented") } -func (m *ChangeID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (*UnimplementedYorkieServer) DeactivateClient(ctx context.Context, req *DeactivateClientRequest) (*DeactivateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeactivateClient not implemented") } -func (m *ChangeID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChangeID.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (*UnimplementedYorkieServer) UpdateMetadata(ctx context.Context, req *UpdateMetadataRequest) (*UpdateMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMetadata not implemented") } -func (m *ChangeID) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChangeID.Merge(m, src) +func (*UnimplementedYorkieServer) AttachDocument(ctx context.Context, req *AttachDocumentRequest) (*AttachDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AttachDocument not implemented") } -func (m *ChangeID) XXX_Size() int { - return m.Size() +func (*UnimplementedYorkieServer) DetachDocument(ctx context.Context, req *DetachDocumentRequest) (*DetachDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DetachDocument not implemented") } -func (m *ChangeID) XXX_DiscardUnknown() { - xxx_messageInfo_ChangeID.DiscardUnknown(m) +func (*UnimplementedYorkieServer) WatchDocuments(req *WatchDocumentsRequest, srv Yorkie_WatchDocumentsServer) error { + return status.Errorf(codes.Unimplemented, "method WatchDocuments not implemented") } - -var xxx_messageInfo_ChangeID proto.InternalMessageInfo - -func (m *ChangeID) GetClientSeq() uint32 { - if m != nil { - return m.ClientSeq - } - return 0 +func (*UnimplementedYorkieServer) PushPull(ctx context.Context, req *PushPullRequest) (*PushPullResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushPull not implemented") } - -func (m *ChangeID) GetServerSeq() uint64 { - if m != nil { - return m.ServerSeq - } - return 0 +func (*UnimplementedYorkieServer) ListChanges(ctx context.Context, req *ListChangesRequest) (*ListChangesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListChanges not implemented") } -func (m *ChangeID) GetLamport() uint64 { - if m != nil { - return m.Lamport - } - return 0 +func RegisterYorkieServer(s *grpc.Server, srv YorkieServer) { + s.RegisterService(&_Yorkie_serviceDesc, srv) } -func (m *ChangeID) GetActorId() []byte { - if m != nil { - return m.ActorId +func _Yorkie_ActivateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ActivateClientRequest) + if err := dec(in); err != nil { + return nil, err } - return nil -} - -type Operation struct { - // Types that are valid to be assigned to Body: - // *Operation_Set_ - // *Operation_Add_ - // *Operation_Move_ - // *Operation_Remove_ - // *Operation_Edit_ - // *Operation_Select_ - // *Operation_RichEdit_ - // *Operation_Style_ - // *Operation_Increase_ - Body isOperation_Body `protobuf_oneof:"body"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Operation) Reset() { *m = Operation{} } -func (m *Operation) String() string { return proto.CompactTextString(m) } -func (*Operation) ProtoMessage() {} -func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21} -} -func (m *Operation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + if interceptor == nil { + return srv.(YorkieServer).ActivateClient(ctx, in) } -} -func (m *Operation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation.Merge(m, src) -} -func (m *Operation) XXX_Size() int { - return m.Size() -} -func (m *Operation) XXX_DiscardUnknown() { - xxx_messageInfo_Operation.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation proto.InternalMessageInfo - -type isOperation_Body interface { - isOperation_Body() - MarshalTo([]byte) (int, error) - Size() int -} - -type Operation_Set_ struct { - Set *Operation_Set `protobuf:"bytes,1,opt,name=set,proto3,oneof" json:"set,omitempty"` -} -type Operation_Add_ struct { - Add *Operation_Add `protobuf:"bytes,2,opt,name=add,proto3,oneof" json:"add,omitempty"` -} -type Operation_Move_ struct { - Move *Operation_Move `protobuf:"bytes,3,opt,name=move,proto3,oneof" json:"move,omitempty"` -} -type Operation_Remove_ struct { - Remove *Operation_Remove `protobuf:"bytes,4,opt,name=remove,proto3,oneof" json:"remove,omitempty"` -} -type Operation_Edit_ struct { - Edit *Operation_Edit `protobuf:"bytes,5,opt,name=edit,proto3,oneof" json:"edit,omitempty"` -} -type Operation_Select_ struct { - Select *Operation_Select `protobuf:"bytes,6,opt,name=select,proto3,oneof" json:"select,omitempty"` -} -type Operation_RichEdit_ struct { - RichEdit *Operation_RichEdit `protobuf:"bytes,7,opt,name=rich_edit,json=richEdit,proto3,oneof" json:"rich_edit,omitempty"` -} -type Operation_Style_ struct { - Style *Operation_Style `protobuf:"bytes,8,opt,name=style,proto3,oneof" json:"style,omitempty"` -} -type Operation_Increase_ struct { - Increase *Operation_Increase `protobuf:"bytes,9,opt,name=increase,proto3,oneof" json:"increase,omitempty"` -} - -func (*Operation_Set_) isOperation_Body() {} -func (*Operation_Add_) isOperation_Body() {} -func (*Operation_Move_) isOperation_Body() {} -func (*Operation_Remove_) isOperation_Body() {} -func (*Operation_Edit_) isOperation_Body() {} -func (*Operation_Select_) isOperation_Body() {} -func (*Operation_RichEdit_) isOperation_Body() {} -func (*Operation_Style_) isOperation_Body() {} -func (*Operation_Increase_) isOperation_Body() {} - -func (m *Operation) GetBody() isOperation_Body { - if m != nil { - return m.Body + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Yorkie/ActivateClient", } - return nil -} - -func (m *Operation) GetSet() *Operation_Set { - if x, ok := m.GetBody().(*Operation_Set_); ok { - return x.Set + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServer).ActivateClient(ctx, req.(*ActivateClientRequest)) } - return nil + return interceptor(ctx, in, info, handler) } -func (m *Operation) GetAdd() *Operation_Add { - if x, ok := m.GetBody().(*Operation_Add_); ok { - return x.Add +func _Yorkie_DeactivateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeactivateClientRequest) + if err := dec(in); err != nil { + return nil, err } - return nil -} - -func (m *Operation) GetMove() *Operation_Move { - if x, ok := m.GetBody().(*Operation_Move_); ok { - return x.Move + if interceptor == nil { + return srv.(YorkieServer).DeactivateClient(ctx, in) } - return nil -} - -func (m *Operation) GetRemove() *Operation_Remove { - if x, ok := m.GetBody().(*Operation_Remove_); ok { - return x.Remove + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Yorkie/DeactivateClient", } - return nil -} - -func (m *Operation) GetEdit() *Operation_Edit { - if x, ok := m.GetBody().(*Operation_Edit_); ok { - return x.Edit + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServer).DeactivateClient(ctx, req.(*DeactivateClientRequest)) } - return nil + return interceptor(ctx, in, info, handler) } -func (m *Operation) GetSelect() *Operation_Select { - if x, ok := m.GetBody().(*Operation_Select_); ok { - return x.Select +func _Yorkie_UpdateMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateMetadataRequest) + if err := dec(in); err != nil { + return nil, err } - return nil -} - -func (m *Operation) GetRichEdit() *Operation_RichEdit { - if x, ok := m.GetBody().(*Operation_RichEdit_); ok { - return x.RichEdit + if interceptor == nil { + return srv.(YorkieServer).UpdateMetadata(ctx, in) } - return nil -} - -func (m *Operation) GetStyle() *Operation_Style { - if x, ok := m.GetBody().(*Operation_Style_); ok { - return x.Style + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Yorkie/UpdateMetadata", } - return nil -} - -func (m *Operation) GetIncrease() *Operation_Increase { - if x, ok := m.GetBody().(*Operation_Increase_); ok { - return x.Increase + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServer).UpdateMetadata(ctx, req.(*UpdateMetadataRequest)) } - return nil + return interceptor(ctx, in, info, handler) } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Operation) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Operation_Set_)(nil), - (*Operation_Add_)(nil), - (*Operation_Move_)(nil), - (*Operation_Remove_)(nil), - (*Operation_Edit_)(nil), - (*Operation_Select_)(nil), - (*Operation_RichEdit_)(nil), - (*Operation_Style_)(nil), - (*Operation_Increase_)(nil), +func _Yorkie_AttachDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AttachDocumentRequest) + if err := dec(in); err != nil { + return nil, err } -} - -type Operation_Set struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Value *JSONElementSimple `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - ExecutedAt *TimeTicket `protobuf:"bytes,4,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Operation_Set) Reset() { *m = Operation_Set{} } -func (m *Operation_Set) String() string { return proto.CompactTextString(m) } -func (*Operation_Set) ProtoMessage() {} -func (*Operation_Set) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21, 0} -} -func (m *Operation_Set) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation_Set) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation_Set.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + if interceptor == nil { + return srv.(YorkieServer).AttachDocument(ctx, in) } -} -func (m *Operation_Set) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation_Set.Merge(m, src) -} -func (m *Operation_Set) XXX_Size() int { - return m.Size() -} -func (m *Operation_Set) XXX_DiscardUnknown() { - xxx_messageInfo_Operation_Set.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation_Set proto.InternalMessageInfo - -func (m *Operation_Set) GetParentCreatedAt() *TimeTicket { - if m != nil { - return m.ParentCreatedAt + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Yorkie/AttachDocument", } - return nil -} - -func (m *Operation_Set) GetKey() string { - if m != nil { - return m.Key + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServer).AttachDocument(ctx, req.(*AttachDocumentRequest)) } - return "" + return interceptor(ctx, in, info, handler) } -func (m *Operation_Set) GetValue() *JSONElementSimple { - if m != nil { - return m.Value +func _Yorkie_DetachDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DetachDocumentRequest) + if err := dec(in); err != nil { + return nil, err } - return nil + if interceptor == nil { + return srv.(YorkieServer).DetachDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Yorkie/DetachDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServer).DetachDocument(ctx, req.(*DetachDocumentRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *Operation_Set) GetExecutedAt() *TimeTicket { - if m != nil { - return m.ExecutedAt +func _Yorkie_WatchDocuments_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(WatchDocumentsRequest) + if err := stream.RecvMsg(m); err != nil { + return err } - return nil + return srv.(YorkieServer).WatchDocuments(m, &yorkieWatchDocumentsServer{stream}) } -type Operation_Add struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - PrevCreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=prev_created_at,json=prevCreatedAt,proto3" json:"prev_created_at,omitempty"` - Value *JSONElementSimple `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - ExecutedAt *TimeTicket `protobuf:"bytes,4,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type Yorkie_WatchDocumentsServer interface { + Send(*WatchDocumentsResponse) error + grpc.ServerStream } -func (m *Operation_Add) Reset() { *m = Operation_Add{} } -func (m *Operation_Add) String() string { return proto.CompactTextString(m) } -func (*Operation_Add) ProtoMessage() {} -func (*Operation_Add) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21, 1} -} -func (m *Operation_Add) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation_Add) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation_Add.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Operation_Add) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation_Add.Merge(m, src) -} -func (m *Operation_Add) XXX_Size() int { - return m.Size() -} -func (m *Operation_Add) XXX_DiscardUnknown() { - xxx_messageInfo_Operation_Add.DiscardUnknown(m) +type yorkieWatchDocumentsServer struct { + grpc.ServerStream } -var xxx_messageInfo_Operation_Add proto.InternalMessageInfo - -func (m *Operation_Add) GetParentCreatedAt() *TimeTicket { - if m != nil { - return m.ParentCreatedAt - } - return nil +func (x *yorkieWatchDocumentsServer) Send(m *WatchDocumentsResponse) error { + return x.ServerStream.SendMsg(m) } -func (m *Operation_Add) GetPrevCreatedAt() *TimeTicket { - if m != nil { - return m.PrevCreatedAt +func _Yorkie_PushPull_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushPullRequest) + if err := dec(in); err != nil { + return nil, err } - return nil -} - -func (m *Operation_Add) GetValue() *JSONElementSimple { - if m != nil { - return m.Value + if interceptor == nil { + return srv.(YorkieServer).PushPull(ctx, in) } - return nil -} - -func (m *Operation_Add) GetExecutedAt() *TimeTicket { - if m != nil { - return m.ExecutedAt + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Yorkie/PushPull", } - return nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServer).PushPull(ctx, req.(*PushPullRequest)) + } + return interceptor(ctx, in, info, handler) } -type Operation_Move struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - PrevCreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=prev_created_at,json=prevCreatedAt,proto3" json:"prev_created_at,omitempty"` - CreatedAt *TimeTicket `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - ExecutedAt *TimeTicket `protobuf:"bytes,4,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Operation_Move) Reset() { *m = Operation_Move{} } -func (m *Operation_Move) String() string { return proto.CompactTextString(m) } -func (*Operation_Move) ProtoMessage() {} -func (*Operation_Move) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21, 2} -} -func (m *Operation_Move) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation_Move) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation_Move.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func _Yorkie_ListChanges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListChangesRequest) + if err := dec(in); err != nil { + return nil, err } -} -func (m *Operation_Move) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation_Move.Merge(m, src) -} -func (m *Operation_Move) XXX_Size() int { - return m.Size() -} -func (m *Operation_Move) XXX_DiscardUnknown() { - xxx_messageInfo_Operation_Move.DiscardUnknown(m) + if interceptor == nil { + return srv.(YorkieServer).ListChanges(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Yorkie/ListChanges", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServer).ListChanges(ctx, req.(*ListChangesRequest)) + } + return interceptor(ctx, in, info, handler) } -var xxx_messageInfo_Operation_Move proto.InternalMessageInfo +var _Yorkie_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.Yorkie", + HandlerType: (*YorkieServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ActivateClient", + Handler: _Yorkie_ActivateClient_Handler, + }, + { + MethodName: "DeactivateClient", + Handler: _Yorkie_DeactivateClient_Handler, + }, + { + MethodName: "UpdateMetadata", + Handler: _Yorkie_UpdateMetadata_Handler, + }, + { + MethodName: "AttachDocument", + Handler: _Yorkie_AttachDocument_Handler, + }, + { + MethodName: "DetachDocument", + Handler: _Yorkie_DetachDocument_Handler, + }, + { + MethodName: "PushPull", + Handler: _Yorkie_PushPull_Handler, + }, + { + MethodName: "ListChanges", + Handler: _Yorkie_ListChanges_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "WatchDocuments", + Handler: _Yorkie_WatchDocuments_Handler, + ServerStreams: true, + }, + }, + Metadata: "yorkie.proto", +} -func (m *Operation_Move) GetParentCreatedAt() *TimeTicket { - if m != nil { - return m.ParentCreatedAt +func (m *ActivateClientRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *Operation_Move) GetPrevCreatedAt() *TimeTicket { - if m != nil { - return m.PrevCreatedAt - } - return nil +func (m *ActivateClientRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_Move) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt +func (m *ActivateClientRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return nil + if len(m.ClientKey) > 0 { + i -= len(m.ClientKey) + copy(dAtA[i:], m.ClientKey) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *Operation_Move) GetExecutedAt() *TimeTicket { - if m != nil { - return m.ExecutedAt +func (m *ActivateClientResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -type Operation_Remove struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - ExecutedAt *TimeTicket `protobuf:"bytes,3,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *ActivateClientResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_Remove) Reset() { *m = Operation_Remove{} } -func (m *Operation_Remove) String() string { return proto.CompactTextString(m) } -func (*Operation_Remove) ProtoMessage() {} -func (*Operation_Remove) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21, 3} -} -func (m *Operation_Remove) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation_Remove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation_Remove.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *ActivateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } -} -func (m *Operation_Remove) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation_Remove.Merge(m, src) -} -func (m *Operation_Remove) XXX_Size() int { - return m.Size() -} -func (m *Operation_Remove) XXX_DiscardUnknown() { - xxx_messageInfo_Operation_Remove.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation_Remove proto.InternalMessageInfo - -func (m *Operation_Remove) GetParentCreatedAt() *TimeTicket { - if m != nil { - return m.ParentCreatedAt + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0x12 } - return nil -} - -func (m *Operation_Remove) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt + if len(m.ClientKey) > 0 { + i -= len(m.ClientKey) + copy(dAtA[i:], m.ClientKey) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientKey))) + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil } -func (m *Operation_Remove) GetExecutedAt() *TimeTicket { - if m != nil { - return m.ExecutedAt +func (m *DeactivateClientRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -type Operation_Edit struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` - To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` - CreatedAtMapByActor map[string]*TimeTicket `protobuf:"bytes,4,rep,name=created_at_map_by_actor,json=createdAtMapByActor,proto3" json:"created_at_map_by_actor,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` - ExecutedAt *TimeTicket `protobuf:"bytes,6,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *DeactivateClientRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_Edit) Reset() { *m = Operation_Edit{} } -func (m *Operation_Edit) String() string { return proto.CompactTextString(m) } -func (*Operation_Edit) ProtoMessage() {} -func (*Operation_Edit) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21, 4} -} -func (m *Operation_Edit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation_Edit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation_Edit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *DeactivateClientRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } -} -func (m *Operation_Edit) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation_Edit.Merge(m, src) -} -func (m *Operation_Edit) XXX_Size() int { - return m.Size() -} -func (m *Operation_Edit) XXX_DiscardUnknown() { - xxx_messageInfo_Operation_Edit.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation_Edit proto.InternalMessageInfo - -func (m *Operation_Edit) GetParentCreatedAt() *TimeTicket { - if m != nil { - return m.ParentCreatedAt + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil } -func (m *Operation_Edit) GetFrom() *TextNodePos { - if m != nil { - return m.From +func (m *DeactivateClientResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *Operation_Edit) GetTo() *TextNodePos { - if m != nil { - return m.To - } - return nil +func (m *DeactivateClientResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_Edit) GetCreatedAtMapByActor() map[string]*TimeTicket { - if m != nil { - return m.CreatedAtMapByActor +func (m *DeactivateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return nil -} - -func (m *Operation_Edit) GetContent() string { - if m != nil { - return m.Content + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - return "" + return len(dAtA) - i, nil } -func (m *Operation_Edit) GetExecutedAt() *TimeTicket { - if m != nil { - return m.ExecutedAt +func (m *AttachDocumentRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -type Operation_Select struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` - To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` - ExecutedAt *TimeTicket `protobuf:"bytes,4,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *AttachDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_Select) Reset() { *m = Operation_Select{} } -func (m *Operation_Select) String() string { return proto.CompactTextString(m) } -func (*Operation_Select) ProtoMessage() {} -func (*Operation_Select) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21, 5} -} -func (m *Operation_Select) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation_Select) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation_Select.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *AttachDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ChangePack != nil { + { + size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x12 } -} -func (m *Operation_Select) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation_Select.Merge(m, src) -} -func (m *Operation_Select) XXX_Size() int { - return m.Size() -} -func (m *Operation_Select) XXX_DiscardUnknown() { - xxx_messageInfo_Operation_Select.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation_Select proto.InternalMessageInfo - -func (m *Operation_Select) GetParentCreatedAt() *TimeTicket { - if m != nil { - return m.ParentCreatedAt + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil } -func (m *Operation_Select) GetFrom() *TextNodePos { - if m != nil { - return m.From +func (m *AttachDocumentResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *Operation_Select) GetTo() *TextNodePos { - if m != nil { - return m.To - } - return nil +func (m *AttachDocumentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_Select) GetExecutedAt() *TimeTicket { - if m != nil { - return m.ExecutedAt +func (m *AttachDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return nil -} - -type Operation_RichEdit struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` - To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` - CreatedAtMapByActor map[string]*TimeTicket `protobuf:"bytes,4,rep,name=created_at_map_by_actor,json=createdAtMapByActor,proto3" json:"created_at_map_by_actor,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` - Attributes map[string]string `protobuf:"bytes,6,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - ExecutedAt *TimeTicket `protobuf:"bytes,7,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Operation_RichEdit) Reset() { *m = Operation_RichEdit{} } -func (m *Operation_RichEdit) String() string { return proto.CompactTextString(m) } -func (*Operation_RichEdit) ProtoMessage() {} -func (*Operation_RichEdit) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21, 6} -} -func (m *Operation_RichEdit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation_RichEdit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation_RichEdit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + if m.ChangePack != nil { + { + size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x12 } -} -func (m *Operation_RichEdit) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation_RichEdit.Merge(m, src) -} -func (m *Operation_RichEdit) XXX_Size() int { - return m.Size() -} -func (m *Operation_RichEdit) XXX_DiscardUnknown() { - xxx_messageInfo_Operation_RichEdit.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation_RichEdit proto.InternalMessageInfo - -func (m *Operation_RichEdit) GetParentCreatedAt() *TimeTicket { - if m != nil { - return m.ParentCreatedAt + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil } -func (m *Operation_RichEdit) GetFrom() *TextNodePos { - if m != nil { - return m.From +func (m *DetachDocumentRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *Operation_RichEdit) GetTo() *TextNodePos { - if m != nil { - return m.To - } - return nil +func (m *DetachDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_RichEdit) GetCreatedAtMapByActor() map[string]*TimeTicket { - if m != nil { - return m.CreatedAtMapByActor +func (m *DetachDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return nil -} - -func (m *Operation_RichEdit) GetContent() string { - if m != nil { - return m.Content + if m.ChangePack != nil { + { + size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return "" -} - -func (m *Operation_RichEdit) GetAttributes() map[string]string { - if m != nil { - return m.Attributes + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil } -func (m *Operation_RichEdit) GetExecutedAt() *TimeTicket { - if m != nil { - return m.ExecutedAt +func (m *DetachDocumentResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -type Operation_Style struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` - To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` - Attributes map[string]string `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - ExecutedAt *TimeTicket `protobuf:"bytes,5,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *DetachDocumentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_Style) Reset() { *m = Operation_Style{} } -func (m *Operation_Style) String() string { return proto.CompactTextString(m) } -func (*Operation_Style) ProtoMessage() {} -func (*Operation_Style) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21, 7} -} -func (m *Operation_Style) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation_Style) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation_Style.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *DetachDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } -} -func (m *Operation_Style) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation_Style.Merge(m, src) -} -func (m *Operation_Style) XXX_Size() int { - return m.Size() -} -func (m *Operation_Style) XXX_DiscardUnknown() { - xxx_messageInfo_Operation_Style.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation_Style proto.InternalMessageInfo - -func (m *Operation_Style) GetParentCreatedAt() *TimeTicket { - if m != nil { - return m.ParentCreatedAt + if m.ChangePack != nil { + { + size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return nil -} - -func (m *Operation_Style) GetFrom() *TextNodePos { - if m != nil { - return m.From + if len(m.ClientKey) > 0 { + i -= len(m.ClientKey) + copy(dAtA[i:], m.ClientKey) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientKey))) + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil } -func (m *Operation_Style) GetTo() *TextNodePos { - if m != nil { - return m.To +func (m *WatchDocumentsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *Operation_Style) GetAttributes() map[string]string { - if m != nil { - return m.Attributes - } - return nil +func (m *WatchDocumentsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_Style) GetExecutedAt() *TimeTicket { - if m != nil { - return m.ExecutedAt +func (m *WatchDocumentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return nil -} - -type Operation_Increase struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - Value *JSONElementSimple `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - ExecutedAt *TimeTicket `protobuf:"bytes,3,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Operation_Increase) Reset() { *m = Operation_Increase{} } -func (m *Operation_Increase) String() string { return proto.CompactTextString(m) } -func (*Operation_Increase) ProtoMessage() {} -func (*Operation_Increase) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21, 8} -} -func (m *Operation_Increase) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation_Increase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation_Increase.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + if len(m.DocumentKeys) > 0 { + for iNdEx := len(m.DocumentKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DocumentKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return b[:n], nil } + if m.Client != nil { + { + size, err := m.Client.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *Operation_Increase) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation_Increase.Merge(m, src) -} -func (m *Operation_Increase) XXX_Size() int { - return m.Size() -} -func (m *Operation_Increase) XXX_DiscardUnknown() { - xxx_messageInfo_Operation_Increase.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation_Increase proto.InternalMessageInfo -func (m *Operation_Increase) GetParentCreatedAt() *TimeTicket { - if m != nil { - return m.ParentCreatedAt +func (m *WatchDocumentsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *Operation_Increase) GetValue() *JSONElementSimple { - if m != nil { - return m.Value - } - return nil +func (m *WatchDocumentsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Operation_Increase) GetExecutedAt() *TimeTicket { - if m != nil { - return m.ExecutedAt +func (m *WatchDocumentsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return nil + if m.Body != nil { + { + size := m.Body.Size() + i -= size + if _, err := m.Body.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil } -type JSONElementSimple struct { - CreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - MovedAt *TimeTicket `protobuf:"bytes,2,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` - RemovedAt *TimeTicket `protobuf:"bytes,3,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` - Type ValueType `protobuf:"varint,4,opt,name=type,proto3,enum=api.ValueType" json:"type,omitempty"` - Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *WatchDocumentsResponse_Initialization_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *JSONElementSimple) Reset() { *m = JSONElementSimple{} } -func (m *JSONElementSimple) String() string { return proto.CompactTextString(m) } -func (*JSONElementSimple) ProtoMessage() {} -func (*JSONElementSimple) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{22} -} -func (m *JSONElementSimple) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JSONElementSimple) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JSONElementSimple.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *WatchDocumentsResponse_Initialization_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Initialization != nil { + { + size, err := m.Initialization.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0xa } + return len(dAtA) - i, nil } -func (m *JSONElementSimple) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONElementSimple.Merge(m, src) -} -func (m *JSONElementSimple) XXX_Size() int { - return m.Size() -} -func (m *JSONElementSimple) XXX_DiscardUnknown() { - xxx_messageInfo_JSONElementSimple.DiscardUnknown(m) +func (m *WatchDocumentsResponse_Event) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -var xxx_messageInfo_JSONElementSimple proto.InternalMessageInfo - -func (m *JSONElementSimple) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt +func (m *WatchDocumentsResponse_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Event != nil { + { + size, err := m.Event.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return nil + return len(dAtA) - i, nil } - -func (m *JSONElementSimple) GetMovedAt() *TimeTicket { - if m != nil { - return m.MovedAt +func (m *WatchDocumentsResponse_Initialization) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *JSONElementSimple) GetRemovedAt() *TimeTicket { - if m != nil { - return m.RemovedAt - } - return nil +func (m *WatchDocumentsResponse_Initialization) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *JSONElementSimple) GetType() ValueType { - if m != nil { - return m.Type +func (m *WatchDocumentsResponse_Initialization) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.PeersMapByDoc) > 0 { + for k := range m.PeersMapByDoc { + v := m.PeersMapByDoc[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintYorkie(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintYorkie(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } } - return ValueType_NULL + return len(dAtA) - i, nil } -func (m *JSONElementSimple) GetValue() []byte { - if m != nil { - return m.Value +func (m *PushPullRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -type JSONElement struct { - // Types that are valid to be assigned to Body: - // *JSONElement_JsonObject - // *JSONElement_JsonArray - // *JSONElement_Primitive_ - // *JSONElement_Text_ - // *JSONElement_RichText_ - // *JSONElement_Counter_ - Body isJSONElement_Body `protobuf_oneof:"Body"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *PushPullRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *JSONElement) Reset() { *m = JSONElement{} } -func (m *JSONElement) String() string { return proto.CompactTextString(m) } -func (*JSONElement) ProtoMessage() {} -func (*JSONElement) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{23} -} -func (m *JSONElement) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JSONElement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JSONElement.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *PushPullRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ChangePack != nil { + { + size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x12 } -} -func (m *JSONElement) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONElement.Merge(m, src) -} -func (m *JSONElement) XXX_Size() int { - return m.Size() -} -func (m *JSONElement) XXX_DiscardUnknown() { - xxx_messageInfo_JSONElement.DiscardUnknown(m) -} - -var xxx_messageInfo_JSONElement proto.InternalMessageInfo - -type isJSONElement_Body interface { - isJSONElement_Body() - MarshalTo([]byte) (int, error) - Size() int -} - -type JSONElement_JsonObject struct { - JsonObject *JSONElement_JSONObject `protobuf:"bytes,1,opt,name=json_object,json=jsonObject,proto3,oneof" json:"json_object,omitempty"` -} -type JSONElement_JsonArray struct { - JsonArray *JSONElement_JSONArray `protobuf:"bytes,2,opt,name=json_array,json=jsonArray,proto3,oneof" json:"json_array,omitempty"` -} -type JSONElement_Primitive_ struct { - Primitive *JSONElement_Primitive `protobuf:"bytes,3,opt,name=primitive,proto3,oneof" json:"primitive,omitempty"` -} -type JSONElement_Text_ struct { - Text *JSONElement_Text `protobuf:"bytes,4,opt,name=text,proto3,oneof" json:"text,omitempty"` -} -type JSONElement_RichText_ struct { - RichText *JSONElement_RichText `protobuf:"bytes,5,opt,name=rich_text,json=richText,proto3,oneof" json:"rich_text,omitempty"` -} -type JSONElement_Counter_ struct { - Counter *JSONElement_Counter `protobuf:"bytes,6,opt,name=counter,proto3,oneof" json:"counter,omitempty"` -} - -func (*JSONElement_JsonObject) isJSONElement_Body() {} -func (*JSONElement_JsonArray) isJSONElement_Body() {} -func (*JSONElement_Primitive_) isJSONElement_Body() {} -func (*JSONElement_Text_) isJSONElement_Body() {} -func (*JSONElement_RichText_) isJSONElement_Body() {} -func (*JSONElement_Counter_) isJSONElement_Body() {} - -func (m *JSONElement) GetBody() isJSONElement_Body { - if m != nil { - return m.Body + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil } -func (m *JSONElement) GetJsonObject() *JSONElement_JSONObject { - if x, ok := m.GetBody().(*JSONElement_JsonObject); ok { - return x.JsonObject +func (m *PushPullResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *JSONElement) GetJsonArray() *JSONElement_JSONArray { - if x, ok := m.GetBody().(*JSONElement_JsonArray); ok { - return x.JsonArray - } - return nil -} - -func (m *JSONElement) GetPrimitive() *JSONElement_Primitive { - if x, ok := m.GetBody().(*JSONElement_Primitive_); ok { - return x.Primitive - } - return nil +func (m *PushPullResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *JSONElement) GetText() *JSONElement_Text { - if x, ok := m.GetBody().(*JSONElement_Text_); ok { - return x.Text +func (m *PushPullResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return nil -} - -func (m *JSONElement) GetRichText() *JSONElement_RichText { - if x, ok := m.GetBody().(*JSONElement_RichText_); ok { - return x.RichText + if m.ChangePack != nil { + { + size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return nil -} - -func (m *JSONElement) GetCounter() *JSONElement_Counter { - if x, ok := m.GetBody().(*JSONElement_Counter_); ok { - return x.Counter + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*JSONElement) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*JSONElement_JsonObject)(nil), - (*JSONElement_JsonArray)(nil), - (*JSONElement_Primitive_)(nil), - (*JSONElement_Text_)(nil), - (*JSONElement_RichText_)(nil), - (*JSONElement_Counter_)(nil), +func (m *UpdateMetadataRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil } -type JSONElement_JSONObject struct { - Nodes []*RHTNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` - CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - MovedAt *TimeTicket `protobuf:"bytes,3,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` - RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *UpdateMetadataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *JSONElement_JSONObject) Reset() { *m = JSONElement_JSONObject{} } -func (m *JSONElement_JSONObject) String() string { return proto.CompactTextString(m) } -func (*JSONElement_JSONObject) ProtoMessage() {} -func (*JSONElement_JSONObject) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{23, 0} -} -func (m *JSONElement_JSONObject) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JSONElement_JSONObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JSONElement_JSONObject.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *UpdateMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.DocumentKeys) > 0 { + for iNdEx := len(m.DocumentKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DocumentKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return b[:n], nil } + if m.Client != nil { + { + size, err := m.Client.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *JSONElement_JSONObject) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONElement_JSONObject.Merge(m, src) -} -func (m *JSONElement_JSONObject) XXX_Size() int { - return m.Size() -} -func (m *JSONElement_JSONObject) XXX_DiscardUnknown() { - xxx_messageInfo_JSONElement_JSONObject.DiscardUnknown(m) -} - -var xxx_messageInfo_JSONElement_JSONObject proto.InternalMessageInfo -func (m *JSONElement_JSONObject) GetNodes() []*RHTNode { - if m != nil { - return m.Nodes +func (m *UpdateMetadataResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *JSONElement_JSONObject) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt - } - return nil +func (m *UpdateMetadataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *JSONElement_JSONObject) GetMovedAt() *TimeTicket { - if m != nil { - return m.MovedAt +func (m *UpdateMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return nil + return len(dAtA) - i, nil } -func (m *JSONElement_JSONObject) GetRemovedAt() *TimeTicket { - if m != nil { - return m.RemovedAt +func (m *ListChangesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -type JSONElement_JSONArray struct { - Nodes []*RGANode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` - CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - MovedAt *TimeTicket `protobuf:"bytes,3,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` - RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *ListChangesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *JSONElement_JSONArray) Reset() { *m = JSONElement_JSONArray{} } -func (m *JSONElement_JSONArray) String() string { return proto.CompactTextString(m) } -func (*JSONElement_JSONArray) ProtoMessage() {} -func (*JSONElement_JSONArray) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{23, 1} -} -func (m *JSONElement_JSONArray) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JSONElement_JSONArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JSONElement_JSONArray.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *ListChangesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.DocumentKey != nil { + { + size, err := m.DocumentKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x12 } -} -func (m *JSONElement_JSONArray) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONElement_JSONArray.Merge(m, src) -} -func (m *JSONElement_JSONArray) XXX_Size() int { - return m.Size() -} -func (m *JSONElement_JSONArray) XXX_DiscardUnknown() { - xxx_messageInfo_JSONElement_JSONArray.DiscardUnknown(m) -} - -var xxx_messageInfo_JSONElement_JSONArray proto.InternalMessageInfo - -func (m *JSONElement_JSONArray) GetNodes() []*RGANode { - if m != nil { - return m.Nodes + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil } -func (m *JSONElement_JSONArray) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt +func (m *ListChangesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -func (m *JSONElement_JSONArray) GetMovedAt() *TimeTicket { - if m != nil { - return m.MovedAt - } - return nil +func (m *ListChangesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *JSONElement_JSONArray) GetRemovedAt() *TimeTicket { - if m != nil { - return m.RemovedAt +func (m *ListChangesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return nil -} - -type JSONElement_Primitive struct { - Type ValueType `protobuf:"varint,1,opt,name=type,proto3,enum=api.ValueType" json:"type,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - CreatedAt *TimeTicket `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - MovedAt *TimeTicket `protobuf:"bytes,4,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` - RemovedAt *TimeTicket `protobuf:"bytes,5,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *JSONElement_Primitive) Reset() { *m = JSONElement_Primitive{} } -func (m *JSONElement_Primitive) String() string { return proto.CompactTextString(m) } -func (*JSONElement_Primitive) ProtoMessage() {} -func (*JSONElement_Primitive) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{23, 2} -} -func (m *JSONElement_Primitive) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JSONElement_Primitive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JSONElement_Primitive.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + if len(m.Changes) > 0 { + for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return b[:n], nil } + return len(dAtA) - i, nil } -func (m *JSONElement_Primitive) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONElement_Primitive.Merge(m, src) -} -func (m *JSONElement_Primitive) XXX_Size() int { - return m.Size() -} -func (m *JSONElement_Primitive) XXX_DiscardUnknown() { - xxx_messageInfo_JSONElement_Primitive.DiscardUnknown(m) -} - -var xxx_messageInfo_JSONElement_Primitive proto.InternalMessageInfo -func (m *JSONElement_Primitive) GetType() ValueType { - if m != nil { - return m.Type +func encodeVarintYorkie(dAtA []byte, offset int, v uint64) int { + offset -= sovYorkie(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return ValueType_NULL + dAtA[offset] = uint8(v) + return base } - -func (m *JSONElement_Primitive) GetValue() []byte { - if m != nil { - return m.Value +func (m *ActivateClientRequest) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -func (m *JSONElement_Primitive) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt + var l int + _ = l + l = len(m.ClientKey) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) } - return nil -} - -func (m *JSONElement_Primitive) GetMovedAt() *TimeTicket { - if m != nil { - return m.MovedAt + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (m *JSONElement_Primitive) GetRemovedAt() *TimeTicket { - if m != nil { - return m.RemovedAt +func (m *ActivateClientResponse) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -type JSONElement_Text struct { - Nodes []*TextNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` - CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - MovedAt *TimeTicket `protobuf:"bytes,3,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` - RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *JSONElement_Text) Reset() { *m = JSONElement_Text{} } -func (m *JSONElement_Text) String() string { return proto.CompactTextString(m) } -func (*JSONElement_Text) ProtoMessage() {} -func (*JSONElement_Text) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{23, 3} -} -func (m *JSONElement_Text) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JSONElement_Text) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JSONElement_Text.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + var l int + _ = l + l = len(m.ClientKey) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) } -} -func (m *JSONElement_Text) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONElement_Text.Merge(m, src) -} -func (m *JSONElement_Text) XXX_Size() int { - return m.Size() -} -func (m *JSONElement_Text) XXX_DiscardUnknown() { - xxx_messageInfo_JSONElement_Text.DiscardUnknown(m) -} - -var xxx_messageInfo_JSONElement_Text proto.InternalMessageInfo - -func (m *JSONElement_Text) GetNodes() []*TextNode { - if m != nil { - return m.Nodes + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) } - return nil -} - -func (m *JSONElement_Text) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (m *JSONElement_Text) GetMovedAt() *TimeTicket { - if m != nil { - return m.MovedAt +func (m *DeactivateClientRequest) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -func (m *JSONElement_Text) GetRemovedAt() *TimeTicket { - if m != nil { - return m.RemovedAt + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) } - return nil -} - -type JSONElement_RichText struct { - Nodes []*RichTextNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` - CreatedAt *TimeTicket `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - MovedAt *TimeTicket `protobuf:"bytes,3,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` - RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *JSONElement_RichText) Reset() { *m = JSONElement_RichText{} } -func (m *JSONElement_RichText) String() string { return proto.CompactTextString(m) } -func (*JSONElement_RichText) ProtoMessage() {} -func (*JSONElement_RichText) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{23, 4} -} -func (m *JSONElement_RichText) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JSONElement_RichText) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JSONElement_RichText.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n } -func (m *JSONElement_RichText) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONElement_RichText.Merge(m, src) -} -func (m *JSONElement_RichText) XXX_Size() int { - return m.Size() -} -func (m *JSONElement_RichText) XXX_DiscardUnknown() { - xxx_messageInfo_JSONElement_RichText.DiscardUnknown(m) -} - -var xxx_messageInfo_JSONElement_RichText proto.InternalMessageInfo -func (m *JSONElement_RichText) GetNodes() []*RichTextNode { - if m != nil { - return m.Nodes +func (m *DeactivateClientResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (m *JSONElement_RichText) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt +func (m *AttachDocumentRequest) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.ChangePack != nil { + l = m.ChangePack.Size() + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (m *JSONElement_RichText) GetMovedAt() *TimeTicket { - if m != nil { - return m.MovedAt +func (m *AttachDocumentResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.ChangePack != nil { + l = m.ChangePack.Size() + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (m *JSONElement_RichText) GetRemovedAt() *TimeTicket { - if m != nil { - return m.RemovedAt +func (m *DetachDocumentRequest) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.ChangePack != nil { + l = m.ChangePack.Size() + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -type JSONElement_Counter struct { - Type ValueType `protobuf:"varint,1,opt,name=type,proto3,enum=api.ValueType" json:"type,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - CreatedAt *TimeTicket `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - MovedAt *TimeTicket `protobuf:"bytes,4,opt,name=moved_at,json=movedAt,proto3" json:"moved_at,omitempty"` - RemovedAt *TimeTicket `protobuf:"bytes,5,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *DetachDocumentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientKey) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.ChangePack != nil { + l = m.ChangePack.Size() + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (m *JSONElement_Counter) Reset() { *m = JSONElement_Counter{} } -func (m *JSONElement_Counter) String() string { return proto.CompactTextString(m) } -func (*JSONElement_Counter) ProtoMessage() {} -func (*JSONElement_Counter) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{23, 5} -} -func (m *JSONElement_Counter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JSONElement_Counter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JSONElement_Counter.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *WatchDocumentsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Client != nil { + l = m.Client.Size() + n += 1 + l + sovYorkie(uint64(l)) + } + if len(m.DocumentKeys) > 0 { + for _, e := range m.DocumentKeys { + l = e.Size() + n += 1 + l + sovYorkie(uint64(l)) } - return b[:n], nil } -} -func (m *JSONElement_Counter) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONElement_Counter.Merge(m, src) -} -func (m *JSONElement_Counter) XXX_Size() int { - return m.Size() -} -func (m *JSONElement_Counter) XXX_DiscardUnknown() { - xxx_messageInfo_JSONElement_Counter.DiscardUnknown(m) -} - -var xxx_messageInfo_JSONElement_Counter proto.InternalMessageInfo - -func (m *JSONElement_Counter) GetType() ValueType { - if m != nil { - return m.Type + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return ValueType_NULL + return n } -func (m *JSONElement_Counter) GetValue() []byte { - if m != nil { - return m.Value +func (m *WatchDocumentsResponse) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -func (m *JSONElement_Counter) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt + var l int + _ = l + if m.Body != nil { + n += m.Body.Size() } - return nil -} - -func (m *JSONElement_Counter) GetMovedAt() *TimeTicket { - if m != nil { - return m.MovedAt + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (m *JSONElement_Counter) GetRemovedAt() *TimeTicket { - if m != nil { - return m.RemovedAt +func (m *WatchDocumentsResponse_Initialization_) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -type RHTNode struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Element *JSONElement `protobuf:"bytes,2,opt,name=element,proto3" json:"element,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RHTNode) Reset() { *m = RHTNode{} } -func (m *RHTNode) String() string { return proto.CompactTextString(m) } -func (*RHTNode) ProtoMessage() {} -func (*RHTNode) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{24} -} -func (m *RHTNode) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RHTNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RHTNode.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + var l int + _ = l + if m.Initialization != nil { + l = m.Initialization.Size() + n += 1 + l + sovYorkie(uint64(l)) } + return n } -func (m *RHTNode) XXX_Merge(src proto.Message) { - xxx_messageInfo_RHTNode.Merge(m, src) -} -func (m *RHTNode) XXX_Size() int { - return m.Size() -} -func (m *RHTNode) XXX_DiscardUnknown() { - xxx_messageInfo_RHTNode.DiscardUnknown(m) -} - -var xxx_messageInfo_RHTNode proto.InternalMessageInfo - -func (m *RHTNode) GetKey() string { - if m != nil { - return m.Key +func (m *WatchDocumentsResponse_Event) Size() (n int) { + if m == nil { + return 0 } - return "" -} - -func (m *RHTNode) GetElement() *JSONElement { - if m != nil { - return m.Element + var l int + _ = l + if m.Event != nil { + l = m.Event.Size() + n += 1 + l + sovYorkie(uint64(l)) } - return nil -} - -type RGANode struct { - Next *RGANode `protobuf:"bytes,1,opt,name=next,proto3" json:"next,omitempty"` - Element *JSONElement `protobuf:"bytes,2,opt,name=element,proto3" json:"element,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RGANode) Reset() { *m = RGANode{} } -func (m *RGANode) String() string { return proto.CompactTextString(m) } -func (*RGANode) ProtoMessage() {} -func (*RGANode) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{25} -} -func (m *RGANode) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + return n } -func (m *RGANode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RGANode.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *WatchDocumentsResponse_Initialization) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PeersMapByDoc) > 0 { + for k, v := range m.PeersMapByDoc { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovYorkie(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovYorkie(uint64(len(k))) + l + n += mapEntrySize + 1 + sovYorkie(uint64(mapEntrySize)) } - return b[:n], nil } -} -func (m *RGANode) XXX_Merge(src proto.Message) { - xxx_messageInfo_RGANode.Merge(m, src) -} -func (m *RGANode) XXX_Size() int { - return m.Size() -} -func (m *RGANode) XXX_DiscardUnknown() { - xxx_messageInfo_RGANode.DiscardUnknown(m) -} - -var xxx_messageInfo_RGANode proto.InternalMessageInfo - -func (m *RGANode) GetNext() *RGANode { - if m != nil { - return m.Next + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (m *RGANode) GetElement() *JSONElement { - if m != nil { - return m.Element +func (m *PushPullRequest) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -type TextNode struct { - Id *TextNodeID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - RemovedAt *TimeTicket `protobuf:"bytes,3,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` - InsPrevId *TextNodeID `protobuf:"bytes,4,opt,name=ins_prev_id,json=insPrevId,proto3" json:"ins_prev_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TextNode) Reset() { *m = TextNode{} } -func (m *TextNode) String() string { return proto.CompactTextString(m) } -func (*TextNode) ProtoMessage() {} -func (*TextNode) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{26} -} -func (m *TextNode) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TextNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TextNode.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) } -} -func (m *TextNode) XXX_Merge(src proto.Message) { - xxx_messageInfo_TextNode.Merge(m, src) -} -func (m *TextNode) XXX_Size() int { - return m.Size() -} -func (m *TextNode) XXX_DiscardUnknown() { - xxx_messageInfo_TextNode.DiscardUnknown(m) -} - -var xxx_messageInfo_TextNode proto.InternalMessageInfo - -func (m *TextNode) GetId() *TextNodeID { - if m != nil { - return m.Id + if m.ChangePack != nil { + l = m.ChangePack.Size() + n += 1 + l + sovYorkie(uint64(l)) } - return nil -} - -func (m *TextNode) GetValue() string { - if m != nil { - return m.Value + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return "" + return n } -func (m *TextNode) GetRemovedAt() *TimeTicket { - if m != nil { - return m.RemovedAt +func (m *PushPullResponse) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -func (m *TextNode) GetInsPrevId() *TextNodeID { - if m != nil { - return m.InsPrevId + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) } - return nil -} - -type RichTextNodeAttr 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"` - UpdatedAt *TimeTicket `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RichTextNodeAttr) Reset() { *m = RichTextNodeAttr{} } -func (m *RichTextNodeAttr) String() string { return proto.CompactTextString(m) } -func (*RichTextNodeAttr) ProtoMessage() {} -func (*RichTextNodeAttr) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{27} -} -func (m *RichTextNodeAttr) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RichTextNodeAttr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RichTextNodeAttr.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + if m.ChangePack != nil { + l = m.ChangePack.Size() + n += 1 + l + sovYorkie(uint64(l)) } -} -func (m *RichTextNodeAttr) XXX_Merge(src proto.Message) { - xxx_messageInfo_RichTextNodeAttr.Merge(m, src) -} -func (m *RichTextNodeAttr) XXX_Size() int { - return m.Size() -} -func (m *RichTextNodeAttr) XXX_DiscardUnknown() { - xxx_messageInfo_RichTextNodeAttr.DiscardUnknown(m) -} - -var xxx_messageInfo_RichTextNodeAttr proto.InternalMessageInfo - -func (m *RichTextNodeAttr) GetKey() string { - if m != nil { - return m.Key + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return "" + return n } -func (m *RichTextNodeAttr) GetValue() string { - if m != nil { - return m.Value +func (m *UpdateMetadataRequest) Size() (n int) { + if m == nil { + return 0 } - return "" -} - -func (m *RichTextNodeAttr) GetUpdatedAt() *TimeTicket { - if m != nil { - return m.UpdatedAt + var l int + _ = l + if m.Client != nil { + l = m.Client.Size() + n += 1 + l + sovYorkie(uint64(l)) } - return nil -} - -type RichTextNode struct { - Id *TextNodeID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Attributes map[string]*RichTextNodeAttr `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - RemovedAt *TimeTicket `protobuf:"bytes,4,opt,name=removed_at,json=removedAt,proto3" json:"removed_at,omitempty"` - InsPrevId *TextNodeID `protobuf:"bytes,5,opt,name=ins_prev_id,json=insPrevId,proto3" json:"ins_prev_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RichTextNode) Reset() { *m = RichTextNode{} } -func (m *RichTextNode) String() string { return proto.CompactTextString(m) } -func (*RichTextNode) ProtoMessage() {} -func (*RichTextNode) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{28} -} -func (m *RichTextNode) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RichTextNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RichTextNode.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + if len(m.DocumentKeys) > 0 { + for _, e := range m.DocumentKeys { + l = e.Size() + n += 1 + l + sovYorkie(uint64(l)) } - return b[:n], nil } -} -func (m *RichTextNode) XXX_Merge(src proto.Message) { - xxx_messageInfo_RichTextNode.Merge(m, src) -} -func (m *RichTextNode) XXX_Size() int { - return m.Size() -} -func (m *RichTextNode) XXX_DiscardUnknown() { - xxx_messageInfo_RichTextNode.DiscardUnknown(m) -} - -var xxx_messageInfo_RichTextNode proto.InternalMessageInfo - -func (m *RichTextNode) GetId() *TextNodeID { - if m != nil { - return m.Id + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (m *RichTextNode) GetAttributes() map[string]*RichTextNodeAttr { - if m != nil { - return m.Attributes +func (m *UpdateMetadataResponse) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -func (m *RichTextNode) GetValue() string { - if m != nil { - return m.Value + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return "" + return n } -func (m *RichTextNode) GetRemovedAt() *TimeTicket { - if m != nil { - return m.RemovedAt +func (m *ListChangesRequest) Size() (n int) { + if m == nil { + return 0 } - return nil -} - -func (m *RichTextNode) GetInsPrevId() *TextNodeID { - if m != nil { - return m.InsPrevId + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) } - return nil -} - -type TextNodeID struct { - CreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TextNodeID) Reset() { *m = TextNodeID{} } -func (m *TextNodeID) String() string { return proto.CompactTextString(m) } -func (*TextNodeID) ProtoMessage() {} -func (*TextNodeID) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{29} -} -func (m *TextNodeID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TextNodeID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TextNodeID.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TextNodeID) XXX_Merge(src proto.Message) { - xxx_messageInfo_TextNodeID.Merge(m, src) -} -func (m *TextNodeID) XXX_Size() int { - return m.Size() -} -func (m *TextNodeID) XXX_DiscardUnknown() { - xxx_messageInfo_TextNodeID.DiscardUnknown(m) -} - -var xxx_messageInfo_TextNodeID proto.InternalMessageInfo - -func (m *TextNodeID) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt - } - return nil -} - -func (m *TextNodeID) GetOffset() int32 { - if m != nil { - return m.Offset - } - return 0 -} - -type Metadata struct { - Clock int32 `protobuf:"varint,1,opt,name=clock,proto3" json:"clock,omitempty"` - Data map[string]string `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Metadata) Reset() { *m = Metadata{} } -func (m *Metadata) String() string { return proto.CompactTextString(m) } -func (*Metadata) ProtoMessage() {} -func (*Metadata) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{30} -} -func (m *Metadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Metadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_Metadata.Merge(m, src) -} -func (m *Metadata) XXX_Size() int { - return m.Size() -} -func (m *Metadata) XXX_DiscardUnknown() { - xxx_messageInfo_Metadata.DiscardUnknown(m) -} - -var xxx_messageInfo_Metadata proto.InternalMessageInfo - -func (m *Metadata) GetClock() int32 { - if m != nil { - return m.Clock - } - return 0 -} - -func (m *Metadata) GetData() map[string]string { - if m != nil { - return m.Data - } - return nil -} - -type Client struct { - Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Client) Reset() { *m = Client{} } -func (m *Client) String() string { return proto.CompactTextString(m) } -func (*Client) ProtoMessage() {} -func (*Client) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{31} -} -func (m *Client) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Client) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Client.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Client) XXX_Merge(src proto.Message) { - xxx_messageInfo_Client.Merge(m, src) -} -func (m *Client) XXX_Size() int { - return m.Size() -} -func (m *Client) XXX_DiscardUnknown() { - xxx_messageInfo_Client.DiscardUnknown(m) -} - -var xxx_messageInfo_Client proto.InternalMessageInfo - -func (m *Client) GetId() []byte { - if m != nil { - return m.Id - } - return nil -} - -func (m *Client) GetMetadata() *Metadata { - if m != nil { - return m.Metadata - } - return nil -} - -type Clients struct { - Clients []*Client `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Clients) Reset() { *m = Clients{} } -func (m *Clients) String() string { return proto.CompactTextString(m) } -func (*Clients) ProtoMessage() {} -func (*Clients) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{32} -} -func (m *Clients) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Clients) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Clients.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Clients) XXX_Merge(src proto.Message) { - xxx_messageInfo_Clients.Merge(m, src) -} -func (m *Clients) XXX_Size() int { - return m.Size() -} -func (m *Clients) XXX_DiscardUnknown() { - xxx_messageInfo_Clients.DiscardUnknown(m) -} - -var xxx_messageInfo_Clients proto.InternalMessageInfo - -func (m *Clients) GetClients() []*Client { - if m != nil { - return m.Clients - } - return nil -} - -type DocumentKey struct { - Collection string `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"` - Document string `protobuf:"bytes,2,opt,name=document,proto3" json:"document,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DocumentKey) Reset() { *m = DocumentKey{} } -func (m *DocumentKey) String() string { return proto.CompactTextString(m) } -func (*DocumentKey) ProtoMessage() {} -func (*DocumentKey) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{33} -} -func (m *DocumentKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DocumentKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DocumentKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DocumentKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_DocumentKey.Merge(m, src) -} -func (m *DocumentKey) XXX_Size() int { - return m.Size() -} -func (m *DocumentKey) XXX_DiscardUnknown() { - xxx_messageInfo_DocumentKey.DiscardUnknown(m) -} - -var xxx_messageInfo_DocumentKey proto.InternalMessageInfo - -func (m *DocumentKey) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -func (m *DocumentKey) GetDocument() string { - if m != nil { - return m.Document - } - return "" -} - -type Checkpoint struct { - ServerSeq uint64 `protobuf:"varint,1,opt,name=server_seq,json=serverSeq,proto3" json:"server_seq,omitempty"` - ClientSeq uint32 `protobuf:"varint,2,opt,name=client_seq,json=clientSeq,proto3" json:"client_seq,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Checkpoint) Reset() { *m = Checkpoint{} } -func (m *Checkpoint) String() string { return proto.CompactTextString(m) } -func (*Checkpoint) ProtoMessage() {} -func (*Checkpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{34} -} -func (m *Checkpoint) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Checkpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Checkpoint.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + if m.DocumentKey != nil { + l = m.DocumentKey.Size() + n += 1 + l + sovYorkie(uint64(l)) } -} -func (m *Checkpoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_Checkpoint.Merge(m, src) -} -func (m *Checkpoint) XXX_Size() int { - return m.Size() -} -func (m *Checkpoint) XXX_DiscardUnknown() { - xxx_messageInfo_Checkpoint.DiscardUnknown(m) -} - -var xxx_messageInfo_Checkpoint proto.InternalMessageInfo - -func (m *Checkpoint) GetServerSeq() uint64 { - if m != nil { - return m.ServerSeq + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return 0 + return n } -func (m *Checkpoint) GetClientSeq() uint32 { - if m != nil { - return m.ClientSeq +func (m *ListChangesResponse) Size() (n int) { + if m == nil { + return 0 } - return 0 -} - -type TextNodePos struct { - CreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` - RelativeOffset int32 `protobuf:"varint,3,opt,name=relative_offset,json=relativeOffset,proto3" json:"relative_offset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TextNodePos) Reset() { *m = TextNodePos{} } -func (m *TextNodePos) String() string { return proto.CompactTextString(m) } -func (*TextNodePos) ProtoMessage() {} -func (*TextNodePos) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{35} -} -func (m *TextNodePos) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TextNodePos) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TextNodePos.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + var l int + _ = l + if len(m.Changes) > 0 { + for _, e := range m.Changes { + l = e.Size() + n += 1 + l + sovYorkie(uint64(l)) } - return b[:n], nil - } -} -func (m *TextNodePos) XXX_Merge(src proto.Message) { - xxx_messageInfo_TextNodePos.Merge(m, src) -} -func (m *TextNodePos) XXX_Size() int { - return m.Size() -} -func (m *TextNodePos) XXX_DiscardUnknown() { - xxx_messageInfo_TextNodePos.DiscardUnknown(m) -} - -var xxx_messageInfo_TextNodePos proto.InternalMessageInfo - -func (m *TextNodePos) GetCreatedAt() *TimeTicket { - if m != nil { - return m.CreatedAt - } - return nil -} - -func (m *TextNodePos) GetOffset() int32 { - if m != nil { - return m.Offset } - return 0 -} - -func (m *TextNodePos) GetRelativeOffset() int32 { - if m != nil { - return m.RelativeOffset + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return 0 -} - -type TimeTicket struct { - Lamport uint64 `protobuf:"varint,1,opt,name=lamport,proto3" json:"lamport,omitempty"` - Delimiter uint32 `protobuf:"varint,2,opt,name=delimiter,proto3" json:"delimiter,omitempty"` - ActorId []byte `protobuf:"bytes,3,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + return n } -func (m *TimeTicket) Reset() { *m = TimeTicket{} } -func (m *TimeTicket) String() string { return proto.CompactTextString(m) } -func (*TimeTicket) ProtoMessage() {} -func (*TimeTicket) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{36} +func sovYorkie(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } -func (m *TimeTicket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func sozYorkie(x uint64) (n int) { + return sovYorkie(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *TimeTicket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TimeTicket.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TimeTicket) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeTicket.Merge(m, src) -} -func (m *TimeTicket) XXX_Size() int { - return m.Size() -} -func (m *TimeTicket) XXX_DiscardUnknown() { - xxx_messageInfo_TimeTicket.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeTicket proto.InternalMessageInfo - -func (m *TimeTicket) GetLamport() uint64 { - if m != nil { - return m.Lamport - } - return 0 -} - -func (m *TimeTicket) GetDelimiter() uint32 { - if m != nil { - return m.Delimiter - } - return 0 -} - -func (m *TimeTicket) GetActorId() []byte { - if m != nil { - return m.ActorId - } - return nil -} - -type DocEvent struct { - Type DocEventType `protobuf:"varint,1,opt,name=type,proto3,enum=api.DocEventType" json:"type,omitempty"` - Publisher *Client `protobuf:"bytes,2,opt,name=publisher,proto3" json:"publisher,omitempty"` - DocumentKeys []*DocumentKey `protobuf:"bytes,3,rep,name=document_keys,json=documentKeys,proto3" json:"document_keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DocEvent) Reset() { *m = DocEvent{} } -func (m *DocEvent) String() string { return proto.CompactTextString(m) } -func (*DocEvent) ProtoMessage() {} -func (*DocEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{37} -} -func (m *DocEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DocEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DocEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DocEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_DocEvent.Merge(m, src) -} -func (m *DocEvent) XXX_Size() int { - return m.Size() -} -func (m *DocEvent) XXX_DiscardUnknown() { - xxx_messageInfo_DocEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_DocEvent proto.InternalMessageInfo - -func (m *DocEvent) GetType() DocEventType { - if m != nil { - return m.Type - } - return DocEventType_DOCUMENTS_CHANGED -} - -func (m *DocEvent) GetPublisher() *Client { - if m != nil { - return m.Publisher - } - return nil -} - -func (m *DocEvent) GetDocumentKeys() []*DocumentKey { - if m != nil { - return m.DocumentKeys - } - return nil -} - -func init() { - proto.RegisterEnum("api.ValueType", ValueType_name, ValueType_value) - proto.RegisterEnum("api.DocEventType", DocEventType_name, DocEventType_value) - proto.RegisterType((*BroadcastEventRequest)(nil), "api.BroadcastEventRequest") - proto.RegisterType((*BroadcastEventResponse)(nil), "api.BroadcastEventResponse") - proto.RegisterType((*ActivateClientRequest)(nil), "api.ActivateClientRequest") - proto.RegisterType((*ActivateClientResponse)(nil), "api.ActivateClientResponse") - proto.RegisterType((*DeactivateClientRequest)(nil), "api.DeactivateClientRequest") - proto.RegisterType((*DeactivateClientResponse)(nil), "api.DeactivateClientResponse") - proto.RegisterType((*AttachDocumentRequest)(nil), "api.AttachDocumentRequest") - proto.RegisterType((*AttachDocumentResponse)(nil), "api.AttachDocumentResponse") - proto.RegisterType((*DetachDocumentRequest)(nil), "api.DetachDocumentRequest") - proto.RegisterType((*DetachDocumentResponse)(nil), "api.DetachDocumentResponse") - proto.RegisterType((*WatchDocumentsRequest)(nil), "api.WatchDocumentsRequest") - proto.RegisterType((*WatchDocumentsResponse)(nil), "api.WatchDocumentsResponse") - proto.RegisterType((*WatchDocumentsResponse_Initialization)(nil), "api.WatchDocumentsResponse.Initialization") - proto.RegisterMapType((map[string]*Clients)(nil), "api.WatchDocumentsResponse.Initialization.PeersMapByDocEntry") - proto.RegisterType((*PushPullRequest)(nil), "api.PushPullRequest") - proto.RegisterType((*PushPullResponse)(nil), "api.PushPullResponse") - proto.RegisterType((*UpdateMetadataRequest)(nil), "api.UpdateMetadataRequest") - proto.RegisterType((*UpdateMetadataResponse)(nil), "api.UpdateMetadataResponse") - proto.RegisterType((*FetchHistoryRequest)(nil), "api.FetchHistoryRequest") - proto.RegisterType((*FetchHistoryResponse)(nil), "api.FetchHistoryResponse") - proto.RegisterType((*ChangePack)(nil), "api.ChangePack") - proto.RegisterType((*Change)(nil), "api.Change") - proto.RegisterType((*ChangeID)(nil), "api.ChangeID") - proto.RegisterType((*Operation)(nil), "api.Operation") - proto.RegisterType((*Operation_Set)(nil), "api.Operation.Set") - proto.RegisterType((*Operation_Add)(nil), "api.Operation.Add") - proto.RegisterType((*Operation_Move)(nil), "api.Operation.Move") - proto.RegisterType((*Operation_Remove)(nil), "api.Operation.Remove") - proto.RegisterType((*Operation_Edit)(nil), "api.Operation.Edit") - proto.RegisterMapType((map[string]*TimeTicket)(nil), "api.Operation.Edit.CreatedAtMapByActorEntry") - proto.RegisterType((*Operation_Select)(nil), "api.Operation.Select") - proto.RegisterType((*Operation_RichEdit)(nil), "api.Operation.RichEdit") - proto.RegisterMapType((map[string]string)(nil), "api.Operation.RichEdit.AttributesEntry") - proto.RegisterMapType((map[string]*TimeTicket)(nil), "api.Operation.RichEdit.CreatedAtMapByActorEntry") - proto.RegisterType((*Operation_Style)(nil), "api.Operation.Style") - proto.RegisterMapType((map[string]string)(nil), "api.Operation.Style.AttributesEntry") - proto.RegisterType((*Operation_Increase)(nil), "api.Operation.Increase") - proto.RegisterType((*JSONElementSimple)(nil), "api.JSONElementSimple") - proto.RegisterType((*JSONElement)(nil), "api.JSONElement") - proto.RegisterType((*JSONElement_JSONObject)(nil), "api.JSONElement.JSONObject") - proto.RegisterType((*JSONElement_JSONArray)(nil), "api.JSONElement.JSONArray") - proto.RegisterType((*JSONElement_Primitive)(nil), "api.JSONElement.Primitive") - proto.RegisterType((*JSONElement_Text)(nil), "api.JSONElement.Text") - proto.RegisterType((*JSONElement_RichText)(nil), "api.JSONElement.RichText") - proto.RegisterType((*JSONElement_Counter)(nil), "api.JSONElement.Counter") - proto.RegisterType((*RHTNode)(nil), "api.RHTNode") - proto.RegisterType((*RGANode)(nil), "api.RGANode") - proto.RegisterType((*TextNode)(nil), "api.TextNode") - proto.RegisterType((*RichTextNodeAttr)(nil), "api.RichTextNodeAttr") - proto.RegisterType((*RichTextNode)(nil), "api.RichTextNode") - proto.RegisterMapType((map[string]*RichTextNodeAttr)(nil), "api.RichTextNode.AttributesEntry") - proto.RegisterType((*TextNodeID)(nil), "api.TextNodeID") - proto.RegisterType((*Metadata)(nil), "api.Metadata") - proto.RegisterMapType((map[string]string)(nil), "api.Metadata.DataEntry") - proto.RegisterType((*Client)(nil), "api.Client") - proto.RegisterType((*Clients)(nil), "api.Clients") - proto.RegisterType((*DocumentKey)(nil), "api.DocumentKey") - proto.RegisterType((*Checkpoint)(nil), "api.Checkpoint") - proto.RegisterType((*TextNodePos)(nil), "api.TextNodePos") - proto.RegisterType((*TimeTicket)(nil), "api.TimeTicket") - proto.RegisterType((*DocEvent)(nil), "api.DocEvent") -} - -func init() { proto.RegisterFile("api/yorkie.proto", fileDescriptor_9df40050e88fbc16) } - -var fileDescriptor_9df40050e88fbc16 = []byte{ - // 2490 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x3a, 0xcd, 0x6f, 0xdb, 0xc8, - 0xf5, 0xa2, 0x44, 0x7d, 0xf0, 0x49, 0x96, 0x99, 0x49, 0xec, 0x68, 0xb5, 0x49, 0x7e, 0x09, 0xb3, - 0xf9, 0xe5, 0x63, 0x03, 0x27, 0xf0, 0x76, 0x93, 0xed, 0x2e, 0x52, 0x80, 0xb6, 0x54, 0x4b, 0x9b, - 0x58, 0x76, 0x69, 0x65, 0xd3, 0x9c, 0x54, 0x9a, 0x1c, 0xc7, 0x8c, 0x25, 0x91, 0x21, 0x29, 0x23, - 0xea, 0xa1, 0x40, 0x2f, 0x3d, 0xf4, 0xda, 0x1e, 0x7a, 0x2e, 0x0a, 0xec, 0x3f, 0x50, 0xa0, 0x87, - 0x16, 0xc8, 0xa1, 0x97, 0xdc, 0xb6, 0x3d, 0x16, 0x05, 0x8a, 0x45, 0x7a, 0xe9, 0xb9, 0x7f, 0x41, - 0x31, 0x1f, 0xa4, 0x48, 0x8a, 0xb6, 0xac, 0x66, 0xb3, 0x6b, 0xf4, 0xc6, 0x99, 0xf7, 0x3d, 0xef, - 0xcd, 0xbc, 0xc7, 0x79, 0x03, 0xb2, 0xee, 0x58, 0x77, 0xc6, 0xb6, 0x7b, 0x60, 0xe1, 0x15, 0xc7, - 0xb5, 0x7d, 0x1b, 0xe5, 0x74, 0xc7, 0x52, 0x7a, 0xb0, 0xb4, 0xe6, 0xda, 0xba, 0x69, 0xe8, 0x9e, - 0xdf, 0x3c, 0xc4, 0x43, 0x5f, 0xc3, 0x2f, 0x46, 0xd8, 0xf3, 0xd1, 0x15, 0xa8, 0x38, 0xa3, 0xdd, - 0xbe, 0xe5, 0xed, 0x63, 0xb7, 0x67, 0x99, 0x35, 0xe1, 0xb2, 0x70, 0xa3, 0xa2, 0x95, 0xc3, 0xb9, - 0xb6, 0x89, 0xae, 0x42, 0x1e, 0x13, 0x92, 0x5a, 0xf6, 0xb2, 0x70, 0xa3, 0xbc, 0xba, 0xb0, 0xa2, - 0x3b, 0xd6, 0x4a, 0xc3, 0x36, 0x18, 0x1f, 0x06, 0x53, 0x6a, 0xb0, 0x9c, 0x14, 0xe0, 0x39, 0xf6, - 0xd0, 0xc3, 0xca, 0x3d, 0x58, 0x52, 0x0d, 0xdf, 0x3a, 0xd4, 0x7d, 0xbc, 0xde, 0xb7, 0x22, 0xa2, - 0x2f, 0x02, 0x18, 0x74, 0xa2, 0x77, 0x80, 0xc7, 0x54, 0xb0, 0xa4, 0x49, 0x6c, 0xe6, 0x21, 0x1e, - 0x2b, 0x5d, 0x58, 0x4e, 0xd2, 0x31, 0x8e, 0x33, 0x08, 0xd1, 0xfb, 0xc0, 0x07, 0xc4, 0x9e, 0x2c, - 0xb5, 0xa7, 0xc4, 0x26, 0xda, 0xa6, 0x72, 0x0f, 0xce, 0x37, 0xb0, 0x9e, 0xaa, 0x4f, 0x8c, 0x4e, - 0x48, 0xd0, 0xdd, 0x87, 0xda, 0x34, 0x1d, 0xd7, 0xe7, 0x58, 0xc2, 0x3d, 0x58, 0x52, 0x7d, 0x5f, - 0x37, 0xf6, 0x1b, 0xb6, 0x31, 0x1a, 0x9c, 0x50, 0x1c, 0xba, 0x0b, 0x65, 0x63, 0x5f, 0x1f, 0x3e, - 0xc3, 0x3d, 0x47, 0x37, 0x0e, 0xf8, 0xca, 0x2f, 0xd2, 0x95, 0x5f, 0xa7, 0xf3, 0xdb, 0xba, 0x71, - 0xa0, 0x81, 0x11, 0x7e, 0x2b, 0xcf, 0x60, 0x39, 0x29, 0xe7, 0x04, 0xea, 0xfd, 0x17, 0x82, 0xf6, - 0x60, 0xa9, 0x81, 0xbf, 0x05, 0x83, 0x2c, 0x58, 0x4e, 0xca, 0x39, 0x99, 0xff, 0xe7, 0x17, 0xe5, - 0xc1, 0xd2, 0x13, 0xdd, 0x9f, 0x48, 0xf2, 0x02, 0x93, 0xae, 0x42, 0x81, 0xf1, 0xa5, 0x52, 0xca, - 0xab, 0x65, 0xc6, 0x85, 0xb9, 0x9f, 0x83, 0xd0, 0xc7, 0xb0, 0x60, 0x72, 0x42, 0xa2, 0x90, 0x57, - 0xcb, 0x5e, 0xce, 0xdd, 0x28, 0xaf, 0xca, 0xc1, 0x3e, 0xa1, 0x90, 0x87, 0x78, 0xac, 0x55, 0xcc, - 0xc9, 0xc0, 0x53, 0xfe, 0x95, 0x85, 0xe5, 0xa4, 0x54, 0x6e, 0x60, 0x17, 0xaa, 0xd6, 0xd0, 0xf2, - 0x2d, 0xbd, 0x6f, 0xfd, 0x54, 0xf7, 0x2d, 0x7b, 0xc8, 0xc5, 0xdf, 0xa2, 0x2c, 0xd3, 0x89, 0x56, - 0xda, 0x31, 0x8a, 0x56, 0x46, 0x4b, 0xf0, 0x40, 0xd7, 0x8e, 0xdb, 0xc7, 0xad, 0x0c, 0xdf, 0xc9, - 0xf5, 0xd7, 0x02, 0x54, 0xe3, 0xbc, 0xd0, 0x1e, 0xc8, 0x0e, 0xc6, 0xae, 0xd7, 0x1b, 0xe8, 0x4e, - 0x6f, 0x77, 0xdc, 0x33, 0x6d, 0xa3, 0x26, 0x50, 0x23, 0x1f, 0x9c, 0x5c, 0xa3, 0x95, 0x6d, 0xc2, - 0x62, 0x53, 0x77, 0xd6, 0xc6, 0x44, 0xe8, 0xd0, 0x77, 0xc7, 0xda, 0x82, 0x13, 0x9d, 0xab, 0x77, - 0x00, 0x4d, 0x23, 0x21, 0x19, 0x72, 0x13, 0x3f, 0x93, 0x4f, 0xa4, 0x40, 0xfe, 0x50, 0xef, 0x8f, - 0x30, 0xb7, 0xa4, 0x12, 0xf1, 0x8a, 0xa7, 0x31, 0xd0, 0xa7, 0xd9, 0x4f, 0x84, 0xb5, 0x02, 0x88, - 0xbb, 0xb6, 0x39, 0x56, 0x7e, 0x02, 0x8b, 0xdb, 0x23, 0x6f, 0x7f, 0x7b, 0xd4, 0xef, 0xbf, 0xa3, - 0x60, 0xd5, 0x41, 0x9e, 0x48, 0x78, 0x37, 0xfb, 0xce, 0x83, 0xa5, 0xc7, 0x8e, 0xa9, 0xfb, 0x78, - 0x13, 0xfb, 0xba, 0xa9, 0xfb, 0xfa, 0xb7, 0x11, 0xa4, 0x35, 0x58, 0x4e, 0x0a, 0xe5, 0xc7, 0xfa, - 0x33, 0x38, 0xfb, 0x43, 0xec, 0x1b, 0xfb, 0x2d, 0xcb, 0xf3, 0x6d, 0x77, 0x7c, 0xa2, 0x75, 0xfd, - 0x08, 0x2a, 0x51, 0x25, 0xb8, 0xd5, 0xd3, 0x3a, 0x94, 0x23, 0x3a, 0x28, 0x0f, 0xe0, 0x5c, 0x5c, - 0x10, 0x5f, 0xde, 0x6b, 0x50, 0x64, 0xab, 0xe3, 0xf1, 0x58, 0x2c, 0x47, 0x56, 0x4f, 0x0b, 0x60, - 0xca, 0xbf, 0x05, 0x80, 0xc9, 0x8a, 0x4e, 0xa9, 0x20, 0x9c, 0x40, 0x05, 0x74, 0x07, 0xc0, 0xd8, - 0xc7, 0xc6, 0x81, 0x63, 0x5b, 0xe1, 0xf6, 0x09, 0x7c, 0x15, 0x4c, 0x6b, 0x11, 0x14, 0x54, 0x87, - 0x92, 0x37, 0xd4, 0x1d, 0x6f, 0xdf, 0xf6, 0x6b, 0x39, 0xb6, 0x08, 0xc1, 0x38, 0xaa, 0xb7, 0x78, - 0xb4, 0xde, 0xe8, 0x33, 0x38, 0x33, 0xb0, 0x86, 0x3d, 0x6f, 0x3c, 0x34, 0xb0, 0xd9, 0xf3, 0x2d, - 0xe3, 0x00, 0xfb, 0xb5, 0x7c, 0x44, 0x74, 0xd7, 0x1a, 0xe0, 0x2e, 0x9d, 0xd6, 0x16, 0x07, 0xd6, - 0x70, 0x87, 0x22, 0xb2, 0x09, 0xe5, 0x05, 0x14, 0x18, 0x3f, 0x74, 0x11, 0xb2, 0xdc, 0x11, 0xc1, - 0x8e, 0x67, 0x80, 0x76, 0x43, 0xcb, 0x5a, 0x26, 0xaa, 0x41, 0x71, 0x80, 0x3d, 0x4f, 0x7f, 0xc6, - 0xf6, 0x92, 0xa4, 0x05, 0x43, 0xb4, 0x02, 0x60, 0x3b, 0xd8, 0xa5, 0x5b, 0xd7, 0xab, 0xe5, 0xa8, - 0xa6, 0x55, 0xca, 0x60, 0x2b, 0x98, 0xd6, 0x22, 0x18, 0xca, 0xcf, 0x05, 0x28, 0x05, 0xac, 0x23, - 0x27, 0xb4, 0x87, 0x5f, 0x50, 0xe9, 0x0b, 0xc1, 0x09, 0xbd, 0x83, 0x5f, 0x10, 0xb0, 0x87, 0xdd, - 0x43, 0xec, 0x52, 0x30, 0x11, 0x2c, 0x6a, 0x12, 0x9b, 0x21, 0xe0, 0x0b, 0x50, 0xec, 0xeb, 0x03, - 0xc7, 0x76, 0xd9, 0xe2, 0x89, 0x6b, 0xd9, 0xbb, 0x82, 0x16, 0x4c, 0xa1, 0xf7, 0xa0, 0xa4, 0x1b, - 0xbe, 0x4d, 0xab, 0x15, 0x91, 0xae, 0x6d, 0x91, 0x8e, 0xdb, 0xa6, 0xf2, 0x7a, 0x19, 0xa4, 0x50, - 0x3b, 0xf4, 0xff, 0x90, 0xf3, 0x70, 0xb0, 0x29, 0x50, 0x5c, 0xf5, 0x95, 0x1d, 0x4c, 0x8e, 0x3c, - 0x82, 0x40, 0xf0, 0x74, 0xd3, 0xe4, 0x6e, 0x4d, 0xe2, 0xa9, 0xa6, 0x49, 0xf0, 0x74, 0xd3, 0x44, - 0x37, 0x41, 0x1c, 0xd8, 0x87, 0x98, 0xea, 0x54, 0x5e, 0x3d, 0x9b, 0x40, 0xdc, 0xb4, 0x0f, 0x71, - 0x2b, 0xa3, 0x51, 0x14, 0x74, 0x07, 0x0a, 0x2e, 0xa6, 0xc8, 0x22, 0x45, 0x5e, 0x4a, 0x20, 0x6b, - 0x14, 0xd8, 0xca, 0x68, 0x1c, 0x8d, 0xf0, 0xc6, 0xa6, 0x15, 0x38, 0x38, 0xc9, 0xbb, 0x69, 0x5a, - 0x44, 0x5b, 0x8a, 0x42, 0x78, 0x7b, 0xb8, 0x8f, 0x0d, 0xbf, 0x56, 0x48, 0xe5, 0xbd, 0x43, 0x81, - 0x84, 0x37, 0x43, 0x43, 0xf7, 0x40, 0x72, 0x2d, 0x63, 0xbf, 0x47, 0x05, 0x14, 0x29, 0xcd, 0xf9, - 0xa4, 0x3e, 0x96, 0xb1, 0xcf, 0x85, 0x94, 0x5c, 0xfe, 0x8d, 0x6e, 0x43, 0xde, 0xf3, 0xc7, 0x7d, - 0x5c, 0x2b, 0x51, 0x9a, 0x73, 0x49, 0x39, 0x04, 0x46, 0xd2, 0x06, 0x45, 0x42, 0x1f, 0x43, 0xc9, - 0x1a, 0x1a, 0x2e, 0xd6, 0x3d, 0x5c, 0x93, 0x52, 0x85, 0xb4, 0x39, 0x98, 0x08, 0x09, 0x50, 0xeb, - 0xbf, 0x17, 0x20, 0xb7, 0x83, 0x7d, 0x12, 0xee, 0x8e, 0xee, 0x92, 0x88, 0x21, 0x00, 0x1f, 0x9b, - 0x3d, 0x3d, 0x70, 0xdd, 0x74, 0xb8, 0x33, 0xcc, 0x75, 0x86, 0xa8, 0xfa, 0x41, 0x86, 0xc8, 0x4e, - 0x32, 0xc4, 0xed, 0x20, 0x43, 0x30, 0x67, 0x2d, 0x53, 0x16, 0x9f, 0xef, 0x6c, 0x75, 0x9a, 0x7d, - 0x4c, 0x76, 0xf5, 0x8e, 0x35, 0x70, 0xfa, 0x98, 0xe7, 0x0a, 0x72, 0x18, 0xe3, 0x97, 0xd8, 0x18, - 0x71, 0xb1, 0x62, 0xba, 0x58, 0x08, 0x70, 0x54, 0xbf, 0xfe, 0x77, 0x01, 0x72, 0xaa, 0x69, 0xbe, - 0x9d, 0xda, 0xf7, 0x61, 0xd1, 0x71, 0xf1, 0x61, 0x94, 0x34, 0x9b, 0x4e, 0xba, 0x40, 0xf0, 0x26, - 0x84, 0xef, 0xda, 0xba, 0x7f, 0x08, 0x20, 0x92, 0x78, 0xfe, 0x8e, 0xcc, 0x5b, 0x01, 0x88, 0xd0, - 0xe4, 0xd2, 0x69, 0x24, 0x23, 0xc4, 0x9f, 0xdf, 0xc0, 0x2f, 0x05, 0x28, 0xb0, 0x3d, 0xf8, 0x76, - 0x26, 0xc6, 0x35, 0xcd, 0xce, 0xab, 0x69, 0x6e, 0xb6, 0xa6, 0xbf, 0xce, 0x81, 0x48, 0x77, 0xe3, - 0x5b, 0xe9, 0xf9, 0x01, 0x88, 0x7b, 0xae, 0x3d, 0x88, 0x25, 0xdc, 0x2e, 0x7e, 0xe9, 0x77, 0x6c, - 0x13, 0x6f, 0xdb, 0x9e, 0x46, 0xa1, 0xe8, 0x32, 0x64, 0x7d, 0x9b, 0x2b, 0x35, 0x8d, 0x93, 0xf5, - 0x6d, 0xb4, 0x0b, 0xe7, 0x27, 0xd2, 0x83, 0x6a, 0x90, 0x9e, 0xbe, 0x3c, 0x97, 0xdd, 0x4e, 0x39, - 0xb9, 0x56, 0x42, 0x3d, 0x68, 0x5d, 0xa7, 0x12, 0x74, 0x56, 0xfe, 0x9d, 0x35, 0xa6, 0x21, 0x24, - 0x25, 0x19, 0xf6, 0xd0, 0x27, 0xf5, 0x4c, 0x9e, 0xa5, 0x24, 0x3e, 0x4c, 0xae, 0x5e, 0x61, 0xf6, - 0xea, 0x3d, 0x81, 0xda, 0x51, 0xc2, 0x53, 0xca, 0xca, 0x6b, 0xf1, 0xb2, 0x72, 0x8a, 0xf3, 0xa4, - 0xb2, 0xac, 0xbf, 0x12, 0xa0, 0xc0, 0x0e, 0xda, 0xd3, 0xe1, 0x98, 0xf9, 0xb7, 0xc0, 0xef, 0x44, - 0x28, 0x05, 0xc7, 0xfe, 0xe9, 0xb0, 0x61, 0x6f, 0x56, 0x70, 0xdd, 0x3d, 0x22, 0x6b, 0x7d, 0x63, - 0x01, 0xb6, 0x01, 0xa0, 0xfb, 0xbe, 0x6b, 0xed, 0x8e, 0x7c, 0xec, 0xd5, 0x0a, 0x54, 0xe8, 0xf5, - 0xa3, 0x84, 0xaa, 0x21, 0x26, 0x93, 0x15, 0x21, 0x4d, 0xba, 0xa3, 0xf8, 0x1d, 0x46, 0xea, 0x03, - 0x58, 0x4c, 0x68, 0x9a, 0xc2, 0xef, 0x5c, 0x94, 0x9f, 0x14, 0x25, 0xff, 0x73, 0x16, 0xf2, 0x34, - 0xd3, 0x9f, 0x8e, 0x18, 0x69, 0xc4, 0x3c, 0xc4, 0xc2, 0xe2, 0x83, 0xb4, 0xc2, 0x64, 0x1e, 0xf7, - 0xe4, 0x67, 0xbb, 0xe7, 0x2d, 0x57, 0xf1, 0x4b, 0x01, 0x4a, 0x41, 0xf9, 0xf3, 0x76, 0x0b, 0x79, - 0x3b, 0xee, 0xf9, 0xf9, 0x52, 0xff, 0xec, 0x7c, 0x13, 0xfe, 0x32, 0xff, 0x4d, 0x80, 0x33, 0x53, - 0x6c, 0x13, 0xf9, 0x4e, 0x98, 0x99, 0xef, 0x6e, 0x41, 0x89, 0x24, 0xd9, 0xe3, 0xb2, 0x63, 0x91, - 0x22, 0xb0, 0x5c, 0xca, 0x8a, 0xe1, 0x63, 0xb3, 0x3e, 0x47, 0x51, 0x7d, 0xa4, 0x80, 0xe8, 0x8f, - 0x1d, 0x56, 0x61, 0x57, 0xf9, 0xaf, 0xc9, 0x17, 0xc4, 0xea, 0xee, 0xd8, 0xc1, 0x1a, 0x85, 0x4d, - 0x3c, 0x92, 0xa7, 0x3f, 0x0a, 0x6c, 0xa0, 0xfc, 0xb2, 0x02, 0xe5, 0x88, 0x6d, 0xe8, 0x07, 0x50, - 0x7e, 0xee, 0xd9, 0xc3, 0x9e, 0xbd, 0xfb, 0x9c, 0x94, 0xd5, 0xcc, 0xac, 0xf7, 0x93, 0x2b, 0x4b, - 0xbf, 0xb7, 0x28, 0x4a, 0x2b, 0xa3, 0x01, 0xa1, 0x60, 0x23, 0xf4, 0x19, 0xd0, 0x51, 0x4f, 0x77, - 0x5d, 0x3d, 0xf8, 0xa9, 0xad, 0xa7, 0x92, 0xab, 0x04, 0xa3, 0x95, 0xd1, 0x24, 0x82, 0x4f, 0x07, - 0xe8, 0x53, 0x90, 0x1c, 0xd7, 0x1a, 0x58, 0xbe, 0x15, 0xfe, 0x5a, 0x4c, 0xd3, 0x6e, 0x07, 0x18, - 0x84, 0x36, 0x44, 0x47, 0x1f, 0x82, 0xe8, 0xe3, 0x97, 0x7e, 0xec, 0x27, 0x23, 0x4a, 0x46, 0x76, - 0x0f, 0xf9, 0x6f, 0x20, 0x48, 0xe8, 0x13, 0xfe, 0x1b, 0x40, 0x29, 0x58, 0xc8, 0xbf, 0x37, 0x45, - 0x41, 0x4e, 0x37, 0x4e, 0x45, 0x7f, 0x04, 0xc8, 0x37, 0xfa, 0x1e, 0x39, 0x30, 0x47, 0x43, 0x1f, - 0xbb, 0x3c, 0xe7, 0xd6, 0xa6, 0xe8, 0xd6, 0x19, 0xbc, 0x95, 0xd1, 0x02, 0xd4, 0xfa, 0x9f, 0x04, - 0x80, 0xc9, 0x92, 0x21, 0x05, 0xf2, 0x43, 0xdb, 0x0c, 0x7f, 0xd6, 0xd9, 0x9d, 0x8d, 0xd6, 0xea, - 0x92, 0xdd, 0xad, 0x31, 0xd0, 0xdc, 0xe5, 0x54, 0x34, 0xbc, 0x72, 0x73, 0x85, 0x97, 0x38, 0x2b, - 0xbc, 0xea, 0x7f, 0x14, 0x40, 0x0a, 0x5d, 0x76, 0x84, 0xf6, 0x1b, 0xea, 0x69, 0xd5, 0xfe, 0xaf, - 0x02, 0x48, 0x61, 0xd0, 0x84, 0x5b, 0x45, 0x38, 0xc9, 0x56, 0xc9, 0x46, 0xb6, 0xca, 0xdc, 0xa5, - 0x78, 0xd4, 0x26, 0x71, 0x2e, 0x9b, 0xf2, 0x33, 0x6d, 0xfa, 0x83, 0x00, 0x22, 0x8d, 0xc7, 0xab, - 0x71, 0x67, 0x2c, 0xc4, 0x32, 0xc5, 0x69, 0xf4, 0xc6, 0x2b, 0x81, 0xd5, 0x5a, 0x54, 0xfb, 0xeb, - 0x71, 0xed, 0xcf, 0xb0, 0x50, 0xe2, 0xd0, 0xd3, 0x6a, 0xc1, 0x57, 0x02, 0x14, 0xf9, 0x1e, 0xff, - 0xdf, 0x88, 0x26, 0x92, 0xe8, 0xd6, 0x48, 0xa2, 0xdb, 0x80, 0x22, 0x3f, 0x85, 0x52, 0x32, 0xfa, - 0x2d, 0x28, 0x62, 0x76, 0xc2, 0xc5, 0x2a, 0x97, 0xc8, 0xc9, 0xa7, 0x05, 0x08, 0xca, 0x13, 0x28, - 0xf2, 0x03, 0x01, 0x5d, 0x06, 0x71, 0x48, 0x4e, 0x59, 0x21, 0x72, 0x3d, 0x1d, 0x1c, 0x16, 0x14, - 0x32, 0x17, 0xe3, 0xdf, 0x0a, 0x50, 0x0a, 0x62, 0x03, 0xfd, 0x5f, 0xe4, 0x3e, 0x6f, 0x31, 0x16, - 0xf8, 0xfc, 0x46, 0x2f, 0xb5, 0x08, 0x99, 0x3b, 0xb9, 0xde, 0x81, 0xb2, 0x35, 0xf4, 0x7a, 0xf4, - 0xff, 0x9d, 0xdf, 0xb3, 0xa5, 0xc8, 0x93, 0xac, 0xa1, 0xb7, 0xed, 0xe2, 0xc3, 0xb6, 0xa9, 0x3c, - 0x07, 0x39, 0x1a, 0xc3, 0xa4, 0x58, 0x3a, 0x69, 0x85, 0x44, 0x94, 0x1b, 0xd1, 0x4b, 0xe6, 0x63, - 0x95, 0xe3, 0x28, 0xaa, 0xaf, 0xbc, 0xca, 0x42, 0x25, 0x2a, 0x6c, 0xf6, 0xa2, 0xa8, 0xb1, 0xb2, - 0x91, 0x5d, 0x7d, 0x5f, 0x99, 0xda, 0x78, 0xc7, 0xd6, 0x8c, 0xe7, 0xa2, 0x77, 0x2e, 0x47, 0xac, - 0xab, 0x38, 0xef, 0xba, 0xe6, 0x67, 0xad, 0x6b, 0xbd, 0x7b, 0x92, 0xc2, 0xf3, 0xc3, 0x78, 0x51, - 0xb8, 0x34, 0x65, 0x19, 0x61, 0x11, 0xa9, 0x47, 0x95, 0x2e, 0xc0, 0x44, 0xdc, 0xdc, 0x55, 0xdd, - 0x32, 0x14, 0xec, 0xbd, 0x3d, 0x0f, 0xb3, 0xd8, 0xcd, 0x6b, 0x7c, 0xa4, 0xfc, 0x42, 0x80, 0x52, - 0xd0, 0x27, 0x20, 0xeb, 0x65, 0xf4, 0x6d, 0xe3, 0x80, 0xf2, 0xcb, 0x6b, 0x6c, 0x40, 0x2a, 0x16, - 0x02, 0xe5, 0x2e, 0x60, 0x37, 0x84, 0x01, 0xc9, 0x4a, 0x43, 0xf7, 0x75, 0xb6, 0xf0, 0x14, 0xa9, - 0x7e, 0x1f, 0xa4, 0x70, 0x6a, 0x9e, 0x72, 0x5b, 0x59, 0x87, 0x02, 0x6b, 0x7f, 0xa0, 0x6a, 0x18, - 0x19, 0x15, 0x1a, 0x08, 0x37, 0xa1, 0x34, 0xe0, 0xe2, 0x62, 0x6d, 0xb0, 0xb0, 0xbd, 0x11, 0x82, - 0x95, 0xbb, 0x50, 0xe4, 0x2d, 0x25, 0x7a, 0x65, 0xcf, 0x3e, 0xe3, 0xad, 0x06, 0xd6, 0x62, 0x09, - 0x60, 0x4a, 0x1b, 0xca, 0x91, 0x16, 0x02, 0xba, 0x04, 0x60, 0xd8, 0xfd, 0x3e, 0x36, 0xc2, 0x0e, - 0x9e, 0xa4, 0x45, 0x66, 0x50, 0x1d, 0x4a, 0x41, 0x93, 0x81, 0x9b, 0x10, 0x8e, 0x95, 0x0e, 0xc0, - 0xa4, 0xb5, 0x80, 0xae, 0xc4, 0xee, 0xcb, 0x85, 0xf0, 0x4e, 0x3c, 0x72, 0x67, 0x1e, 0xbf, 0x71, - 0xcf, 0x26, 0x6e, 0xdc, 0x95, 0x9f, 0x41, 0x39, 0xf2, 0x2b, 0xf5, 0x4d, 0x79, 0x1c, 0x5d, 0x87, - 0x45, 0x17, 0xf7, 0x75, 0x52, 0x64, 0xf4, 0x38, 0x42, 0x8e, 0x22, 0x54, 0x83, 0xe9, 0x2d, 0x16, - 0x1a, 0x06, 0xc0, 0x84, 0x73, 0xf4, 0x82, 0x5f, 0x98, 0xbe, 0xe0, 0xbf, 0x00, 0x92, 0x89, 0xfb, - 0xa4, 0x76, 0xc1, 0x6e, 0x60, 0x49, 0x38, 0x11, 0xbb, 0xfe, 0xcf, 0xc5, 0xaf, 0xff, 0x7f, 0x25, - 0x40, 0x29, 0xe8, 0x67, 0xa2, 0x6b, 0xb1, 0x2c, 0x75, 0x26, 0xd6, 0xec, 0x8c, 0x24, 0xaa, 0x9b, - 0x20, 0x85, 0x6f, 0x1d, 0x78, 0x44, 0xc4, 0x9c, 0x3b, 0x81, 0x4e, 0xb7, 0xd0, 0x72, 0x27, 0x69, - 0xa1, 0xdd, 0xfa, 0x4a, 0x00, 0x29, 0x4c, 0x8f, 0xa8, 0x04, 0x62, 0xe7, 0xf1, 0xa3, 0x47, 0x72, - 0x06, 0x95, 0xa1, 0xb8, 0xb6, 0xb5, 0xf5, 0xa8, 0xa9, 0x76, 0x64, 0x81, 0x0c, 0xda, 0x9d, 0x6e, - 0x73, 0xa3, 0xa9, 0xc9, 0x59, 0x82, 0xf3, 0x68, 0xab, 0xb3, 0x21, 0xe7, 0x10, 0x40, 0xa1, 0xb1, - 0xf5, 0x78, 0xed, 0x51, 0x53, 0x16, 0xc9, 0xf7, 0x4e, 0x57, 0x6b, 0x77, 0x36, 0xe4, 0x3c, 0x92, - 0x20, 0xbf, 0xf6, 0xb4, 0xdb, 0xdc, 0x91, 0x0b, 0x04, 0xb9, 0xa1, 0x76, 0x9b, 0x72, 0x11, 0x2d, - 0xb2, 0xbf, 0x9a, 0xde, 0xd6, 0xda, 0xe7, 0xcd, 0xf5, 0xae, 0x5c, 0x42, 0x55, 0x56, 0x80, 0xf7, - 0x54, 0x4d, 0x53, 0x9f, 0xca, 0x12, 0x41, 0xed, 0x36, 0x7f, 0xdc, 0x95, 0x01, 0x2d, 0x80, 0xa4, - 0xb5, 0xd7, 0x5b, 0x3d, 0x3a, 0x2c, 0x13, 0x4a, 0x2e, 0xbd, 0xb7, 0xde, 0xe9, 0xca, 0x15, 0x54, - 0x81, 0x12, 0xd1, 0x80, 0x8e, 0x16, 0x08, 0x1f, 0xa6, 0x05, 0x1d, 0x57, 0x6f, 0x1d, 0x40, 0x25, - 0xba, 0x92, 0x68, 0x09, 0xce, 0x34, 0xb6, 0xd6, 0x1f, 0x6f, 0x36, 0x3b, 0xdd, 0x9d, 0xde, 0x7a, - 0x4b, 0xed, 0x6c, 0x34, 0x1b, 0x72, 0x26, 0x3e, 0xfd, 0x44, 0xed, 0xae, 0xb7, 0x9a, 0x0d, 0x59, - 0x40, 0xe7, 0xe1, 0xec, 0x64, 0xfa, 0x71, 0x27, 0x00, 0x64, 0xd1, 0x39, 0x90, 0x37, 0x9b, 0x5d, - 0xb5, 0xa1, 0x76, 0xd5, 0x90, 0x4b, 0x6e, 0xf5, 0x6b, 0x11, 0x0a, 0x4f, 0xe9, 0x7b, 0x16, 0xf4, - 0x10, 0xaa, 0xf1, 0x17, 0x21, 0x88, 0xfd, 0x29, 0xa5, 0x3e, 0x2f, 0xa9, 0xbf, 0x9f, 0x0a, 0xe3, - 0xdd, 0xcb, 0x0c, 0xfa, 0x11, 0xc8, 0xc9, 0x07, 0x1d, 0xe8, 0x02, 0x73, 0x65, 0xfa, 0xfb, 0x90, - 0xfa, 0xc5, 0x23, 0xa0, 0x21, 0xcb, 0x87, 0x50, 0x8d, 0x37, 0x4b, 0xb9, 0x7e, 0xa9, 0x6d, 0x5b, - 0xae, 0xdf, 0x11, 0xdd, 0x55, 0xca, 0x2c, 0xfe, 0x9e, 0x23, 0x30, 0x36, 0xed, 0x31, 0x49, 0x60, - 0x6c, 0xea, 0x03, 0x10, 0xc6, 0x2c, 0xfe, 0x96, 0x82, 0x33, 0x4b, 0x7d, 0xc8, 0xc1, 0x99, 0xa5, - 0x3f, 0xbe, 0x50, 0x32, 0x68, 0x13, 0xaa, 0xf1, 0x86, 0x3f, 0x67, 0x96, 0xfa, 0x84, 0x82, 0x33, - 0x4b, 0x7f, 0x21, 0xa0, 0x64, 0xee, 0x0a, 0xe8, 0xfb, 0x50, 0x0a, 0x5a, 0xe7, 0x88, 0xf5, 0x98, - 0x12, 0xbd, 0xfa, 0xfa, 0x52, 0x62, 0x36, 0xd4, 0xa4, 0x09, 0x95, 0x68, 0x6b, 0x18, 0xb1, 0xff, - 0xd2, 0x94, 0xb6, 0x74, 0xfd, 0xbd, 0x14, 0x48, 0xc0, 0x66, 0xf5, 0x0b, 0x72, 0xd2, 0x8f, 0x3c, - 0x72, 0xba, 0x3c, 0x84, 0x6a, 0xfc, 0x19, 0x13, 0xb7, 0x2d, 0xf5, 0xf1, 0x14, 0xb7, 0xed, 0x88, - 0x77, 0x4f, 0x99, 0x35, 0xf9, 0xf5, 0x9b, 0x4b, 0xc2, 0x5f, 0xde, 0x5c, 0x12, 0xbe, 0x7e, 0x73, - 0x49, 0xf8, 0xcd, 0x3f, 0x2f, 0x65, 0x76, 0x0b, 0xf4, 0x49, 0xd6, 0x47, 0xff, 0x09, 0x00, 0x00, - 0xff, 0xff, 0x31, 0x91, 0x93, 0x97, 0xa6, 0x25, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// YorkieClient is the client API for Yorkie service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type YorkieClient interface { - ActivateClient(ctx context.Context, in *ActivateClientRequest, opts ...grpc.CallOption) (*ActivateClientResponse, error) - DeactivateClient(ctx context.Context, in *DeactivateClientRequest, opts ...grpc.CallOption) (*DeactivateClientResponse, error) - UpdateMetadata(ctx context.Context, in *UpdateMetadataRequest, opts ...grpc.CallOption) (*UpdateMetadataResponse, error) - AttachDocument(ctx context.Context, in *AttachDocumentRequest, opts ...grpc.CallOption) (*AttachDocumentResponse, error) - DetachDocument(ctx context.Context, in *DetachDocumentRequest, opts ...grpc.CallOption) (*DetachDocumentResponse, error) - WatchDocuments(ctx context.Context, in *WatchDocumentsRequest, opts ...grpc.CallOption) (Yorkie_WatchDocumentsClient, error) - PushPull(ctx context.Context, in *PushPullRequest, opts ...grpc.CallOption) (*PushPullResponse, error) - FetchHistory(ctx context.Context, in *FetchHistoryRequest, opts ...grpc.CallOption) (*FetchHistoryResponse, error) -} - -type yorkieClient struct { - cc *grpc.ClientConn -} - -func NewYorkieClient(cc *grpc.ClientConn) YorkieClient { - return &yorkieClient{cc} -} - -func (c *yorkieClient) ActivateClient(ctx context.Context, in *ActivateClientRequest, opts ...grpc.CallOption) (*ActivateClientResponse, error) { - out := new(ActivateClientResponse) - err := c.cc.Invoke(ctx, "/api.Yorkie/ActivateClient", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *yorkieClient) DeactivateClient(ctx context.Context, in *DeactivateClientRequest, opts ...grpc.CallOption) (*DeactivateClientResponse, error) { - out := new(DeactivateClientResponse) - err := c.cc.Invoke(ctx, "/api.Yorkie/DeactivateClient", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *yorkieClient) UpdateMetadata(ctx context.Context, in *UpdateMetadataRequest, opts ...grpc.CallOption) (*UpdateMetadataResponse, error) { - out := new(UpdateMetadataResponse) - err := c.cc.Invoke(ctx, "/api.Yorkie/UpdateMetadata", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *yorkieClient) AttachDocument(ctx context.Context, in *AttachDocumentRequest, opts ...grpc.CallOption) (*AttachDocumentResponse, error) { - out := new(AttachDocumentResponse) - err := c.cc.Invoke(ctx, "/api.Yorkie/AttachDocument", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *yorkieClient) DetachDocument(ctx context.Context, in *DetachDocumentRequest, opts ...grpc.CallOption) (*DetachDocumentResponse, error) { - out := new(DetachDocumentResponse) - err := c.cc.Invoke(ctx, "/api.Yorkie/DetachDocument", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *yorkieClient) WatchDocuments(ctx context.Context, in *WatchDocumentsRequest, opts ...grpc.CallOption) (Yorkie_WatchDocumentsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Yorkie_serviceDesc.Streams[0], "/api.Yorkie/WatchDocuments", opts...) - if err != nil { - return nil, err - } - x := &yorkieWatchDocumentsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Yorkie_WatchDocumentsClient interface { - Recv() (*WatchDocumentsResponse, error) - grpc.ClientStream -} - -type yorkieWatchDocumentsClient struct { - grpc.ClientStream -} - -func (x *yorkieWatchDocumentsClient) Recv() (*WatchDocumentsResponse, error) { - m := new(WatchDocumentsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *yorkieClient) PushPull(ctx context.Context, in *PushPullRequest, opts ...grpc.CallOption) (*PushPullResponse, error) { - out := new(PushPullResponse) - err := c.cc.Invoke(ctx, "/api.Yorkie/PushPull", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *yorkieClient) FetchHistory(ctx context.Context, in *FetchHistoryRequest, opts ...grpc.CallOption) (*FetchHistoryResponse, error) { - out := new(FetchHistoryResponse) - err := c.cc.Invoke(ctx, "/api.Yorkie/FetchHistory", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// YorkieServer is the server API for Yorkie service. -type YorkieServer interface { - ActivateClient(context.Context, *ActivateClientRequest) (*ActivateClientResponse, error) - DeactivateClient(context.Context, *DeactivateClientRequest) (*DeactivateClientResponse, error) - UpdateMetadata(context.Context, *UpdateMetadataRequest) (*UpdateMetadataResponse, error) - AttachDocument(context.Context, *AttachDocumentRequest) (*AttachDocumentResponse, error) - DetachDocument(context.Context, *DetachDocumentRequest) (*DetachDocumentResponse, error) - WatchDocuments(*WatchDocumentsRequest, Yorkie_WatchDocumentsServer) error - PushPull(context.Context, *PushPullRequest) (*PushPullResponse, error) - FetchHistory(context.Context, *FetchHistoryRequest) (*FetchHistoryResponse, error) -} - -// UnimplementedYorkieServer can be embedded to have forward compatible implementations. -type UnimplementedYorkieServer struct { -} - -func (*UnimplementedYorkieServer) ActivateClient(ctx context.Context, req *ActivateClientRequest) (*ActivateClientResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ActivateClient not implemented") -} -func (*UnimplementedYorkieServer) DeactivateClient(ctx context.Context, req *DeactivateClientRequest) (*DeactivateClientResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeactivateClient not implemented") -} -func (*UnimplementedYorkieServer) UpdateMetadata(ctx context.Context, req *UpdateMetadataRequest) (*UpdateMetadataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateMetadata not implemented") -} -func (*UnimplementedYorkieServer) AttachDocument(ctx context.Context, req *AttachDocumentRequest) (*AttachDocumentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AttachDocument not implemented") -} -func (*UnimplementedYorkieServer) DetachDocument(ctx context.Context, req *DetachDocumentRequest) (*DetachDocumentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DetachDocument not implemented") -} -func (*UnimplementedYorkieServer) WatchDocuments(req *WatchDocumentsRequest, srv Yorkie_WatchDocumentsServer) error { - return status.Errorf(codes.Unimplemented, "method WatchDocuments not implemented") -} -func (*UnimplementedYorkieServer) PushPull(ctx context.Context, req *PushPullRequest) (*PushPullResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PushPull not implemented") -} -func (*UnimplementedYorkieServer) FetchHistory(ctx context.Context, req *FetchHistoryRequest) (*FetchHistoryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FetchHistory not implemented") -} - -func RegisterYorkieServer(s *grpc.Server, srv YorkieServer) { - s.RegisterService(&_Yorkie_serviceDesc, srv) -} - -func _Yorkie_ActivateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ActivateClientRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServer).ActivateClient(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Yorkie/ActivateClient", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServer).ActivateClient(ctx, req.(*ActivateClientRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Yorkie_DeactivateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeactivateClientRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServer).DeactivateClient(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Yorkie/DeactivateClient", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServer).DeactivateClient(ctx, req.(*DeactivateClientRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Yorkie_UpdateMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateMetadataRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServer).UpdateMetadata(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Yorkie/UpdateMetadata", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServer).UpdateMetadata(ctx, req.(*UpdateMetadataRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Yorkie_AttachDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AttachDocumentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServer).AttachDocument(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Yorkie/AttachDocument", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServer).AttachDocument(ctx, req.(*AttachDocumentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Yorkie_DetachDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DetachDocumentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServer).DetachDocument(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Yorkie/DetachDocument", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServer).DetachDocument(ctx, req.(*DetachDocumentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Yorkie_WatchDocuments_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(WatchDocumentsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(YorkieServer).WatchDocuments(m, &yorkieWatchDocumentsServer{stream}) -} - -type Yorkie_WatchDocumentsServer interface { - Send(*WatchDocumentsResponse) error - grpc.ServerStream -} - -type yorkieWatchDocumentsServer struct { - grpc.ServerStream -} - -func (x *yorkieWatchDocumentsServer) Send(m *WatchDocumentsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Yorkie_PushPull_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PushPullRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServer).PushPull(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Yorkie/PushPull", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServer).PushPull(ctx, req.(*PushPullRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Yorkie_FetchHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FetchHistoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServer).FetchHistory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Yorkie/FetchHistory", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServer).FetchHistory(ctx, req.(*FetchHistoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Yorkie_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.Yorkie", - HandlerType: (*YorkieServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ActivateClient", - Handler: _Yorkie_ActivateClient_Handler, - }, - { - MethodName: "DeactivateClient", - Handler: _Yorkie_DeactivateClient_Handler, - }, - { - MethodName: "UpdateMetadata", - Handler: _Yorkie_UpdateMetadata_Handler, - }, - { - MethodName: "AttachDocument", - Handler: _Yorkie_AttachDocument_Handler, - }, - { - MethodName: "DetachDocument", - Handler: _Yorkie_DetachDocument_Handler, - }, - { - MethodName: "PushPull", - Handler: _Yorkie_PushPull_Handler, - }, - { - MethodName: "FetchHistory", - Handler: _Yorkie_FetchHistory_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "WatchDocuments", - Handler: _Yorkie_WatchDocuments_Handler, - ServerStreams: true, - }, - }, - Metadata: "api/yorkie.proto", -} - -// ClusterClient is the client API for Cluster service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ClusterClient interface { - BroadcastEvent(ctx context.Context, in *BroadcastEventRequest, opts ...grpc.CallOption) (*BroadcastEventResponse, error) -} - -type clusterClient struct { - cc *grpc.ClientConn -} - -func NewClusterClient(cc *grpc.ClientConn) ClusterClient { - return &clusterClient{cc} -} - -func (c *clusterClient) BroadcastEvent(ctx context.Context, in *BroadcastEventRequest, opts ...grpc.CallOption) (*BroadcastEventResponse, error) { - out := new(BroadcastEventResponse) - err := c.cc.Invoke(ctx, "/api.Cluster/BroadcastEvent", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ClusterServer is the server API for Cluster service. -type ClusterServer interface { - BroadcastEvent(context.Context, *BroadcastEventRequest) (*BroadcastEventResponse, error) -} - -// UnimplementedClusterServer can be embedded to have forward compatible implementations. -type UnimplementedClusterServer struct { -} - -func (*UnimplementedClusterServer) BroadcastEvent(ctx context.Context, req *BroadcastEventRequest) (*BroadcastEventResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BroadcastEvent not implemented") -} - -func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { - s.RegisterService(&_Cluster_serviceDesc, srv) -} - -func _Cluster_BroadcastEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BroadcastEventRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).BroadcastEvent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Cluster/BroadcastEvent", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).BroadcastEvent(ctx, req.(*BroadcastEventRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Cluster_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.Cluster", - HandlerType: (*ClusterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "BroadcastEvent", - Handler: _Cluster_BroadcastEvent_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api/yorkie.proto", -} - -func (m *BroadcastEventRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BroadcastEventRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BroadcastEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Event != nil { - { - size, err := m.Event.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.PublisherId) > 0 { - i -= len(m.PublisherId) - copy(dAtA[i:], m.PublisherId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.PublisherId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BroadcastEventResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BroadcastEventResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BroadcastEventResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *ActivateClientRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActivateClientRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActivateClientRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ClientKey) > 0 { - i -= len(m.ClientKey) - copy(dAtA[i:], m.ClientKey) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ActivateClientResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActivateClientResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActivateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ClientKey) > 0 { - i -= len(m.ClientKey) - copy(dAtA[i:], m.ClientKey) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DeactivateClientRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeactivateClientRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeactivateClientRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DeactivateClientResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeactivateClientResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeactivateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AttachDocumentRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AttachDocumentRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AttachDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ChangePack != nil { - { - size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AttachDocumentResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AttachDocumentResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AttachDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ChangePack != nil { - { - size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DetachDocumentRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DetachDocumentRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DetachDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ChangePack != nil { - { - size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DetachDocumentResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DetachDocumentResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DetachDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ChangePack != nil { - { - size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientKey) > 0 { - i -= len(m.ClientKey) - copy(dAtA[i:], m.ClientKey) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WatchDocumentsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchDocumentsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchDocumentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.DocumentKeys) > 0 { - for iNdEx := len(m.DocumentKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DocumentKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Client != nil { - { - size, err := m.Client.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WatchDocumentsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchDocumentsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchDocumentsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Body != nil { - { - size := m.Body.Size() - i -= size - if _, err := m.Body.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *WatchDocumentsResponse_Initialization_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchDocumentsResponse_Initialization_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Initialization != nil { - { - size, err := m.Initialization.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *WatchDocumentsResponse_Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchDocumentsResponse_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Event != nil { - { - size, err := m.Event.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *WatchDocumentsResponse_Initialization) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchDocumentsResponse_Initialization) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchDocumentsResponse_Initialization) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.PeersMapByDoc) > 0 { - for k := range m.PeersMapByDoc { - v := m.PeersMapByDoc[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintYorkie(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintYorkie(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *PushPullRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PushPullRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PushPullRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ChangePack != nil { - { - size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PushPullResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PushPullResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PushPullResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ChangePack != nil { - { - size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateMetadataRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateMetadataRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.DocumentKeys) > 0 { - for iNdEx := len(m.DocumentKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DocumentKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Client != nil { - { - size, err := m.Client.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateMetadataResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateMetadataResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *FetchHistoryRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FetchHistoryRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FetchHistoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.DocumentKey != nil { - { - size, err := m.DocumentKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *FetchHistoryResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FetchHistoryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FetchHistoryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Changes) > 0 { - for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ChangePack) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChangePack) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChangePack) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.MinSyncedTicket != nil { - { - size, err := m.MinSyncedTicket.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Changes) > 0 { - for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Snapshot) > 0 { - i -= len(m.Snapshot) - copy(dAtA[i:], m.Snapshot) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Snapshot))) - i-- - dAtA[i] = 0x1a - } - if m.Checkpoint != nil { - { - size, err := m.Checkpoint.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.DocumentKey != nil { - { - size, err := m.DocumentKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Change) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Change) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Change) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Operations) > 0 { - for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x12 - } - if m.Id != nil { - { - size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ChangeID) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChangeID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChangeID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ActorId) > 0 { - i -= len(m.ActorId) - copy(dAtA[i:], m.ActorId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ActorId))) - i-- - dAtA[i] = 0x22 - } - if m.Lamport != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Lamport)) - i-- - dAtA[i] = 0x18 - } - if m.ServerSeq != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.ServerSeq)) - i-- - dAtA[i] = 0x10 - } - if m.ClientSeq != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.ClientSeq)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Operation) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Body != nil { - { - size := m.Body.Size() - i -= size - if _, err := m.Body.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Operation_Set_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Set_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Set != nil { - { - size, err := m.Set.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Operation_Add_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Add_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Add != nil { - { - size, err := m.Add.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Operation_Move_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Move_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Move != nil { - { - size, err := m.Move.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Operation_Remove_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Remove_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Remove != nil { - { - size, err := m.Remove.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Operation_Edit_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Edit_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Edit != nil { - { - size, err := m.Edit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *Operation_Select_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Select_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Select != nil { - { - size, err := m.Select.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *Operation_RichEdit_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_RichEdit_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.RichEdit != nil { - { - size, err := m.RichEdit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *Operation_Style_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Style_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Style != nil { - { - size, err := m.Style.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} -func (m *Operation_Increase_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Increase_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Increase != nil { - { - size, err := m.Increase.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - return len(dAtA) - i, nil -} -func (m *Operation_Set) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation_Set) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Set) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ExecutedAt != nil { - { - size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Value != nil { - { - size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if m.ParentCreatedAt != nil { - { - size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Operation_Add) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation_Add) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Add) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ExecutedAt != nil { - { - size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Value != nil { - { - size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.PrevCreatedAt != nil { - { - size, err := m.PrevCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ParentCreatedAt != nil { - { - size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Operation_Move) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation_Move) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Move) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ExecutedAt != nil { - { - size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.PrevCreatedAt != nil { - { - size, err := m.PrevCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ParentCreatedAt != nil { - { - size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Operation_Remove) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation_Remove) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Remove) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ExecutedAt != nil { - { - size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ParentCreatedAt != nil { - { - size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Operation_Edit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation_Edit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Edit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ExecutedAt != nil { - { - size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.Content) > 0 { - i -= len(m.Content) - copy(dAtA[i:], m.Content) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Content))) - i-- - dAtA[i] = 0x2a - } - if len(m.CreatedAtMapByActor) > 0 { - for k := range m.CreatedAtMapByActor { - v := m.CreatedAtMapByActor[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintYorkie(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintYorkie(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if m.To != nil { - { - size, err := m.To.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.From != nil { - { - size, err := m.From.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ParentCreatedAt != nil { - { - size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Operation_Select) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation_Select) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Select) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ExecutedAt != nil { - { - size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.To != nil { - { - size, err := m.To.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.From != nil { - { - size, err := m.From.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ParentCreatedAt != nil { - { - size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Operation_RichEdit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation_RichEdit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_RichEdit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ExecutedAt != nil { - { - size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if len(m.Attributes) > 0 { - for k := range m.Attributes { - v := m.Attributes[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintYorkie(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintYorkie(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintYorkie(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Content) > 0 { - i -= len(m.Content) - copy(dAtA[i:], m.Content) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Content))) - i-- - dAtA[i] = 0x2a - } - if len(m.CreatedAtMapByActor) > 0 { - for k := range m.CreatedAtMapByActor { - v := m.CreatedAtMapByActor[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintYorkie(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintYorkie(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if m.To != nil { - { - size, err := m.To.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.From != nil { - { - size, err := m.From.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ParentCreatedAt != nil { - { - size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Operation_Style) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation_Style) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Style) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ExecutedAt != nil { - { - size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Attributes) > 0 { - for k := range m.Attributes { - v := m.Attributes[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintYorkie(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintYorkie(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintYorkie(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if m.To != nil { - { - size, err := m.To.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.From != nil { - { - size, err := m.From.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ParentCreatedAt != nil { - { - size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Operation_Increase) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation_Increase) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation_Increase) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ExecutedAt != nil { - { - size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Value != nil { - { - size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ParentCreatedAt != nil { - { - size, err := m.ParentCreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *JSONElementSimple) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONElementSimple) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElementSimple) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x2a - } - if m.Type != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x20 - } - if m.RemovedAt != nil { - { - size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.MovedAt != nil { - { - size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *JSONElement) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONElement) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Body != nil { - { - size := m.Body.Size() - i -= size - if _, err := m.Body.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *JSONElement_JsonObject) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_JsonObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.JsonObject != nil { - { - size, err := m.JsonObject.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *JSONElement_JsonArray) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_JsonArray) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.JsonArray != nil { - { - size, err := m.JsonArray.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *JSONElement_Primitive_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_Primitive_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Primitive != nil { - { - size, err := m.Primitive.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *JSONElement_Text_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_Text_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Text != nil { - { - size, err := m.Text.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *JSONElement_RichText_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_RichText_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.RichText != nil { - { - size, err := m.RichText.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *JSONElement_Counter_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_Counter_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Counter != nil { - { - size, err := m.Counter.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *JSONElement_JSONObject) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONElement_JSONObject) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_JSONObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RemovedAt != nil { - { - size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.MovedAt != nil { - { - size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Nodes) > 0 { - for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *JSONElement_JSONArray) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONElement_JSONArray) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_JSONArray) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RemovedAt != nil { - { - size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.MovedAt != nil { - { - size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Nodes) > 0 { - for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *JSONElement_Primitive) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONElement_Primitive) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_Primitive) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RemovedAt != nil { - { - size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.MovedAt != nil { - { - size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *JSONElement_Text) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONElement_Text) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_Text) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RemovedAt != nil { - { - size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.MovedAt != nil { - { - size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Nodes) > 0 { - for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *JSONElement_RichText) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONElement_RichText) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_RichText) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RemovedAt != nil { - { - size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.MovedAt != nil { - { - size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Nodes) > 0 { - for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *JSONElement_Counter) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONElement_Counter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONElement_Counter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RemovedAt != nil { - { - size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.MovedAt != nil { - { - size, err := m.MovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *RHTNode) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RHTNode) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RHTNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Element != nil { - { - size, err := m.Element.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RGANode) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RGANode) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RGANode) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Element != nil { - { - size, err := m.Element.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Next != nil { - { - size, err := m.Next.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TextNode) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TextNode) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TextNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.InsPrevId != nil { - { - size, err := m.InsPrevId.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.RemovedAt != nil { - { - size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if m.Id != nil { - { - size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RichTextNodeAttr) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RichTextNodeAttr) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RichTextNodeAttr) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.UpdatedAt != nil { - { - size, err := m.UpdatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RichTextNode) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RichTextNode) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RichTextNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.InsPrevId != nil { - { - size, err := m.InsPrevId.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.RemovedAt != nil { - { - size, err := m.RemovedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a - } - if len(m.Attributes) > 0 { - for k := range m.Attributes { - v := m.Attributes[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintYorkie(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintYorkie(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if m.Id != nil { - { - size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TextNodeID) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TextNodeID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TextNodeID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Offset != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Offset)) - i-- - dAtA[i] = 0x10 - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Metadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Data) > 0 { - for k := range m.Data { - v := m.Data[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintYorkie(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintYorkie(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintYorkie(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if m.Clock != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Clock)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Client) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Client) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Client) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Clients) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Clients) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Clients) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Clients) > 0 { - for iNdEx := len(m.Clients) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Clients[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *DocumentKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DocumentKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DocumentKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Document) > 0 { - i -= len(m.Document) - copy(dAtA[i:], m.Document) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Document))) - i-- - dAtA[i] = 0x12 - } - if len(m.Collection) > 0 { - i -= len(m.Collection) - copy(dAtA[i:], m.Collection) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Collection))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Checkpoint) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Checkpoint) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Checkpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ClientSeq != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.ClientSeq)) - i-- - dAtA[i] = 0x10 - } - if m.ServerSeq != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.ServerSeq)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TextNodePos) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TextNodePos) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TextNodePos) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RelativeOffset != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.RelativeOffset)) - i-- - dAtA[i] = 0x18 - } - if m.Offset != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Offset)) - i-- - dAtA[i] = 0x10 - } - if m.CreatedAt != nil { - { - size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TimeTicket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TimeTicket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimeTicket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ActorId) > 0 { - i -= len(m.ActorId) - copy(dAtA[i:], m.ActorId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ActorId))) - i-- - dAtA[i] = 0x1a - } - if m.Delimiter != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Delimiter)) - i-- - dAtA[i] = 0x10 - } - if m.Lamport != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Lamport)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DocEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DocEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.DocumentKeys) > 0 { - for iNdEx := len(m.DocumentKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DocumentKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Publisher != nil { - { - size, err := m.Publisher.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintYorkie(dAtA []byte, offset int, v uint64) int { - offset -= sovYorkie(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *BroadcastEventRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PublisherId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Event != nil { - l = m.Event.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *BroadcastEventResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ActivateClientRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientKey) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ActivateClientResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientKey) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DeactivateClientRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DeactivateClientResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AttachDocumentRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ChangePack != nil { - l = m.ChangePack.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AttachDocumentResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ChangePack != nil { - l = m.ChangePack.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DetachDocumentRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ChangePack != nil { - l = m.ChangePack.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DetachDocumentResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientKey) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ChangePack != nil { - l = m.ChangePack.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WatchDocumentsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Client != nil { - l = m.Client.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.DocumentKeys) > 0 { - for _, e := range m.DocumentKeys { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WatchDocumentsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Body != nil { - n += m.Body.Size() - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WatchDocumentsResponse_Initialization_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Initialization != nil { - l = m.Initialization.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *WatchDocumentsResponse_Event) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Event != nil { - l = m.Event.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *WatchDocumentsResponse_Initialization) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.PeersMapByDoc) > 0 { - for k, v := range m.PeersMapByDoc { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovYorkie(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovYorkie(uint64(len(k))) + l - n += mapEntrySize + 1 + sovYorkie(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *PushPullRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ChangePack != nil { - l = m.ChangePack.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *PushPullResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ChangePack != nil { - l = m.ChangePack.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UpdateMetadataRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Client != nil { - l = m.Client.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.DocumentKeys) > 0 { - for _, e := range m.DocumentKeys { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UpdateMetadataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FetchHistoryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.DocumentKey != nil { - l = m.DocumentKey.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FetchHistoryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Changes) > 0 { - for _, e := range m.Changes { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ChangePack) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DocumentKey != nil { - l = m.DocumentKey.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Checkpoint != nil { - l = m.Checkpoint.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.Snapshot) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.Changes) > 0 { - for _, e := range m.Changes { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.MinSyncedTicket != nil { - l = m.MinSyncedTicket.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Change) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.Operations) > 0 { - for _, e := range m.Operations { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ChangeID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ClientSeq != 0 { - n += 1 + sovYorkie(uint64(m.ClientSeq)) - } - if m.ServerSeq != 0 { - n += 1 + sovYorkie(uint64(m.ServerSeq)) - } - if m.Lamport != 0 { - n += 1 + sovYorkie(uint64(m.Lamport)) - } - l = len(m.ActorId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Body != nil { - n += m.Body.Size() - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Set_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *Operation_Add_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Add != nil { - l = m.Add.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *Operation_Move_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Move != nil { - l = m.Move.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *Operation_Remove_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Remove != nil { - l = m.Remove.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *Operation_Edit_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Edit != nil { - l = m.Edit.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *Operation_Select_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Select != nil { - l = m.Select.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *Operation_RichEdit_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RichEdit != nil { - l = m.RichEdit.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *Operation_Style_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Style != nil { - l = m.Style.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *Operation_Increase_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Increase != nil { - l = m.Increase.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *Operation_Set) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParentCreatedAt != nil { - l = m.ParentCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Value != nil { - l = m.Value.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ExecutedAt != nil { - l = m.ExecutedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Add) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParentCreatedAt != nil { - l = m.ParentCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.PrevCreatedAt != nil { - l = m.PrevCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Value != nil { - l = m.Value.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ExecutedAt != nil { - l = m.ExecutedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Move) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParentCreatedAt != nil { - l = m.ParentCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.PrevCreatedAt != nil { - l = m.PrevCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ExecutedAt != nil { - l = m.ExecutedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Remove) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParentCreatedAt != nil { - l = m.ParentCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ExecutedAt != nil { - l = m.ExecutedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Edit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParentCreatedAt != nil { - l = m.ParentCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.From != nil { - l = m.From.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.To != nil { - l = m.To.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.CreatedAtMapByActor) > 0 { - for k, v := range m.CreatedAtMapByActor { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovYorkie(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovYorkie(uint64(len(k))) + l - n += mapEntrySize + 1 + sovYorkie(uint64(mapEntrySize)) - } - } - l = len(m.Content) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ExecutedAt != nil { - l = m.ExecutedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Select) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParentCreatedAt != nil { - l = m.ParentCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.From != nil { - l = m.From.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.To != nil { - l = m.To.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ExecutedAt != nil { - l = m.ExecutedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_RichEdit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParentCreatedAt != nil { - l = m.ParentCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.From != nil { - l = m.From.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.To != nil { - l = m.To.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.CreatedAtMapByActor) > 0 { - for k, v := range m.CreatedAtMapByActor { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovYorkie(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovYorkie(uint64(len(k))) + l - n += mapEntrySize + 1 + sovYorkie(uint64(mapEntrySize)) - } - } - l = len(m.Content) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.Attributes) > 0 { - for k, v := range m.Attributes { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovYorkie(uint64(len(k))) + 1 + len(v) + sovYorkie(uint64(len(v))) - n += mapEntrySize + 1 + sovYorkie(uint64(mapEntrySize)) - } - } - if m.ExecutedAt != nil { - l = m.ExecutedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Style) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParentCreatedAt != nil { - l = m.ParentCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.From != nil { - l = m.From.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.To != nil { - l = m.To.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.Attributes) > 0 { - for k, v := range m.Attributes { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovYorkie(uint64(len(k))) + 1 + len(v) + sovYorkie(uint64(len(v))) - n += mapEntrySize + 1 + sovYorkie(uint64(mapEntrySize)) - } - } - if m.ExecutedAt != nil { - l = m.ExecutedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Increase) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParentCreatedAt != nil { - l = m.ParentCreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Value != nil { - l = m.Value.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.ExecutedAt != nil { - l = m.ExecutedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *JSONElementSimple) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.MovedAt != nil { - l = m.MovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.RemovedAt != nil { - l = m.RemovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Type != 0 { - n += 1 + sovYorkie(uint64(m.Type)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *JSONElement) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Body != nil { - n += m.Body.Size() - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *JSONElement_JsonObject) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.JsonObject != nil { - l = m.JsonObject.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *JSONElement_JsonArray) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.JsonArray != nil { - l = m.JsonArray.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *JSONElement_Primitive_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Primitive != nil { - l = m.Primitive.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *JSONElement_Text_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Text != nil { - l = m.Text.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *JSONElement_RichText_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RichText != nil { - l = m.RichText.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *JSONElement_Counter_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Counter != nil { - l = m.Counter.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *JSONElement_JSONObject) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Nodes) > 0 { - for _, e := range m.Nodes { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.MovedAt != nil { - l = m.MovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.RemovedAt != nil { - l = m.RemovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *JSONElement_JSONArray) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Nodes) > 0 { - for _, e := range m.Nodes { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.MovedAt != nil { - l = m.MovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.RemovedAt != nil { - l = m.RemovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *JSONElement_Primitive) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovYorkie(uint64(m.Type)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.MovedAt != nil { - l = m.MovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.RemovedAt != nil { - l = m.RemovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *JSONElement_Text) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Nodes) > 0 { - for _, e := range m.Nodes { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.MovedAt != nil { - l = m.MovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.RemovedAt != nil { - l = m.RemovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *JSONElement_RichText) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Nodes) > 0 { - for _, e := range m.Nodes { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.MovedAt != nil { - l = m.MovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.RemovedAt != nil { - l = m.RemovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *JSONElement_Counter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovYorkie(uint64(m.Type)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.MovedAt != nil { - l = m.MovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.RemovedAt != nil { - l = m.RemovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RHTNode) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Element != nil { - l = m.Element.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RGANode) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Next != nil { - l = m.Next.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Element != nil { - l = m.Element.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TextNode) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.RemovedAt != nil { - l = m.RemovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.InsPrevId != nil { - l = m.InsPrevId.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RichTextNodeAttr) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.UpdatedAt != nil { - l = m.UpdatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RichTextNode) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.Attributes) > 0 { - for k, v := range m.Attributes { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovYorkie(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovYorkie(uint64(len(k))) + l - n += mapEntrySize + 1 + sovYorkie(uint64(mapEntrySize)) - } - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.RemovedAt != nil { - l = m.RemovedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.InsPrevId != nil { - l = m.InsPrevId.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TextNodeID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Offset != 0 { - n += 1 + sovYorkie(uint64(m.Offset)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Metadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Clock != 0 { - n += 1 + sovYorkie(uint64(m.Clock)) - } - if len(m.Data) > 0 { - for k, v := range m.Data { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovYorkie(uint64(len(k))) + 1 + len(v) + sovYorkie(uint64(len(v))) - n += mapEntrySize + 1 + sovYorkie(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Client) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Clients) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Clients) > 0 { - for _, e := range m.Clients { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DocumentKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Collection) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.Document) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Checkpoint) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ServerSeq != 0 { - n += 1 + sovYorkie(uint64(m.ServerSeq)) - } - if m.ClientSeq != 0 { - n += 1 + sovYorkie(uint64(m.ClientSeq)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TextNodePos) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CreatedAt != nil { - l = m.CreatedAt.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.Offset != 0 { - n += 1 + sovYorkie(uint64(m.Offset)) - } - if m.RelativeOffset != 0 { - n += 1 + sovYorkie(uint64(m.RelativeOffset)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TimeTicket) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Lamport != 0 { - n += 1 + sovYorkie(uint64(m.Lamport)) - } - if m.Delimiter != 0 { - n += 1 + sovYorkie(uint64(m.Delimiter)) - } - l = len(m.ActorId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DocEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovYorkie(uint64(m.Type)) - } - if m.Publisher != nil { - l = m.Publisher.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if len(m.DocumentKeys) > 0 { - for _, e := range m.DocumentKeys { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovYorkie(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozYorkie(x uint64) (n int) { - return sovYorkie(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BroadcastEventRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BroadcastEventRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BroadcastEventRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublisherId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublisherId = append(m.PublisherId[:0], dAtA[iNdEx:postIndex]...) - if m.PublisherId == nil { - m.PublisherId = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Event == nil { - m.Event = &DocEvent{} - } - if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BroadcastEventResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BroadcastEventResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BroadcastEventResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActivateClientRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActivateClientRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActivateClientRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActivateClientResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActivateClientResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActivateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) - if m.ClientId == nil { - m.ClientId = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeactivateClientRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeactivateClientRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeactivateClientRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) - if m.ClientId == nil { - m.ClientId = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeactivateClientResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeactivateClientResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeactivateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) - if m.ClientId == nil { - m.ClientId = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AttachDocumentRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AttachDocumentRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AttachDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) - if m.ClientId == nil { - m.ClientId = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ChangePack == nil { - m.ChangePack = &ChangePack{} - } - if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AttachDocumentResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AttachDocumentResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AttachDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) - if m.ClientId == nil { - m.ClientId = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ChangePack == nil { - m.ChangePack = &ChangePack{} - } - if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DetachDocumentRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DetachDocumentRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DetachDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) - if m.ClientId == nil { - m.ClientId = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ChangePack == nil { - m.ChangePack = &ChangePack{} - } - if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DetachDocumentResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DetachDocumentResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DetachDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ChangePack == nil { - m.ChangePack = &ChangePack{} - } - if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchDocumentsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchDocumentsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchDocumentsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Client", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Client == nil { - m.Client = &Client{} - } - if err := m.Client.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DocumentKeys = append(m.DocumentKeys, &DocumentKey{}) - if err := m.DocumentKeys[len(m.DocumentKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchDocumentsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchDocumentsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchDocumentsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Initialization", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &WatchDocumentsResponse_Initialization{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &WatchDocumentsResponse_Initialization_{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &DocEvent{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &WatchDocumentsResponse_Event{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchDocumentsResponse_Initialization) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Initialization: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Initialization: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeersMapByDoc", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PeersMapByDoc == nil { - m.PeersMapByDoc = make(map[string]*Clients) - } - var mapkey string - var mapvalue *Clients - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthYorkie - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthYorkie - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &Clients{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.PeersMapByDoc[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PushPullRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PushPullRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PushPullRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) - if m.ClientId == nil { - m.ClientId = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ChangePack == nil { - m.ChangePack = &ChangePack{} - } - if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PushPullResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PushPullResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PushPullResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) - if m.ClientId == nil { - m.ClientId = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ChangePack == nil { - m.ChangePack = &ChangePack{} - } - if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateMetadataRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateMetadataRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Client", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Client == nil { - m.Client = &Client{} - } - if err := m.Client.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DocumentKeys = append(m.DocumentKeys, &DocumentKey{}) - if err := m.DocumentKeys[len(m.DocumentKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateMetadataResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateMetadataResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FetchHistoryRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FetchHistoryRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FetchHistoryRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) - if m.ClientId == nil { - m.ClientId = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DocumentKey == nil { - m.DocumentKey = &DocumentKey{} - } - if err := m.DocumentKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FetchHistoryResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FetchHistoryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FetchHistoryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Changes = append(m.Changes, &Change{}) - if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChangePack) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChangePack: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChangePack: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DocumentKey == nil { - m.DocumentKey = &DocumentKey{} - } - if err := m.DocumentKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Checkpoint == nil { - m.Checkpoint = &Checkpoint{} - } - if err := m.Checkpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Snapshot = append(m.Snapshot[:0], dAtA[iNdEx:postIndex]...) - if m.Snapshot == nil { - m.Snapshot = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Changes = append(m.Changes, &Change{}) - if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinSyncedTicket", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MinSyncedTicket == nil { - m.MinSyncedTicket = &TimeTicket{} - } - if err := m.MinSyncedTicket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Change) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Change: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Change: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &ChangeID{} - } - if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Operations = append(m.Operations, &Operation{}) - if err := m.Operations[len(m.Operations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChangeID) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChangeID: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChangeID: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientSeq", wireType) - } - m.ClientSeq = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ClientSeq |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ServerSeq", wireType) - } - m.ServerSeq = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ServerSeq |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lamport", wireType) - } - m.Lamport = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Lamport |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActorId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActorId = append(m.ActorId[:0], dAtA[iNdEx:postIndex]...) - if m.ActorId == nil { - m.ActorId = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Operation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Operation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Operation_Set{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &Operation_Set_{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Add", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Operation_Add{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &Operation_Add_{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Move", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Operation_Move{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &Operation_Move_{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Remove", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Operation_Remove{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &Operation_Remove_{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Edit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Operation_Edit{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &Operation_Edit_{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Select", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Operation_Select{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &Operation_Select_{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RichEdit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Operation_RichEdit{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &Operation_RichEdit_{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Style", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Operation_Style{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &Operation_Style_{v} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Increase", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Operation_Increase{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &Operation_Increase_{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation_Set) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Set: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Set: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParentCreatedAt == nil { - m.ParentCreatedAt = &TimeTicket{} - } - if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Value == nil { - m.Value = &JSONElementSimple{} - } - if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutedAt == nil { - m.ExecutedAt = &TimeTicket{} - } - if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation_Add) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Add: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Add: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParentCreatedAt == nil { - m.ParentCreatedAt = &TimeTicket{} - } - if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PrevCreatedAt == nil { - m.PrevCreatedAt = &TimeTicket{} - } - if err := m.PrevCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Value == nil { - m.Value = &JSONElementSimple{} - } - if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutedAt == nil { - m.ExecutedAt = &TimeTicket{} - } - if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation_Move) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Move: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Move: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParentCreatedAt == nil { - m.ParentCreatedAt = &TimeTicket{} - } - if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PrevCreatedAt == nil { - m.PrevCreatedAt = &TimeTicket{} - } - if err := m.PrevCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutedAt == nil { - m.ExecutedAt = &TimeTicket{} - } - if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation_Remove) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Remove: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Remove: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParentCreatedAt == nil { - m.ParentCreatedAt = &TimeTicket{} - } - if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutedAt == nil { - m.ExecutedAt = &TimeTicket{} - } - if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation_Edit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Edit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Edit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParentCreatedAt == nil { - m.ParentCreatedAt = &TimeTicket{} - } - if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.From == nil { - m.From = &TextNodePos{} - } - if err := m.From.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.To == nil { - m.To = &TextNodePos{} - } - if err := m.To.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAtMapByActor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAtMapByActor == nil { - m.CreatedAtMapByActor = make(map[string]*TimeTicket) - } - var mapkey string - var mapvalue *TimeTicket - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthYorkie - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthYorkie - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &TimeTicket{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.CreatedAtMapByActor[mapkey] = mapvalue - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Content = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutedAt == nil { - m.ExecutedAt = &TimeTicket{} - } - if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation_Select) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Select: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Select: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParentCreatedAt == nil { - m.ParentCreatedAt = &TimeTicket{} - } - if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.From == nil { - m.From = &TextNodePos{} - } - if err := m.From.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.To == nil { - m.To = &TextNodePos{} - } - if err := m.To.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutedAt == nil { - m.ExecutedAt = &TimeTicket{} - } - if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation_RichEdit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RichEdit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RichEdit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParentCreatedAt == nil { - m.ParentCreatedAt = &TimeTicket{} - } - if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.From == nil { - m.From = &TextNodePos{} - } - if err := m.From.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.To == nil { - m.To = &TextNodePos{} - } - if err := m.To.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAtMapByActor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAtMapByActor == nil { - m.CreatedAtMapByActor = make(map[string]*TimeTicket) - } - var mapkey string - var mapvalue *TimeTicket - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthYorkie - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthYorkie - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &TimeTicket{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.CreatedAtMapByActor[mapkey] = mapvalue - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Content = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Attributes == nil { - m.Attributes = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Attributes[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutedAt == nil { - m.ExecutedAt = &TimeTicket{} - } - if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation_Style) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Style: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Style: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParentCreatedAt == nil { - m.ParentCreatedAt = &TimeTicket{} - } - if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.From == nil { - m.From = &TextNodePos{} - } - if err := m.From.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.To == nil { - m.To = &TextNodePos{} - } - if err := m.To.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Attributes == nil { - m.Attributes = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Attributes[mapkey] = mapvalue - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutedAt == nil { - m.ExecutedAt = &TimeTicket{} - } - if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation_Increase) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Increase: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Increase: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentCreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ParentCreatedAt == nil { - m.ParentCreatedAt = &TimeTicket{} - } - if err := m.ParentCreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Value == nil { - m.Value = &JSONElementSimple{} - } - if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutedAt == nil { - m.ExecutedAt = &TimeTicket{} - } - if err := m.ExecutedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONElementSimple) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JSONElementSimple: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSONElementSimple: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MovedAt == nil { - m.MovedAt = &TimeTicket{} - } - if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RemovedAt == nil { - m.RemovedAt = &TimeTicket{} - } - if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= ValueType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONElement) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JSONElement: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSONElement: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JsonObject", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &JSONElement_JSONObject{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &JSONElement_JsonObject{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JsonArray", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &JSONElement_JSONArray{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &JSONElement_JsonArray{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Primitive", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &JSONElement_Primitive{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &JSONElement_Primitive_{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &JSONElement_Text{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &JSONElement_Text_{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RichText", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &JSONElement_RichText{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &JSONElement_RichText_{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &JSONElement_Counter{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &JSONElement_Counter_{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONElement_JSONObject) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JSONObject: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSONObject: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Nodes = append(m.Nodes, &RHTNode{}) - if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MovedAt == nil { - m.MovedAt = &TimeTicket{} - } - if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RemovedAt == nil { - m.RemovedAt = &TimeTicket{} - } - if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONElement_JSONArray) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JSONArray: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSONArray: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Nodes = append(m.Nodes, &RGANode{}) - if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MovedAt == nil { - m.MovedAt = &TimeTicket{} - } - if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RemovedAt == nil { - m.RemovedAt = &TimeTicket{} - } - if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONElement_Primitive) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Primitive: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Primitive: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= ValueType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MovedAt == nil { - m.MovedAt = &TimeTicket{} - } - if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RemovedAt == nil { - m.RemovedAt = &TimeTicket{} - } - if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONElement_Text) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Text: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Text: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Nodes = append(m.Nodes, &TextNode{}) - if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MovedAt == nil { - m.MovedAt = &TimeTicket{} - } - if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RemovedAt == nil { - m.RemovedAt = &TimeTicket{} - } - if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONElement_RichText) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RichText: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RichText: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Nodes = append(m.Nodes, &RichTextNode{}) - if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MovedAt == nil { - m.MovedAt = &TimeTicket{} - } - if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RemovedAt == nil { - m.RemovedAt = &TimeTicket{} - } - if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONElement_Counter) Unmarshal(dAtA []byte) error { +func (m *ActivateClientRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Counter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Counter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= ValueType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} - } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - if m.MovedAt == nil { - m.MovedAt = &TimeTicket{} - } - if err := m.MovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 5: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ActivateClientRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ActivateClientRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientKey", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -16129,27 +2545,23 @@ func (m *JSONElement_Counter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - if m.RemovedAt == nil { - m.RemovedAt = &TimeTicket{} - } - if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ClientKey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -16173,7 +2585,7 @@ func (m *JSONElement_Counter) Unmarshal(dAtA []byte) error { } return nil } -func (m *RHTNode) Unmarshal(dAtA []byte) error { +func (m *ActivateClientResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16196,15 +2608,15 @@ func (m *RHTNode) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RHTNode: wiretype end group for non-group") + return fmt.Errorf("proto: ActivateClientResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RHTNode: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ActivateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientKey", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -16232,13 +2644,13 @@ func (m *RHTNode) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = string(dAtA[iNdEx:postIndex]) + m.ClientKey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Element", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -16248,26 +2660,24 @@ func (m *RHTNode) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Element == nil { - m.Element = &JSONElement{} - } - if err := m.Element.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) + if m.ClientId == nil { + m.ClientId = []byte{} } iNdEx = postIndex default: @@ -16292,7 +2702,7 @@ func (m *RHTNode) Unmarshal(dAtA []byte) error { } return nil } -func (m *RGANode) Unmarshal(dAtA []byte) error { +func (m *DeactivateClientRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16315,53 +2725,17 @@ func (m *RGANode) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RGANode: wiretype end group for non-group") + return fmt.Errorf("proto: DeactivateClientRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RGANode: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeactivateClientRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Next", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Next == nil { - m.Next = &RGANode{} - } - if err := m.Next.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Element", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -16371,26 +2745,24 @@ func (m *RGANode) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Element == nil { - m.Element = &JSONElement{} - } - if err := m.Element.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) + if m.ClientId == nil { + m.ClientId = []byte{} } iNdEx = postIndex default: @@ -16415,7 +2787,7 @@ func (m *RGANode) Unmarshal(dAtA []byte) error { } return nil } -func (m *TextNode) Unmarshal(dAtA []byte) error { +func (m *DeactivateClientResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16438,121 +2810,17 @@ func (m *TextNode) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TextNode: wiretype end group for non-group") + return fmt.Errorf("proto: DeactivateClientResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TextNode: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeactivateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &TextNodeID{} - } - if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RemovedAt == nil { - m.RemovedAt = &TimeTicket{} - } - if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InsPrevId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -16562,26 +2830,24 @@ func (m *TextNode) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - if m.InsPrevId == nil { - m.InsPrevId = &TextNodeID{} - } - if err := m.InsPrevId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) + if m.ClientId == nil { + m.ClientId = []byte{} } iNdEx = postIndex default: @@ -16606,7 +2872,7 @@ func (m *TextNode) Unmarshal(dAtA []byte) error { } return nil } -func (m *RichTextNodeAttr) Unmarshal(dAtA []byte) error { +func (m *AttachDocumentRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16629,49 +2895,17 @@ func (m *RichTextNodeAttr) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RichTextNodeAttr: wiretype end group for non-group") + return fmt.Errorf("proto: AttachDocumentRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RichTextNodeAttr: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AttachDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -16681,27 +2915,29 @@ func (m *RichTextNodeAttr) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = string(dAtA[iNdEx:postIndex]) + m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) + if m.ClientId == nil { + m.ClientId = []byte{} + } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -16728,10 +2964,10 @@ func (m *RichTextNodeAttr) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.UpdatedAt == nil { - m.UpdatedAt = &TimeTicket{} + if m.ChangePack == nil { + m.ChangePack = &ChangePack{} } - if err := m.UpdatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -16757,7 +2993,7 @@ func (m *RichTextNodeAttr) Unmarshal(dAtA []byte) error { } return nil } -func (m *RichTextNode) Unmarshal(dAtA []byte) error { +func (m *AttachDocumentResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16780,17 +3016,17 @@ func (m *RichTextNode) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RichTextNode: wiretype end group for non-group") + return fmt.Errorf("proto: AttachDocumentResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RichTextNode: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AttachDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -16800,31 +3036,29 @@ func (m *RichTextNode) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Id == nil { - m.Id = &TextNodeID{} - } - if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) + if m.ClientId == nil { + m.ClientId = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -16851,143 +3085,69 @@ func (m *RichTextNode) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Attributes == nil { - m.Attributes = make(map[string]*RichTextNodeAttr) + if m.ChangePack == nil { + m.ChangePack = &ChangePack{} } - var mapkey string - var mapvalue *RichTextNodeAttr - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthYorkie - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthYorkie - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &RichTextNodeAttr{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Attributes[mapkey] = mapvalue iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipYorkie(dAtA[iNdEx:]) + if err != nil { + return err } - intStringLen := int(stringLen) - if intStringLen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYorkie + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DetachDocumentRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DetachDocumentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DetachDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovedAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -16997,31 +3157,29 @@ func (m *RichTextNode) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - if m.RemovedAt == nil { - m.RemovedAt = &TimeTicket{} - } - if err := m.RemovedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) + if m.ClientId == nil { + m.ClientId = []byte{} } iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InsPrevId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17048,10 +3206,10 @@ func (m *RichTextNode) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.InsPrevId == nil { - m.InsPrevId = &TextNodeID{} + if m.ChangePack == nil { + m.ChangePack = &ChangePack{} } - if err := m.InsPrevId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -17077,7 +3235,7 @@ func (m *RichTextNode) Unmarshal(dAtA []byte) error { } return nil } -func (m *TextNodeID) Unmarshal(dAtA []byte) error { +func (m *DetachDocumentResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17100,15 +3258,47 @@ func (m *TextNodeID) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TextNodeID: wiretype end group for non-group") + return fmt.Errorf("proto: DetachDocumentResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TextNodeID: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DetachDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthYorkie + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17135,32 +3325,13 @@ func (m *TextNodeID) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} + if m.ChangePack == nil { + m.ChangePack = &ChangePack{} } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) - } - m.Offset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Offset |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -17183,7 +3354,7 @@ func (m *TextNodeID) Unmarshal(dAtA []byte) error { } return nil } -func (m *Metadata) Unmarshal(dAtA []byte) error { +func (m *WatchDocumentsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17206,17 +3377,17 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + return fmt.Errorf("proto: WatchDocumentsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WatchDocumentsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Client", wireType) } - m.Clock = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -17226,14 +3397,31 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Clock |= int32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthYorkie + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Client == nil { + m.Client = &Client{} + } + if err := m.Client.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DocumentKeys", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17260,103 +3448,10 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Data == nil { - m.Data = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthYorkie - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthYorkie - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + m.DocumentKeys = append(m.DocumentKeys, &DocumentKey{}) + if err := m.DocumentKeys[len(m.DocumentKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Data[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -17380,7 +3475,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } return nil } -func (m *Client) Unmarshal(dAtA []byte) error { +func (m *WatchDocumentsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17403,17 +3498,17 @@ func (m *Client) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Client: wiretype end group for non-group") + return fmt.Errorf("proto: WatchDocumentsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Client: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WatchDocumentsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Initialization", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -17423,29 +3518,30 @@ func (m *Client) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) - if m.Id == nil { - m.Id = []byte{} + v := &WatchDocumentsResponse_Initialization{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Body = &WatchDocumentsResponse_Initialization_{v} iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17472,12 +3568,11 @@ func (m *Client) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Metadata == nil { - m.Metadata = &Metadata{} - } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &DocEvent{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Body = &WatchDocumentsResponse_Event{v} iNdEx = postIndex default: iNdEx = preIndex @@ -17501,7 +3596,7 @@ func (m *Client) Unmarshal(dAtA []byte) error { } return nil } -func (m *Clients) Unmarshal(dAtA []byte) error { +func (m *WatchDocumentsResponse_Initialization) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17524,15 +3619,15 @@ func (m *Clients) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Clients: wiretype end group for non-group") + return fmt.Errorf("proto: Initialization: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Clients: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Initialization: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Clients", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PeersMapByDoc", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17559,10 +3654,105 @@ func (m *Clients) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Clients = append(m.Clients, &Client{}) - if err := m.Clients[len(m.Clients)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.PeersMapByDoc == nil { + m.PeersMapByDoc = make(map[string]*Clients) + } + var mapkey string + var mapvalue *Clients + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthYorkie + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthYorkie + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthYorkie + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthYorkie + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Clients{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipYorkie(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.PeersMapByDoc[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -17586,7 +3776,7 @@ func (m *Clients) Unmarshal(dAtA []byte) error { } return nil } -func (m *DocumentKey) Unmarshal(dAtA []byte) error { +func (m *PushPullRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17609,17 +3799,17 @@ func (m *DocumentKey) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DocumentKey: wiretype end group for non-group") + return fmt.Errorf("proto: PushPullRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DocumentKey: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PushPullRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Collection", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -17629,29 +3819,31 @@ func (m *DocumentKey) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - m.Collection = string(dAtA[iNdEx:postIndex]) + m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) + if m.ClientId == nil { + m.ClientId = []byte{} + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -17661,23 +3853,27 @@ func (m *DocumentKey) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthYorkie } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthYorkie } if postIndex > l { return io.ErrUnexpectedEOF } - m.Document = string(dAtA[iNdEx:postIndex]) + if m.ChangePack == nil { + m.ChangePack = &ChangePack{} + } + if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -17701,7 +3897,7 @@ func (m *DocumentKey) Unmarshal(dAtA []byte) error { } return nil } -func (m *Checkpoint) Unmarshal(dAtA []byte) error { +func (m *PushPullResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17724,17 +3920,17 @@ func (m *Checkpoint) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Checkpoint: wiretype end group for non-group") + return fmt.Errorf("proto: PushPullResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Checkpoint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PushPullResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ServerSeq", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - m.ServerSeq = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -17744,16 +3940,31 @@ func (m *Checkpoint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ServerSeq |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthYorkie + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) + if m.ClientId == nil { + m.ClientId = []byte{} + } + iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientSeq", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) } - m.ClientSeq = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -17763,11 +3974,28 @@ func (m *Checkpoint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ClientSeq |= uint32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthYorkie + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ChangePack == nil { + m.ChangePack = &ChangePack{} + } + if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -17790,7 +4018,7 @@ func (m *Checkpoint) Unmarshal(dAtA []byte) error { } return nil } -func (m *TextNodePos) Unmarshal(dAtA []byte) error { +func (m *UpdateMetadataRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17813,15 +4041,15 @@ func (m *TextNodePos) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TextNodePos: wiretype end group for non-group") + return fmt.Errorf("proto: UpdateMetadataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TextNodePos: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UpdateMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Client", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17848,18 +4076,18 @@ func (m *TextNodePos) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.CreatedAt == nil { - m.CreatedAt = &TimeTicket{} + if m.Client == nil { + m.Client = &Client{} } - if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Client.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentKeys", wireType) } - m.Offset = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -17869,30 +4097,26 @@ func (m *TextNodePos) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Offset |= int32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RelativeOffset", wireType) + if msglen < 0 { + return ErrInvalidLengthYorkie } - m.RelativeOffset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RelativeOffset |= int32(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DocumentKeys = append(m.DocumentKeys, &DocumentKey{}) + if err := m.DocumentKeys[len(m.DocumentKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -17915,7 +4139,7 @@ func (m *TextNodePos) Unmarshal(dAtA []byte) error { } return nil } -func (m *TimeTicket) Unmarshal(dAtA []byte) error { +func (m *UpdateMetadataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17938,84 +4162,12 @@ func (m *TimeTicket) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TimeTicket: wiretype end group for non-group") + return fmt.Errorf("proto: UpdateMetadataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TimeTicket: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UpdateMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lamport", wireType) - } - m.Lamport = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Lamport |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Delimiter", wireType) - } - m.Delimiter = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Delimiter |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActorId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActorId = append(m.ActorId[:0], dAtA[iNdEx:postIndex]...) - if m.ActorId == nil { - m.ActorId = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -18038,7 +4190,7 @@ func (m *TimeTicket) Unmarshal(dAtA []byte) error { } return nil } -func (m *DocEvent) Unmarshal(dAtA []byte) error { +func (m *ListChangesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18061,17 +4213,17 @@ func (m *DocEvent) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DocEvent: wiretype end group for non-group") + return fmt.Errorf("proto: ListChangesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DocEvent: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ListChangesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - m.Type = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -18081,14 +4233,29 @@ func (m *DocEvent) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Type |= DocEventType(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthYorkie + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = append(m.ClientId[:0], dAtA[iNdEx:postIndex]...) + if m.ClientId == nil { + m.ClientId = []byte{} + } + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DocumentKey", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18115,16 +4282,67 @@ func (m *DocEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Publisher == nil { - m.Publisher = &Client{} + if m.DocumentKey == nil { + m.DocumentKey = &DocumentKey{} } - if err := m.Publisher.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DocumentKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipYorkie(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListChangesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListChangesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListChangesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentKeys", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18151,8 +4369,8 @@ func (m *DocEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DocumentKeys = append(m.DocumentKeys, &DocumentKey{}) - if err := m.DocumentKeys[len(m.DocumentKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Changes = append(m.Changes, &Change{}) + if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/api/yorkie.proto b/api/yorkie.proto index f02c38e02..0fbde5f20 100644 --- a/api/yorkie.proto +++ b/api/yorkie.proto @@ -18,379 +18,97 @@ syntax = "proto3"; package api; -service Yorkie { - rpc ActivateClient (ActivateClientRequest) returns (ActivateClientResponse) {} - rpc DeactivateClient (DeactivateClientRequest) returns (DeactivateClientResponse) {} - rpc UpdateMetadata (UpdateMetadataRequest) returns (UpdateMetadataResponse) {} - - rpc AttachDocument (AttachDocumentRequest) returns (AttachDocumentResponse) {} - rpc DetachDocument (DetachDocumentRequest) returns (DetachDocumentResponse) {} - rpc WatchDocuments (WatchDocumentsRequest) returns (stream WatchDocumentsResponse) {} - rpc PushPull (PushPullRequest) returns (PushPullResponse) {} - rpc FetchHistory (FetchHistoryRequest) returns (FetchHistoryResponse) {} -} +import "resources.proto"; -service Cluster { - rpc BroadcastEvent (BroadcastEventRequest) returns (BroadcastEventResponse) {} -} +// Yorkie is a service that provides a API for SDKs. +service Yorkie { + rpc ActivateClient (ActivateClientRequest) returns (ActivateClientResponse) {} + rpc DeactivateClient (DeactivateClientRequest) returns (DeactivateClientResponse) {} + rpc UpdateMetadata (UpdateMetadataRequest) returns (UpdateMetadataResponse) {} -///////////////////////////////////////// -// Messages for Cluster // -///////////////////////////////////////// + rpc AttachDocument (AttachDocumentRequest) returns (AttachDocumentResponse) {} + rpc DetachDocument (DetachDocumentRequest) returns (DetachDocumentResponse) {} + rpc WatchDocuments (WatchDocumentsRequest) returns (stream WatchDocumentsResponse) {} + rpc PushPull (PushPullRequest) returns (PushPullResponse) {} -message BroadcastEventRequest { - bytes publisher_id = 1; - DocEvent event = 2; + rpc ListChanges (ListChangesRequest) returns (ListChangesResponse) {} } -message BroadcastEventResponse {} - -///////////////////////////////////////// -// Messages for RPC // -///////////////////////////////////////// - message ActivateClientRequest { - string client_key = 1; + string client_key = 1; } message ActivateClientResponse { - string client_key = 1; - bytes client_id = 2; + string client_key = 1; + bytes client_id = 2; } message DeactivateClientRequest { - bytes client_id = 1; + bytes client_id = 1; } message DeactivateClientResponse { - bytes client_id = 1; + bytes client_id = 1; } message AttachDocumentRequest { - bytes client_id = 1; - ChangePack change_pack = 2; + bytes client_id = 1; + ChangePack change_pack = 2; } message AttachDocumentResponse { - bytes client_id = 1; - ChangePack change_pack = 2; + bytes client_id = 1; + ChangePack change_pack = 2; } message DetachDocumentRequest { - bytes client_id = 1; - ChangePack change_pack = 2; + bytes client_id = 1; + ChangePack change_pack = 2; } message DetachDocumentResponse { - string client_key = 1; - ChangePack change_pack = 2; + string client_key = 1; + ChangePack change_pack = 2; } message WatchDocumentsRequest { - Client client = 1; - repeated DocumentKey document_keys = 2; + Client client = 1; + repeated DocumentKey document_keys = 2; } message WatchDocumentsResponse { - message Initialization { - map peers_map_by_doc = 1; - } + message Initialization { + map peers_map_by_doc = 1; + } - oneof body { - Initialization initialization = 1; - DocEvent event = 2; - } + oneof body { + Initialization initialization = 1; + DocEvent event = 2; + } } message PushPullRequest { - bytes client_id = 1; - ChangePack change_pack = 2; + bytes client_id = 1; + ChangePack change_pack = 2; } message PushPullResponse { - bytes client_id = 1; - ChangePack change_pack = 2; + bytes client_id = 1; + ChangePack change_pack = 2; } message UpdateMetadataRequest { - Client client = 1; - repeated DocumentKey document_keys = 2; + Client client = 1; + repeated DocumentKey document_keys = 2; } message UpdateMetadataResponse {} -message FetchHistoryRequest { - bytes client_id = 1; - DocumentKey document_key = 2; -} - -message FetchHistoryResponse { - repeated Change changes = 1; -} - -///////////////////////////////////////// -// Messages for ChangePack // -///////////////////////////////////////// - -message ChangePack { - DocumentKey document_key = 1; - Checkpoint checkpoint = 2; - bytes snapshot = 3; - repeated Change changes = 4; - TimeTicket min_synced_ticket = 5; -} - -message Change { - ChangeID id = 1; - string message = 2; - repeated Operation operations = 3; -} - -message ChangeID { - uint32 client_seq = 1; - uint64 server_seq = 2 [jstype = JS_STRING]; - uint64 lamport = 3 [jstype = JS_STRING]; - bytes actor_id = 4; -} - -message Operation { - message Set { - TimeTicket parent_created_at = 1; - string key = 2; - JSONElementSimple value = 3; - TimeTicket executed_at = 4; - } - message Add { - TimeTicket parent_created_at = 1; - TimeTicket prev_created_at = 2; - JSONElementSimple value = 3; - TimeTicket executed_at = 4; - } - message Move { - TimeTicket parent_created_at = 1; - TimeTicket prev_created_at = 2; - TimeTicket created_at = 3; - TimeTicket executed_at = 4; - } - message Remove { - TimeTicket parent_created_at = 1; - TimeTicket created_at = 2; - TimeTicket executed_at = 3; - } - message Edit { - TimeTicket parent_created_at = 1; - TextNodePos from = 2; - TextNodePos to = 3; - map created_at_map_by_actor = 4; - string content = 5; - TimeTicket executed_at = 6; - } - message Select { - TimeTicket parent_created_at = 1; - TextNodePos from = 2; - TextNodePos to = 3; - TimeTicket executed_at = 4; - } - message RichEdit { - TimeTicket parent_created_at = 1; - TextNodePos from = 2; - TextNodePos to = 3; - map created_at_map_by_actor = 4; - string content = 5; - map attributes = 6; - TimeTicket executed_at = 7; - } - message Style { - TimeTicket parent_created_at = 1; - TextNodePos from = 2; - TextNodePos to = 3; - map attributes = 4; - TimeTicket executed_at = 5; - } - message Increase { - TimeTicket parent_created_at = 1; - JSONElementSimple value = 2; - TimeTicket executed_at = 3; - } - - oneof body { - Set set = 1; - Add add = 2; - Move move = 3; - Remove remove = 4; - Edit edit = 5; - Select select = 6; - RichEdit rich_edit = 7; - Style style = 8; - Increase increase = 9; - } -} - -message JSONElementSimple { - TimeTicket created_at = 1; - TimeTicket moved_at = 2; - TimeTicket removed_at = 3; - ValueType type = 4; - bytes value = 5; -} - -///////////////////////////////////////// -// Messages for JSON // -///////////////////////////////////////// - -message JSONElement { - message JSONObject { - repeated RHTNode nodes = 1; - TimeTicket created_at = 2; - TimeTicket moved_at = 3; - TimeTicket removed_at = 4; - } - message JSONArray { - repeated RGANode nodes = 1; - TimeTicket created_at = 2; - TimeTicket moved_at = 3; - TimeTicket removed_at = 4; - } - message Primitive { - ValueType type = 1; - bytes value = 2; - TimeTicket created_at = 3; - TimeTicket moved_at = 4; - TimeTicket removed_at = 5; - } - message Text { - repeated TextNode nodes = 1; - TimeTicket created_at = 2; - TimeTicket moved_at = 3; - TimeTicket removed_at = 4; - } - message RichText { - repeated RichTextNode nodes = 1; - TimeTicket created_at = 2; - TimeTicket moved_at = 3; - TimeTicket removed_at = 4; - } - message Counter { - ValueType type = 1; - bytes value = 2; - TimeTicket created_at = 3; - TimeTicket moved_at = 4; - TimeTicket removed_at = 5; - } - - oneof Body { - JSONObject json_object = 1; - JSONArray json_array = 2; - Primitive primitive = 3; - Text text = 4; - RichText rich_text = 5; - Counter counter = 6; - } -} - -message RHTNode { - string key = 1; - JSONElement element = 2; -} - -message RGANode { - RGANode next = 1; - JSONElement element = 2; -} - -message TextNode { - TextNodeID id = 1; - string value = 2; - TimeTicket removed_at = 3; - TextNodeID ins_prev_id = 4; -} - -message RichTextNodeAttr { - string key = 1; - string value = 2; - TimeTicket updated_at = 3; -} - -message RichTextNode { - TextNodeID id = 1; - map attributes = 2; - string value = 3; - TimeTicket removed_at = 4; - TextNodeID ins_prev_id = 5; -} - -message TextNodeID { - TimeTicket created_at = 1; - int32 offset = 2; -} - -///////////////////////////////////////// -// Messages for Common // -///////////////////////////////////////// - -message Metadata { - int32 clock = 1; - map data = 2; -} - -message Client { - bytes id = 1; - Metadata metadata = 2; -} - -message Clients { - repeated Client clients = 1; -} - -message DocumentKey { - string collection = 1; - string document = 2; -} - -message Checkpoint { - uint64 server_seq = 1 [jstype = JS_STRING]; - uint32 client_seq = 2; -} - -message TextNodePos { - TimeTicket created_at = 1; - int32 offset = 2; - int32 relative_offset = 3; -} - -message TimeTicket { - uint64 lamport = 1 [jstype = JS_STRING]; - uint32 delimiter = 2; - bytes actor_id = 3; -} - -enum ValueType { - NULL = 0; - BOOLEAN = 1; - INTEGER = 2; - LONG = 3; - DOUBLE = 4; - STRING = 5; - BYTES = 6; - DATE = 7; - JSON_OBJECT = 8; - JSON_ARRAY = 9; - TEXT = 10; - RICH_TEXT = 11; - INTEGER_CNT = 12; - LONG_CNT = 13; - DOUBLE_CNT = 14; -} - -enum DocEventType { - DOCUMENTS_CHANGED = 0; - DOCUMENTS_WATCHED = 1; - DOCUMENTS_UNWATCHED = 2; - METADATA_CHANGED = 3; +message ListChangesRequest { + bytes client_id = 1; + DocumentKey document_key = 2; } -message DocEvent { - DocEventType type = 1; - Client publisher = 2; - repeated DocumentKey document_keys = 3; +message ListChangesResponse { + repeated Change changes = 1; } diff --git a/client/client.go b/client/client.go index 1d09d32d5..ba20fd2b7 100644 --- a/client/client.go +++ b/client/client.go @@ -491,9 +491,9 @@ func (c *Client) UpdateMetadata(ctx context.Context, k, v string) error { return nil } -// FetchHistory returns the history of the given document. -func (c *Client) FetchHistory(ctx context.Context, key key.Key) ([]*types.ChangeSummary, error) { - resp, err := c.client.FetchHistory(ctx, &api.FetchHistoryRequest{ +// ListChangeSummaries returns the change summaries of the given document. +func (c *Client) ListChangeSummaries(ctx context.Context, key key.Key) ([]*types.ChangeSummary, error) { + resp, err := c.client.ListChanges(ctx, &api.ListChangesRequest{ ClientId: c.id.Bytes(), DocumentKey: converter.ToDocumentKey(key), }) diff --git a/pkg/document/internal_document.go b/pkg/document/internal_document.go index c91de0bcd..7eb2b43a3 100644 --- a/pkg/document/internal_document.go +++ b/pkg/document/internal_document.go @@ -63,6 +63,7 @@ func NewInternalDocument(k key.Key) *InternalDocument { func NewInternalDocumentFromSnapshot( k key.Key, serverSeq uint64, + lamport uint64, snapshot []byte, ) (*InternalDocument, error) { obj, err := converter.BytesToObject(snapshot) @@ -75,7 +76,7 @@ func NewInternalDocumentFromSnapshot( status: Detached, root: json.NewRoot(obj), checkpoint: change.InitialCheckpoint.NextServerSeq(serverSeq), - changeID: change.InitialID, + changeID: change.InitialID.SyncLamport(lamport), }, nil } @@ -158,6 +159,11 @@ func (d *InternalDocument) SetActor(actor *time.ActorID) { d.changeID = d.changeID.SetActor(actor) } +// Lamport returns the Lamport clock of this document. +func (d *InternalDocument) Lamport() uint64 { + return d.changeID.Lamport() +} + // ActorID returns ID of the actor currently editing the document. func (d *InternalDocument) ActorID() *time.ActorID { return d.changeID.ActorID() diff --git a/pkg/types/auth_webhook.go b/pkg/types/auth_webhook.go index 06a096c44..044a729e7 100644 --- a/pkg/types/auth_webhook.go +++ b/pkg/types/auth_webhook.go @@ -54,7 +54,7 @@ const ( DetachDocument Method = "DetachDocument" PushPull Method = "PushPull" WatchDocuments Method = "WatchDocuments" - FetchHistory Method = "FetchHistory" + ListChanges Method = "ListChangeSummaries" ) // IsAuthMethod returns whether the given method can be used for authorization. @@ -76,7 +76,7 @@ func AuthMethods() []Method { DetachDocument, PushPull, WatchDocuments, - FetchHistory, + ListChanges, } } diff --git a/pkg/types/document_summary.go b/pkg/types/document_summary.go new file mode 100644 index 000000000..e790882bb --- /dev/null +++ b/pkg/types/document_summary.go @@ -0,0 +1,17 @@ +package types + +import ( + "github.com/yorkie-team/yorkie/pkg/document/key" +) + +// DocumentSummary represents a summary of change. +type DocumentSummary struct { + // ID is the unique identifier of the change. + ID string + + // Key is the key of the document. + Key key.Key + + // Snapshot is the string representation of the document. + Snapshot string +} diff --git a/test/integration/history_test.go b/test/integration/history_test.go index 2bde9dc29..37eea61cf 100644 --- a/test/integration/history_test.go +++ b/test/integration/history_test.go @@ -62,7 +62,7 @@ func TestHistory(t *testing.T) { assert.NoError(t, c1.Sync(ctx)) - changes, err := c2.FetchHistory(ctx, d1.Key()) + changes, err := c2.ListChangeSummaries(ctx, d1.Key()) assert.NoError(t, err) assert.Len(t, changes, 3) diff --git a/yorkie/admin/admin.go b/yorkie/admin/admin.go new file mode 100644 index 000000000..459fb8e71 --- /dev/null +++ b/yorkie/admin/admin.go @@ -0,0 +1,39 @@ +package admin + +import ( + "context" + + "github.com/yorkie-team/yorkie/pkg/types" + "github.com/yorkie-team/yorkie/yorkie/backend" + "github.com/yorkie-team/yorkie/yorkie/backend/db" + "github.com/yorkie-team/yorkie/yorkie/packs" +) + +// ListDocumentSummaries returns a list of document summaries. +func ListDocumentSummaries( + ctx context.Context, + be *backend.Backend, + previousID db.ID, + pageSize int, +) ([]*types.DocumentSummary, error) { + docInfo, err := be.DB.FindDocInfosByPreviousIDAndPageSize(ctx, previousID, pageSize) + if err != nil { + return nil, err + } + + var summaries []*types.DocumentSummary + for _, docInfo := range docInfo { + doc, err := packs.BuildDocumentForServerSeq(ctx, be, docInfo, docInfo.ServerSeq) + if err != nil { + return nil, err + } + + summaries = append(summaries, &types.DocumentSummary{ + ID: docInfo.ID.String(), + Key: doc.Key(), + Snapshot: doc.Marshal(), + }) + } + + return summaries, nil +} diff --git a/yorkie/backend/db/db.go b/yorkie/backend/db/db.go index 124aa0ce1..f2105ea70 100644 --- a/yorkie/backend/db/db.go +++ b/yorkie/backend/db/db.go @@ -99,8 +99,8 @@ type DB interface { // CreateSnapshotInfo stores the snapshot of the given document. CreateSnapshotInfo(ctx context.Context, docID ID, doc *document.InternalDocument) error - // FindLastSnapshotInfo finds the last snapshot of the given document. - FindLastSnapshotInfo(ctx context.Context, docID ID) (*SnapshotInfo, error) + // FindClosestSnapshotInfo finds the closest snapshot info in a given serverSeq. + FindClosestSnapshotInfo(ctx context.Context, docID ID, serverSeq uint64) (*SnapshotInfo, error) // UpdateAndFindMinSyncedTicket updates the given serverSeq of the given client // and returns the min synced ticket. @@ -118,4 +118,11 @@ type DB interface { docID ID, serverSeq uint64, ) error + + // FindDocInfosByPreviousIDAndPageSize returns the documentInfos of the given previousID and pageSize. + FindDocInfosByPreviousIDAndPageSize( + ctx context.Context, + previousID ID, + pageSize int, + ) ([]*DocInfo, error) } diff --git a/yorkie/backend/db/memory/db.go b/yorkie/backend/db/memory/db.go index 37f11dff1..1a8c0bbb7 100644 --- a/yorkie/backend/db/memory/db.go +++ b/yorkie/backend/db/memory/db.go @@ -19,7 +19,6 @@ package memory import ( "context" "fmt" - "math" gotime "time" "github.com/hashicorp/go-memdb" @@ -404,6 +403,7 @@ func (d *DB) CreateSnapshotInfo( ID: newID(), DocID: docID, ServerSeq: doc.Checkpoint().ServerSeq, + Lamport: doc.Lamport(), Snapshot: snapshot, CreatedAt: gotime.Now(), }); err != nil { @@ -413,10 +413,11 @@ func (d *DB) CreateSnapshotInfo( return nil } -// FindLastSnapshotInfo finds the last snapshot of the given document. -func (d *DB) FindLastSnapshotInfo( +// FindClosestSnapshotInfo finds the last snapshot of the given document. +func (d *DB) FindClosestSnapshotInfo( ctx context.Context, docID db.ID, + serverSeq uint64, ) (*db.SnapshotInfo, error) { txn := d.db.Txn(false) defer txn.Abort() @@ -425,7 +426,7 @@ func (d *DB) FindLastSnapshotInfo( tblSnapshots, "doc_id_server_seq", docID.String(), - uint64(math.MaxUint64), + serverSeq, ) if err != nil { return nil, err @@ -561,6 +562,39 @@ func (d *DB) UpdateSyncedSeq( return nil } +// FindDocInfosByPreviousIDAndPageSize returns the docInfos of the given previousID and pageSize. +func (d *DB) FindDocInfosByPreviousIDAndPageSize( + ctx context.Context, + previousID db.ID, + pageSize int, +) ([]*db.DocInfo, error) { + txn := d.db.Txn(false) + defer txn.Abort() + + iterator, err := txn.LowerBound( + tblDocuments, + "id", + previousID.String(), + ) + if err != nil { + return nil, err + } + + var docInfos []*db.DocInfo + for raw := iterator.Next(); raw != nil; raw = iterator.Next() { + info := raw.(*db.DocInfo) + if len(docInfos) >= pageSize { + break + } + + if info.ID != previousID { + docInfos = append(docInfos, info) + } + } + + return docInfos, nil +} + func (d *DB) findTicketByServerSeq( txn *memdb.Txn, docID db.ID, diff --git a/yorkie/backend/db/memory/db_test.go b/yorkie/backend/db/memory/db_test.go index e703b1a54..450257722 100644 --- a/yorkie/backend/db/memory/db_test.go +++ b/yorkie/backend/db/memory/db_test.go @@ -168,15 +168,57 @@ func TestDB(t *testing.T) { })) assert.NoError(t, memdb.CreateSnapshotInfo(ctx, docInfo.ID, doc.InternalDocument())) - snapshot, err := memdb.FindLastSnapshotInfo(ctx, docInfo.ID) + snapshot, err := memdb.FindClosestSnapshotInfo(ctx, docInfo.ID, change.MaxCheckpoint.ServerSeq) assert.NoError(t, err) assert.Equal(t, uint64(0), snapshot.ServerSeq) pack := change.NewPack(doc.Key(), doc.Checkpoint().NextServerSeq(1), nil, nil) assert.NoError(t, doc.ApplyChangePack(pack)) assert.NoError(t, memdb.CreateSnapshotInfo(ctx, docInfo.ID, doc.InternalDocument())) - snapshot, err = memdb.FindLastSnapshotInfo(ctx, docInfo.ID) + snapshot, err = memdb.FindClosestSnapshotInfo(ctx, docInfo.ID, change.MaxCheckpoint.ServerSeq) assert.NoError(t, err) assert.Equal(t, uint64(1), snapshot.ServerSeq) + + pack = change.NewPack(doc.Key(), doc.Checkpoint().NextServerSeq(2), nil, nil) + assert.NoError(t, doc.ApplyChangePack(pack)) + assert.NoError(t, memdb.CreateSnapshotInfo(ctx, docInfo.ID, doc.InternalDocument())) + snapshot, err = memdb.FindClosestSnapshotInfo(ctx, docInfo.ID, change.MaxCheckpoint.ServerSeq) + assert.NoError(t, err) + assert.Equal(t, uint64(2), snapshot.ServerSeq) + + assert.NoError(t, memdb.CreateSnapshotInfo(ctx, docInfo.ID, doc.InternalDocument())) + snapshot, err = memdb.FindClosestSnapshotInfo(ctx, docInfo.ID, 1) + assert.NoError(t, err) + assert.Equal(t, uint64(1), snapshot.ServerSeq) + }) + + t.Run("paging docInfo test", func(t *testing.T) { + localDB, err := memory.New() + assert.NoError(t, err) + + clientInfo, _ := localDB.ActivateClient(ctx, t.Name()) + + var givenKeys []string + for i := 0; i < 11; i++ { + docInfo, err := localDB.FindDocInfoByKey(ctx, clientInfo, fmt.Sprintf("tests$%s-%d", t.Name(), i), true) + assert.NoError(t, err) + givenKeys = append(givenKeys, docInfo.CombinedKey) + } + + var keys []string + previousID := db.ID("") + for { + docInfos, err := localDB.FindDocInfosByPreviousIDAndPageSize(ctx, previousID, 10) + assert.NoError(t, err) + if len(docInfos) == 0 { + break + } + for _, docInfo := range docInfos { + keys = append(keys, docInfo.CombinedKey) + } + previousID = docInfos[len(docInfos)-1].ID + } + + assert.Equal(t, givenKeys, keys) }) } diff --git a/yorkie/backend/db/mongo/client.go b/yorkie/backend/db/mongo/client.go index 1797672ef..2293d32e6 100644 --- a/yorkie/backend/db/mongo/client.go +++ b/yorkie/backend/db/mongo/client.go @@ -453,6 +453,7 @@ func (c *Client) CreateSnapshotInfo( if _, err := c.collection(colSnapshots).InsertOne(ctx, bson.M{ "doc_id": encodedDocID, "server_seq": doc.Checkpoint().ServerSeq, + "lamport": doc.Lamport(), "snapshot": snapshot, "created_at": gotime.Now(), }); err != nil { @@ -463,10 +464,11 @@ func (c *Client) CreateSnapshotInfo( return nil } -// FindLastSnapshotInfo finds the last snapshot of the given document. -func (c *Client) FindLastSnapshotInfo( +// FindClosestSnapshotInfo finds the last snapshot of the given document. +func (c *Client) FindClosestSnapshotInfo( ctx context.Context, docID db.ID, + serverSeq uint64, ) (*db.SnapshotInfo, error) { encodedDocID, err := encodeID(docID) if err != nil { @@ -475,6 +477,9 @@ func (c *Client) FindLastSnapshotInfo( result := c.collection(colSnapshots).FindOne(ctx, bson.M{ "doc_id": encodedDocID, + "server_seq": bson.M{ + "$lte": serverSeq, + }, }, options.FindOne().SetSort(bson.M{ "server_seq": -1, })) @@ -548,6 +553,44 @@ func (c *Client) UpdateAndFindMinSyncedTicket( ), nil } +// FindDocInfosByPreviousIDAndPageSize returns the docInfos of the given previousID and pageSize. +func (c *Client) FindDocInfosByPreviousIDAndPageSize( + ctx context.Context, + previousID db.ID, + pageSize int, +) ([]*db.DocInfo, error) { + filter := bson.M{} + if previousID != "" { + encodedPreviousID, err := encodeID(previousID) + if err != nil { + return nil, err + } + filter = bson.M{ + "_id": bson.M{ + "$gt": encodedPreviousID, + }, + } + } + + cursor, err := c.collection(colDocuments).Find( + ctx, + filter, + options.Find().SetLimit(int64(pageSize)), + ) + if err != nil { + logging.From(ctx).Error(err) + return nil, err + } + + var infos []*db.DocInfo + if err := cursor.All(ctx, &infos); err != nil { + logging.From(ctx).Error(cursor.Err()) + return nil, cursor.Err() + } + + return infos, nil +} + // UpdateSyncedSeq updates the syncedSeq of the given client. func (c *Client) UpdateSyncedSeq( ctx context.Context, diff --git a/yorkie/backend/db/snapshot_info.go b/yorkie/backend/db/snapshot_info.go index f8b4bb5e9..6688a7b21 100644 --- a/yorkie/backend/db/snapshot_info.go +++ b/yorkie/backend/db/snapshot_info.go @@ -22,9 +22,21 @@ import ( // SnapshotInfo is a structure representing information of the snapshot. type SnapshotInfo struct { - ID ID `bson:"_id"` - DocID ID `bson:"doc_id"` - ServerSeq uint64 `bson:"server_seq"` - Snapshot []byte `bson:"snapshot"` + // ID is the unique ID of the snapshot. + ID ID `bson:"_id"` + + // DocID is the ID of the document which the snapshot belongs to. + DocID ID `bson:"doc_id"` + + // ServerSeq is the sequence number of the server which the snapshot belongs to. + ServerSeq uint64 `bson:"server_seq"` + + // Lamport is the Lamport timestamp of the snapshot. + Lamport uint64 `bson:"lamport"` + + // Snapshot is the snapshot data. + Snapshot []byte `bson:"snapshot"` + + // CreatedAt is the time when the snapshot is created. CreatedAt time.Time `bson:"created_at"` } diff --git a/yorkie/packs/packs.go b/yorkie/packs/packs.go index e13ae23e7..65b4a0f84 100644 --- a/yorkie/packs/packs.go +++ b/yorkie/packs/packs.go @@ -21,6 +21,9 @@ import ( "fmt" gotime "time" + "go.uber.org/zap" + + "github.com/yorkie-team/yorkie/pkg/document" "github.com/yorkie-team/yorkie/pkg/document/change" "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/types" @@ -155,3 +158,65 @@ func PushPull( return respPack, nil } + +// BuildDocumentForServerSeq returns a new document for the given serverSeq. +func BuildDocumentForServerSeq( + ctx context.Context, + be *backend.Backend, + docInfo *db.DocInfo, + serverSeq uint64, +) (*document.InternalDocument, error) { + snapshotInfo, err := be.DB.FindClosestSnapshotInfo(ctx, docInfo.ID, serverSeq) + if err != nil { + return nil, err + } + + docKey, err := docInfo.Key() + if err != nil { + return nil, err + } + + doc, err := document.NewInternalDocumentFromSnapshot( + docKey, + snapshotInfo.ServerSeq, + snapshotInfo.Lamport, + snapshotInfo.Snapshot, + ) + if err != nil { + return nil, err + } + + // TODO(hackerwins): If the Snapshot is missing, we may have a very large + // number of changes to read at once here. We need to split changes by a + // certain size (e.g. 100) and read and gradually reflect it into the document. + changes, err := be.DB.FindChangesBetweenServerSeqs( + ctx, + docInfo.ID, + snapshotInfo.ServerSeq+1, + serverSeq, + ) + if err != nil { + return nil, err + } + + if err := doc.ApplyChangePack(change.NewPack( + docKey, + change.InitialCheckpoint.NextServerSeq(serverSeq), + changes, + nil, + )); err != nil { + return nil, err + } + + if logging.Enabled(zap.DebugLevel) { + logging.From(ctx).Debugf( + "after apply %d changes: elements: %d removeds: %d, %s", + len(changes), + doc.Root().ElementMapLen(), + doc.Root().RemovedElementLen(), + doc.RootObject().Marshal(), + ) + } + + return doc, nil +} diff --git a/yorkie/packs/pushpull.go b/yorkie/packs/pushpull.go index 61d5584c3..cbb442415 100644 --- a/yorkie/packs/pushpull.go +++ b/yorkie/packs/pushpull.go @@ -21,10 +21,7 @@ import ( "errors" "fmt" - "go.uber.org/zap" - "github.com/yorkie-team/yorkie/api/converter" - "github.com/yorkie-team/yorkie/pkg/document" "github.com/yorkie-team/yorkie/pkg/document/change" "github.com/yorkie-team/yorkie/yorkie/backend" "github.com/yorkie-team/yorkie/yorkie/backend/db" @@ -87,7 +84,7 @@ func pullPack( clientInfo *db.ClientInfo, docInfo *db.DocInfo, reqPack *change.Pack, - pushedCP change.Checkpoint, + cpAfterPush change.Checkpoint, initialServerSeq uint64, ) (*ServerPack, error) { docKey, err := docInfo.Key() @@ -106,19 +103,72 @@ func pullPack( // Pull changes from DB if the size of changes for the response is less than the snapshot threshold. if initialServerSeq-reqPack.Checkpoint.ServerSeq < be.Config.SnapshotThreshold { - cpAfterPull, pulledChanges, err := pullChangeInfos(ctx, be, clientInfo, docInfo, reqPack, pushedCP, initialServerSeq) + cpAfterPull, pulledChanges, err := pullChangeInfos( + ctx, + be, + clientInfo, + docInfo, + reqPack, + cpAfterPush, + initialServerSeq, + ) if err != nil { return nil, err } return NewServerPack(docKey, cpAfterPull, pulledChanges, nil), err } - // Pull snapshot from DB if the size of changes for the response is greater than the snapshot threshold. - cpAfterPull, snapshot, err := pullSnapshot(ctx, be, clientInfo, docInfo, reqPack, pushedCP, initialServerSeq) + return pullSnapshot(ctx, be, clientInfo, docInfo, reqPack, cpAfterPush, initialServerSeq) +} + +// pullSnapshot pulls the snapshot from DB. +func pullSnapshot( + ctx context.Context, + be *backend.Backend, + clientInfo *db.ClientInfo, + docInfo *db.DocInfo, + reqPack *change.Pack, + cpAfterPush change.Checkpoint, + initialServerSeq uint64, +) (*ServerPack, error) { + docKey, err := docInfo.Key() + if err != nil { + return nil, err + } + + // Build document from DB if the size of changes for the response is greater than the snapshot threshold. + doc, err := BuildDocumentForServerSeq(ctx, be, docInfo, initialServerSeq) + if err != nil { + return nil, err + } + + // Apply changes that are in the request pack. + if reqPack.HasChanges() { + if err := doc.ApplyChangePack(change.NewPack( + docKey, + doc.Checkpoint().NextServerSeq(docInfo.ServerSeq), + reqPack.Changes, + nil, + )); err != nil { + return nil, err + } + } + cpAfterPull := cpAfterPush.NextServerSeq(docInfo.ServerSeq) + + snapshot, err := converter.ObjectToBytes(doc.RootObject()) if err != nil { return nil, err } + logging.From(ctx).Infof( + "PULL: '%s' build snapshot with changes(%d~%d) from '%s', cp: %s", + clientInfo.ID, + reqPack.Checkpoint.ServerSeq+1, + initialServerSeq, + docInfo.CombinedKey, + cpAfterPull.String(), + ) + return NewServerPack(docKey, cpAfterPull, nil, snapshot), err } @@ -157,93 +207,3 @@ func pullChangeInfos( return cpAfterPull, pulledChanges, nil } - -func pullSnapshot( - ctx context.Context, - be *backend.Backend, - clientInfo *db.ClientInfo, - docInfo *db.DocInfo, - pack *change.Pack, - pushedCP change.Checkpoint, - initialServerSeq uint64, -) (change.Checkpoint, []byte, error) { - snapshotInfo, err := be.DB.FindLastSnapshotInfo(ctx, docInfo.ID) - if err != nil { - return change.InitialCheckpoint, nil, err - } - - if snapshotInfo.ServerSeq >= initialServerSeq { - pulledCP := pushedCP.NextServerSeq(docInfo.ServerSeq) - logging.From(ctx).Infof( - "PULL: '%s' pulls snapshot without changes from '%s', cp: %s", - clientInfo.ID, - docInfo.CombinedKey, - pulledCP.String(), - ) - return pushedCP.NextServerSeq(docInfo.ServerSeq), snapshotInfo.Snapshot, nil - } - - docKey, err := docInfo.Key() - if err != nil { - return change.InitialCheckpoint, nil, err - } - - doc, err := document.NewInternalDocumentFromSnapshot( - docKey, - snapshotInfo.ServerSeq, - snapshotInfo.Snapshot, - ) - if err != nil { - return change.InitialCheckpoint, nil, err - } - - // TODO(hackerwins): If the Snapshot is missing, we may have a very large - // number of changes to read at once here. We need to split changes by a - // certain size (e.g. 100) and read and gradually reflect it into the document. - changes, err := be.DB.FindChangesBetweenServerSeqs( - ctx, - docInfo.ID, - snapshotInfo.ServerSeq+1, - initialServerSeq, - ) - if err != nil { - return change.InitialCheckpoint, nil, err - } - - if err := doc.ApplyChangePack(change.NewPack( - docKey, - change.InitialCheckpoint.NextServerSeq(docInfo.ServerSeq), - changes, - nil, - )); err != nil { - return change.InitialCheckpoint, nil, err - } - - if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf( - "after apply %d changes: elements: %d removeds: %d, %s", - len(pack.Changes), - doc.Root().ElementMapLen(), - doc.Root().RemovedElementLen(), - doc.RootObject().Marshal(), - ) - } - - pulledCP := pushedCP.NextServerSeq(docInfo.ServerSeq) - - logging.From(ctx).Infof( - "PULL: '%s' pulls snapshot with changes(%d~%d) from '%s', cp: %s", - clientInfo.ID, - pack.Checkpoint.ServerSeq+1, - initialServerSeq, - docInfo.CombinedKey, - pulledCP.String(), - ) - - snapshot, err := converter.ObjectToBytes(doc.RootObject()) - if err != nil { - return change.InitialCheckpoint, nil, err - } - - return pulledCP, snapshot, nil -} diff --git a/yorkie/packs/snapshots.go b/yorkie/packs/snapshots.go index 3ef91a6f7..e0e7e7a7b 100644 --- a/yorkie/packs/snapshots.go +++ b/yorkie/packs/snapshots.go @@ -33,14 +33,13 @@ func storeSnapshot( docInfo *db.DocInfo, minSyncedTicket *time.Ticket, ) error { - // 01. get the last snapshot of this docInfo + // 01. get the closest snapshot of this docInfo // TODO: For performance issue, we only need to read the snapshot's metadata. - snapshotInfo, err := be.DB.FindLastSnapshotInfo(ctx, docInfo.ID) + snapshotInfo, err := be.DB.FindClosestSnapshotInfo(ctx, docInfo.ID, docInfo.ServerSeq) if err != nil { return err } - - if snapshotInfo.ServerSeq >= docInfo.ServerSeq { + if snapshotInfo.ServerSeq == docInfo.ServerSeq { return nil } if docInfo.ServerSeq-snapshotInfo.ServerSeq < be.Config.SnapshotInterval { @@ -67,6 +66,7 @@ func storeSnapshot( doc, err := document.NewInternalDocumentFromSnapshot( docKey, snapshotInfo.ServerSeq, + snapshotInfo.Lamport, snapshotInfo.Snapshot, ) if err != nil { diff --git a/yorkie/rpc/admin_server.go b/yorkie/rpc/admin_server.go new file mode 100644 index 000000000..1b83b2906 --- /dev/null +++ b/yorkie/rpc/admin_server.go @@ -0,0 +1,42 @@ +package rpc + +import ( + "context" + + "github.com/yorkie-team/yorkie/api" + "github.com/yorkie-team/yorkie/api/converter" + "github.com/yorkie-team/yorkie/yorkie/admin" + "github.com/yorkie-team/yorkie/yorkie/backend" + "github.com/yorkie-team/yorkie/yorkie/backend/db" +) + +type adminServer struct { + backend *backend.Backend +} + +// newAdminServer creates a new adminServer. +func newAdminServer(be *backend.Backend) *adminServer { + return &adminServer{ + backend: be, + } +} + +// ListDocuments lists documents. +func (s *adminServer) ListDocuments( + ctx context.Context, + req *api.ListDocumentsRequest, +) (*api.ListDocumentsResponse, error) { + documents, err := admin.ListDocumentSummaries( + ctx, + s.backend, + db.ID(req.PreviousId), + int(req.PageSize), + ) + if err != nil { + return nil, err + } + + return &api.ListDocumentsResponse{ + Documents: converter.ToDocumentSummaries(documents), + }, nil +} diff --git a/yorkie/rpc/server.go b/yorkie/rpc/server.go index abff6adfa..ec348d517 100644 --- a/yorkie/rpc/server.go +++ b/yorkie/rpc/server.go @@ -80,9 +80,13 @@ func NewServer(conf *Config, be *backend.Backend) (*Server, error) { grpcServer := grpc.NewServer(opts...) healthpb.RegisterHealthServer(grpcServer, health.NewServer()) api.RegisterYorkieServer(grpcServer, newYorkieServer(yorkieServiceCtx, be)) - api.RegisterClusterServer(grpcServer, newClusterServer(be)) be.Metrics.RegisterGRPCServer(grpcServer) + // TODO(hackerwins): AdminServer and ClusterServer need to be handled by different authentication mechanism. + // Consider extracting the servers to another grpcServer. + api.RegisterClusterServer(grpcServer, newClusterServer(be)) + api.RegisterAdminServer(grpcServer, newAdminServer(be)) + return &Server{ conf: conf, grpcServer: grpcServer, diff --git a/yorkie/rpc/yorkie_server.go b/yorkie/rpc/yorkie_server.go index bac207e6c..4f6ea0cd1 100644 --- a/yorkie/rpc/yorkie_server.go +++ b/yorkie/rpc/yorkie_server.go @@ -431,11 +431,11 @@ func (s *yorkieServer) UpdateMetadata( return &api.UpdateMetadataResponse{}, nil } -// FetchHistory fetches the history of the given document. -func (s *yorkieServer) FetchHistory( +// ListChanges lists of changes for the given document. +func (s *yorkieServer) ListChanges( ctx context.Context, - req *api.FetchHistoryRequest, -) (*api.FetchHistoryResponse, error) { + req *api.ListChangesRequest, +) (*api.ListChangesResponse, error) { actorID, err := time.ActorIDFromBytes(req.ClientId) if err != nil { return nil, err @@ -443,7 +443,7 @@ func (s *yorkieServer) FetchHistory( docKey := converter.FromDocumentKey(req.DocumentKey) if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ - Method: types.FetchHistory, + Method: types.ListChanges, Attributes: []types.AccessAttribute{{ Key: docKey.CombinedKey(), Verb: types.Read, @@ -477,7 +477,7 @@ func (s *yorkieServer) FetchHistory( return nil, err } - return &api.FetchHistoryResponse{ + return &api.ListChangesResponse{ Changes: pbChanges, }, nil }