From 73a4547d3351858c3370e044b2a95ec396d91ce3 Mon Sep 17 00:00:00 2001 From: sejongk Date: Mon, 28 Aug 2023 18:35:43 +0900 Subject: [PATCH 01/24] Update proto --- api/yorkie/v1/resources.proto | 6 +++++ api/yorkie/v1/yorkie.proto | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/api/yorkie/v1/resources.proto b/api/yorkie/v1/resources.proto index 281b5906d..3ee8a3cd3 100644 --- a/api/yorkie/v1/resources.proto +++ b/api/yorkie/v1/resources.proto @@ -363,3 +363,9 @@ message DocEvent { DocEventType type = 1; string publisher = 2; } + +message BroadcastEvent { + string publisher = 1; + string type = 2; + string payload = 3; +} \ No newline at end of file diff --git a/api/yorkie/v1/yorkie.proto b/api/yorkie/v1/yorkie.proto index 639ddd37d..d5445e8ec 100644 --- a/api/yorkie/v1/yorkie.proto +++ b/api/yorkie/v1/yorkie.proto @@ -35,6 +35,11 @@ service YorkieService { rpc PushPullChanges (PushPullChangesRequest) returns (PushPullChangesResponse) {} rpc WatchDocument (WatchDocumentRequest) returns (stream WatchDocumentResponse) {} + + rpc WatchEvents (WatchEventsRequest) returns (stream WatchEventsResponse) {} + rpc SubscribeEvent (SubscribeEventRequest) returns (SubscribeEventResponse) {} + rpc UnsubscribeEvent (UnsubscribeEventRequest) returns (UnsubscribeEventResponse) {} + rpc BroadcastEvent (BroadcastEventRequest) returns (BroadcastEventResponse) {} } message ActivateClientRequest { @@ -109,3 +114,39 @@ message PushPullChangesRequest { message PushPullChangesResponse { ChangePack change_pack = 1; } + +message WatchEventsRequest { + string client_id = 1; + string document_id = 2; +} + +message WatchEventsResponse { + BroadcastEvent event = 1; +} + +message SubscribeEventRequest { + string client_id = 1; + string document_id = 2; + string type = 3; +} + +message SubscribeEventResponse { +} + +message UnsubscribeEventRequest { + string client_id = 1; + string document_id = 2; + string type = 3; +} + +message UnsubscribeEventResponse { +} + +message BroadcastEventRequest { + string client_id = 1; + string document_id = 2; + BroadcastEvent event = 3; +} + +message BroadcastEventResponse { +} \ No newline at end of file From f80738aed09cd52bbd4e459546c74d9b727f8630 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 30 Aug 2023 18:33:19 +0900 Subject: [PATCH 02/24] Update proto --- api/types/broadcast.go | 26 + api/yorkie/v1/resources.pb.go | 615 +++-- api/yorkie/v1/resources.proto | 2 +- api/yorkie/v1/yorkie.pb.go | 4462 +++++++++++++++++++++++---------- api/yorkie/v1/yorkie.proto | 24 +- 5 files changed, 3647 insertions(+), 1482 deletions(-) create mode 100644 api/types/broadcast.go diff --git a/api/types/broadcast.go b/api/types/broadcast.go new file mode 100644 index 000000000..b711be82d --- /dev/null +++ b/api/types/broadcast.go @@ -0,0 +1,26 @@ +/* + * Copyright 2021 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. + */ + +// Package types provides the types used in the Yorkie API. This package is +// used by both the server and the client. +package types + +const ( + Document EventType = "Document" + Watch EventType = "Watch" +) + +type EventType string diff --git a/api/yorkie/v1/resources.pb.go b/api/yorkie/v1/resources.pb.go index e7e1c9682..c17b57331 100644 --- a/api/yorkie/v1/resources.pb.go +++ b/api/yorkie/v1/resources.pb.go @@ -3321,6 +3321,69 @@ func (m *DocEvent) GetPublisher() string { return "" } +type BroadcastEvent struct { + Publisher string `protobuf:"bytes,1,opt,name=publisher,proto3" json:"publisher,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BroadcastEvent) Reset() { *m = BroadcastEvent{} } +func (m *BroadcastEvent) String() string { return proto.CompactTextString(m) } +func (*BroadcastEvent) ProtoMessage() {} +func (*BroadcastEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_36361b2f5d0f0896, []int{26} +} +func (m *BroadcastEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BroadcastEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BroadcastEvent.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 *BroadcastEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastEvent.Merge(m, src) +} +func (m *BroadcastEvent) XXX_Size() int { + return m.Size() +} +func (m *BroadcastEvent) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_BroadcastEvent proto.InternalMessageInfo + +func (m *BroadcastEvent) GetPublisher() string { + if m != nil { + return m.Publisher + } + return "" +} + +func (m *BroadcastEvent) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *BroadcastEvent) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + func init() { proto.RegisterEnum("yorkie.v1.ValueType", ValueType_name, ValueType_value) proto.RegisterEnum("yorkie.v1.DocEventType", DocEventType_name, DocEventType_value) @@ -3377,175 +3440,178 @@ func init() { proto.RegisterType((*TextNodePos)(nil), "yorkie.v1.TextNodePos") proto.RegisterType((*TimeTicket)(nil), "yorkie.v1.TimeTicket") proto.RegisterType((*DocEvent)(nil), "yorkie.v1.DocEvent") + proto.RegisterType((*BroadcastEvent)(nil), "yorkie.v1.BroadcastEvent") } func init() { proto.RegisterFile("yorkie/v1/resources.proto", fileDescriptor_36361b2f5d0f0896) } var fileDescriptor_36361b2f5d0f0896 = []byte{ - // 2599 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xcd, 0x8f, 0x1b, 0x49, - 0x15, 0x9f, 0x6e, 0xb7, 0x3f, 0xfa, 0x4d, 0x32, 0xe3, 0xd4, 0xe4, 0xc3, 0x71, 0x92, 0xd9, 0x89, - 0x97, 0x5d, 0x66, 0x13, 0xf0, 0x7c, 0xb0, 0xbb, 0x2c, 0x09, 0x01, 0x3c, 0x76, 0x27, 0xe3, 0xec, - 0xc4, 0x33, 0xb4, 0x3d, 0x59, 0xb2, 0x02, 0xb5, 0x7a, 0xba, 0x6b, 0x66, 0x7a, 0xc7, 0xee, 0xf6, - 0x76, 0xb7, 0xbd, 0xb1, 0x84, 0x84, 0x84, 0x40, 0xe2, 0xca, 0x0d, 0xfe, 0x04, 0x2e, 0xdc, 0xf7, - 0x08, 0x07, 0x84, 0x84, 0x10, 0x2b, 0xb1, 0x12, 0x57, 0x36, 0x1c, 0x10, 0xdc, 0x10, 0x12, 0x37, - 0x24, 0x54, 0x1f, 0xdd, 0x6e, 0xdb, 0x6d, 0x8f, 0x63, 0x86, 0x55, 0x22, 0x6e, 0x5d, 0x55, 0xbf, - 0x57, 0xf5, 0x5e, 0xbd, 0x5f, 0xbd, 0x7a, 0xd5, 0x55, 0x70, 0xb5, 0xe7, 0xb8, 0x27, 0x16, 0x5e, - 0xeb, 0x6e, 0xac, 0xb9, 0xd8, 0x73, 0x3a, 0xae, 0x81, 0xbd, 0x62, 0xdb, 0x75, 0x7c, 0x07, 0xc9, - 0xac, 0xa9, 0xd8, 0xdd, 0xc8, 0xbf, 0x72, 0xe4, 0x38, 0x47, 0x4d, 0xbc, 0x46, 0x1b, 0x0e, 0x3a, - 0x87, 0x6b, 0xbe, 0xd5, 0xc2, 0x9e, 0xaf, 0xb7, 0xda, 0x0c, 0x9b, 0x5f, 0x1e, 0x06, 0x7c, 0xe4, - 0xea, 0xed, 0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x2d, 0xfa, 0xbd, 0x4b, 0x81, 0xdb, - 0x73, 0x2a, 0x10, 0x39, 0x56, 0x42, 0x25, 0xa0, 0x25, 0x4d, 0x77, 0x5d, 0xbd, 0xc7, 0xed, 0x5f, - 0x99, 0xd0, 0x49, 0x89, 0xe0, 0xc8, 0xf1, 0x8b, 0x48, 0xd1, 0x02, 0xfb, 0x3b, 0x65, 0xb5, 0x2c, - 0xdf, 0x0a, 0xcf, 0xd0, 0xe3, 0x7a, 0xd8, 0x0b, 0x70, 0xa4, 0x87, 0x50, 0x08, 0x6d, 0x80, 0xe4, - 0xe3, 0xa7, 0x01, 0x8d, 0xae, 0x8d, 0x11, 0x26, 0x5b, 0x18, 0x39, 0x1a, 0x13, 0x28, 0xba, 0x43, - 0xb2, 0xae, 0x8e, 0xed, 0x63, 0x97, 0x07, 0x80, 0xe5, 0x31, 0x52, 0x65, 0x86, 0xda, 0x9e, 0x53, - 0x03, 0x01, 0x3a, 0x9c, 0x8b, 0x83, 0xe3, 0xf1, 0xd8, 0xe1, 0x5c, 0x4c, 0x4f, 0xfc, 0x04, 0x9a, - 0xff, 0x54, 0x00, 0xe8, 0xcf, 0x21, 0x5a, 0x85, 0xa4, 0x4d, 0xa2, 0x52, 0x4e, 0xa0, 0x2b, 0x29, - 0xba, 0xea, 0xd4, 0xed, 0x06, 0x09, 0x58, 0x2a, 0x03, 0xcc, 0x98, 0x95, 0x47, 0x39, 0x99, 0x98, - 0x81, 0x93, 0xd2, 0x74, 0x9c, 0xcc, 0xff, 0x51, 0x00, 0x39, 0xf4, 0xea, 0x44, 0xab, 0x1e, 0x94, - 0x5e, 0x1e, 0xab, 0xfe, 0x26, 0x80, 0x1c, 0x32, 0x2d, 0x5c, 0x77, 0xc2, 0xf4, 0xeb, 0x4e, 0x8c, - 0xac, 0xbb, 0x19, 0xcf, 0x84, 0x51, 0x5b, 0xa5, 0x19, 0x6c, 0x4d, 0x4e, 0x69, 0xeb, 0x1f, 0x04, - 0x90, 0xc8, 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d, 0x0b, 0x3f, 0xfb, 0xcb, 0xf2, - 0x1c, 0x5c, 0x30, 0x71, 0x37, 0x60, 0x8a, 0xde, 0xb6, 0x8a, 0xdd, 0x8d, 0x3d, 0xe1, 0x7d, 0xa9, - 0x78, 0xb7, 0xbb, 0x71, 0x90, 0xa2, 0xb1, 0xf1, 0x2b, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x63, - 0xfc, 0xff, 0x26, 0x54, 0x28, 0x00, 0x00, + // 2632 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xcf, 0x8f, 0x1b, 0x49, + 0xf5, 0x9f, 0x6e, 0xb7, 0x7f, 0xf4, 0x9b, 0x64, 0xc6, 0xa9, 0xc9, 0x0f, 0xc7, 0x49, 0x66, 0x27, + 0xde, 0xef, 0xee, 0x77, 0x36, 0x01, 0xcf, 0x0f, 0x76, 0x97, 0x25, 0x21, 0x80, 0xc7, 0xee, 0x64, + 0x9c, 0x9d, 0x78, 0x86, 0xb6, 0x27, 0x4b, 0x56, 0x8b, 0x5a, 0x3d, 0xdd, 0x35, 0x33, 0xbd, 0x63, + 0x77, 0x7b, 0xbb, 0xdb, 0xde, 0x58, 0x42, 0x42, 0x42, 0x20, 0x71, 0xe5, 0x06, 0x7f, 0x02, 0x17, + 0xee, 0x7b, 0x84, 0x03, 0x42, 0x42, 0x88, 0x95, 0x58, 0x89, 0x2b, 0x1b, 0x0e, 0x08, 0x6e, 0x08, + 0x89, 0x1b, 0x12, 0xaa, 0x1f, 0xdd, 0x6e, 0xdb, 0x6d, 0x8f, 0x63, 0x86, 0x55, 0x22, 0x6e, 0x5d, + 0x55, 0x9f, 0x57, 0xf5, 0x5e, 0xbd, 0x4f, 0xbd, 0x7a, 0xd5, 0x55, 0x70, 0xb5, 0xe7, 0xb8, 0x27, + 0x16, 0x5e, 0xeb, 0x6e, 0xac, 0xb9, 0xd8, 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x09, + 0xba, 0x06, 0x57, 0xca, 0xdb, 0xa5, 0xda, 0x03, 0x45, 0x6b, 0x3c, 0xd9, 0x53, 0xb4, 0xfd, 0x5a, + 0x7d, 0x4f, 0x29, 0x57, 0xef, 0x57, 0x95, 0x4a, 0x76, 0x0e, 0x2d, 0xc1, 0x62, 0xb4, 0x71, 0x6f, + 0xbf, 0x91, 0x15, 0xd0, 0x65, 0x40, 0xd1, 0xca, 0x8a, 0xb2, 0xa3, 0x34, 0x94, 0xac, 0x88, 0x2e, + 0xc1, 0x85, 0x68, 0x7d, 0x79, 0x47, 0x29, 0xa9, 0xd9, 0x44, 0xa1, 0x0b, 0x99, 0x40, 0x09, 0xb4, + 0x01, 0x12, 0xa1, 0x32, 0xdf, 0x7d, 0x6e, 0xc4, 0xe8, 0x59, 0xac, 0xe8, 0xbe, 0xce, 0xb6, 0x46, + 0x0a, 0xcd, 0x7f, 0x15, 0xe4, 0xb0, 0xea, 0x79, 0x7e, 0x85, 0x15, 0x6a, 0xc4, 0xcc, 0xf0, 0x8d, + 0xcc, 0xe0, 0x43, 0x0c, 0x21, 0xee, 0x21, 0xc6, 0xe0, 0x53, 0x0e, 0x71, 0xe8, 0x29, 0x47, 0xe1, + 0x87, 0x02, 0xcc, 0x47, 0x2e, 0x09, 0xce, 0x76, 0x3f, 0x44, 0xff, 0x0f, 0x8b, 0x2e, 0x6e, 0xea, + 0xe4, 0x40, 0xae, 0x71, 0x40, 0x82, 0x02, 0x16, 0x82, 0xea, 0x5d, 0xb6, 0x71, 0x1a, 0x00, 0xfd, + 0x9e, 0xa3, 0x8f, 0x47, 0x84, 0xd1, 0xc7, 0x23, 0xd7, 0x41, 0x36, 0x71, 0x93, 0x9c, 0xf3, 0xb1, + 0x1b, 0x18, 0x14, 0x56, 0x0c, 0x3c, 0x2d, 0x49, 0x0c, 0x3e, 0x2d, 0xd9, 0x87, 0x4c, 0xc5, 0x31, + 0x94, 0x2e, 0xb6, 0x7d, 0x74, 0x7b, 0x80, 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, 0xe8, 0x0a, + 0x2c, 0x0d, 0x59, 0x45, 0x1b, 0xce, 0x0d, 0xf7, 0xa4, 0x2a, 0x4a, 0xf6, 0xfc, 0xad, 0xef, 0xc3, + 0xb9, 0xa8, 0xa3, 0xd1, 0xab, 0xf0, 0x4a, 0x65, 0xb7, 0xac, 0x29, 0x8f, 0x95, 0x5a, 0x23, 0x98, + 0x82, 0xf2, 0xfe, 0x23, 0x52, 0x62, 0xcb, 0x9f, 0x04, 0x8e, 0x09, 0xa0, 0xf7, 0x4a, 0x8d, 0xf2, + 0xb6, 0x52, 0xc9, 0x0a, 0xe8, 0x35, 0xb8, 0x39, 0x0e, 0xb4, 0x5f, 0x0b, 0x60, 0xe2, 0xd6, 0xed, + 0xdf, 0x3c, 0x5b, 0x16, 0x3e, 0x7d, 0xb6, 0x2c, 0xfc, 0xe9, 0xd9, 0xb2, 0xf0, 0xd3, 0x3f, 0x2f, + 0xcf, 0xc1, 0x05, 0x13, 0x77, 0x03, 0x1e, 0xea, 0x6d, 0xab, 0xd8, 0xdd, 0xd8, 0x13, 0xde, 0x97, + 0x8a, 0x77, 0xbb, 0x1b, 0x07, 0x29, 0x1a, 0x79, 0xbf, 0xf2, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x9d, 0x46, 0xe4, 0x41, 0xb2, 0x28, 0x00, 0x00, } func (m *Snapshot) Marshal() (dAtA []byte, err error) { @@ -6763,6 +6829,54 @@ func (m *DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *BroadcastEvent) 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 *BroadcastEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BroadcastEvent) 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.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintResources(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x1a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintResources(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + } + if len(m.Publisher) > 0 { + i -= len(m.Publisher) + copy(dAtA[i:], m.Publisher) + i = encodeVarintResources(dAtA, i, uint64(len(m.Publisher))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintResources(dAtA []byte, offset int, v uint64) int { offset -= sovResources(v) base := offset @@ -8167,6 +8281,30 @@ func (m *DocEvent) Size() (n int) { return n } +func (m *BroadcastEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Publisher) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) + } + l = len(m.Payload) + if l > 0 { + 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 } @@ -16874,6 +17012,155 @@ func (m *DocEvent) Unmarshal(dAtA []byte) error { } return nil } +func (m *BroadcastEvent) 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: BroadcastEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BroadcastEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", 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.Publisher = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", 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.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []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 skipResources(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/api/yorkie/v1/resources.proto b/api/yorkie/v1/resources.proto index 3ee8a3cd3..50fefd507 100644 --- a/api/yorkie/v1/resources.proto +++ b/api/yorkie/v1/resources.proto @@ -367,5 +367,5 @@ message DocEvent { message BroadcastEvent { string publisher = 1; string type = 2; - string payload = 3; + bytes payload = 3; } \ No newline at end of file diff --git a/api/yorkie/v1/yorkie.pb.go b/api/yorkie/v1/yorkie.pb.go index 8af66bd68..7582b1720 100644 --- a/api/yorkie/v1/yorkie.pb.go +++ b/api/yorkie/v1/yorkie.pb.go @@ -852,838 +852,1028 @@ func (m *PushPullChangesResponse) GetChangePack() *ChangePack { return nil } -func init() { - proto.RegisterType((*ActivateClientRequest)(nil), "yorkie.v1.ActivateClientRequest") - proto.RegisterType((*ActivateClientResponse)(nil), "yorkie.v1.ActivateClientResponse") - proto.RegisterType((*DeactivateClientRequest)(nil), "yorkie.v1.DeactivateClientRequest") - proto.RegisterType((*DeactivateClientResponse)(nil), "yorkie.v1.DeactivateClientResponse") - proto.RegisterType((*AttachDocumentRequest)(nil), "yorkie.v1.AttachDocumentRequest") - proto.RegisterType((*AttachDocumentResponse)(nil), "yorkie.v1.AttachDocumentResponse") - proto.RegisterType((*DetachDocumentRequest)(nil), "yorkie.v1.DetachDocumentRequest") - proto.RegisterType((*DetachDocumentResponse)(nil), "yorkie.v1.DetachDocumentResponse") - proto.RegisterType((*WatchDocumentRequest)(nil), "yorkie.v1.WatchDocumentRequest") - proto.RegisterType((*WatchDocumentResponse)(nil), "yorkie.v1.WatchDocumentResponse") - proto.RegisterType((*WatchDocumentResponse_Initialization)(nil), "yorkie.v1.WatchDocumentResponse.Initialization") - proto.RegisterType((*RemoveDocumentRequest)(nil), "yorkie.v1.RemoveDocumentRequest") - proto.RegisterType((*RemoveDocumentResponse)(nil), "yorkie.v1.RemoveDocumentResponse") - proto.RegisterType((*PushPullChangesRequest)(nil), "yorkie.v1.PushPullChangesRequest") - proto.RegisterType((*PushPullChangesResponse)(nil), "yorkie.v1.PushPullChangesResponse") +type WatchBroadcastsRequest struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func init() { proto.RegisterFile("yorkie/v1/yorkie.proto", fileDescriptor_40070c858814ab24) } - -var fileDescriptor_40070c858814ab24 = []byte{ - // 650 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0xce, 0xf6, 0x9f, 0x9a, 0x89, 0xda, 0xdf, 0x8f, 0x2d, 0x49, 0x43, 0x2a, 0x52, 0xb3, 0x5c, - 0x2a, 0x55, 0x72, 0x48, 0x2b, 0x7a, 0xe1, 0xd4, 0x36, 0x48, 0x8d, 0x90, 0x20, 0x18, 0x44, 0xd5, - 0x4a, 0xc8, 0x72, 0xed, 0x2d, 0x59, 0xc5, 0xf5, 0xa6, 0xf6, 0xda, 0x92,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xf4, 0xe1, 0x7b, 0xb3, 0x04, 0xb7, 0x1c, 0x1a, 0x9d, 0xa7, 0x5a, 0x43, 0xa6, 0x47, 0xed, 0x1e, - 0x3a, 0x9c, 0xd1, 0x1f, 0x45, 0xed, 0xa3, 0xb9, 0xe4, 0x5b, 0x64, 0xf3, 0x47, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x8c, 0xb9, 0x33, 0xc1, 0xcb, 0x08, 0x00, 0x00, +func (m *WatchBroadcastsRequest) Reset() { *m = WatchBroadcastsRequest{} } +func (m *WatchBroadcastsRequest) String() string { return proto.CompactTextString(m) } +func (*WatchBroadcastsRequest) ProtoMessage() {} +func (*WatchBroadcastsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{14} +} +func (m *WatchBroadcastsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WatchBroadcastsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WatchBroadcastsRequest.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 *WatchBroadcastsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WatchBroadcastsRequest.Merge(m, src) +} +func (m *WatchBroadcastsRequest) XXX_Size() int { + return m.Size() +} +func (m *WatchBroadcastsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WatchBroadcastsRequest.DiscardUnknown(m) } -// 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 +var xxx_messageInfo_WatchBroadcastsRequest proto.InternalMessageInfo -// YorkieServiceClient is the client API for YorkieService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type YorkieServiceClient interface { - ActivateClient(ctx context.Context, in *ActivateClientRequest, opts ...grpc.CallOption) (*ActivateClientResponse, error) - DeactivateClient(ctx context.Context, in *DeactivateClientRequest, opts ...grpc.CallOption) (*DeactivateClientResponse, error) - AttachDocument(ctx context.Context, in *AttachDocumentRequest, opts ...grpc.CallOption) (*AttachDocumentResponse, error) - DetachDocument(ctx context.Context, in *DetachDocumentRequest, opts ...grpc.CallOption) (*DetachDocumentResponse, error) - RemoveDocument(ctx context.Context, in *RemoveDocumentRequest, opts ...grpc.CallOption) (*RemoveDocumentResponse, error) - PushPullChanges(ctx context.Context, in *PushPullChangesRequest, opts ...grpc.CallOption) (*PushPullChangesResponse, error) - WatchDocument(ctx context.Context, in *WatchDocumentRequest, opts ...grpc.CallOption) (YorkieService_WatchDocumentClient, error) +func (m *WatchBroadcastsRequest) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" } -type yorkieServiceClient struct { - cc *grpc.ClientConn +func (m *WatchBroadcastsRequest) GetDocumentId() string { + if m != nil { + return m.DocumentId + } + return "" } -func NewYorkieServiceClient(cc *grpc.ClientConn) YorkieServiceClient { - return &yorkieServiceClient{cc} +type WatchBroadcastsResponse struct { + Event *BroadcastEvent `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (c *yorkieServiceClient) ActivateClient(ctx context.Context, in *ActivateClientRequest, opts ...grpc.CallOption) (*ActivateClientResponse, error) { - out := new(ActivateClientResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/ActivateClient", in, out, opts...) - if err != nil { - return nil, err +func (m *WatchBroadcastsResponse) Reset() { *m = WatchBroadcastsResponse{} } +func (m *WatchBroadcastsResponse) String() string { return proto.CompactTextString(m) } +func (*WatchBroadcastsResponse) ProtoMessage() {} +func (*WatchBroadcastsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{15} +} +func (m *WatchBroadcastsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WatchBroadcastsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WatchBroadcastsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *WatchBroadcastsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_WatchBroadcastsResponse.Merge(m, src) +} +func (m *WatchBroadcastsResponse) XXX_Size() int { + return m.Size() +} +func (m *WatchBroadcastsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_WatchBroadcastsResponse.DiscardUnknown(m) } -func (c *yorkieServiceClient) DeactivateClient(ctx context.Context, in *DeactivateClientRequest, opts ...grpc.CallOption) (*DeactivateClientResponse, error) { - out := new(DeactivateClientResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/DeactivateClient", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_WatchBroadcastsResponse proto.InternalMessageInfo + +func (m *WatchBroadcastsResponse) GetEvent() *BroadcastEvent { + if m != nil { + return m.Event } - return out, nil + return nil } -func (c *yorkieServiceClient) AttachDocument(ctx context.Context, in *AttachDocumentRequest, opts ...grpc.CallOption) (*AttachDocumentResponse, error) { - out := new(AttachDocumentResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/AttachDocument", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type SubscribeBroadcastRequest struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (c *yorkieServiceClient) DetachDocument(ctx context.Context, in *DetachDocumentRequest, opts ...grpc.CallOption) (*DetachDocumentResponse, error) { - out := new(DetachDocumentResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/DetachDocument", in, out, opts...) - if err != nil { - return nil, err +func (m *SubscribeBroadcastRequest) Reset() { *m = SubscribeBroadcastRequest{} } +func (m *SubscribeBroadcastRequest) String() string { return proto.CompactTextString(m) } +func (*SubscribeBroadcastRequest) ProtoMessage() {} +func (*SubscribeBroadcastRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{16} +} +func (m *SubscribeBroadcastRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SubscribeBroadcastRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SubscribeBroadcastRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *SubscribeBroadcastRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubscribeBroadcastRequest.Merge(m, src) +} +func (m *SubscribeBroadcastRequest) XXX_Size() int { + return m.Size() +} +func (m *SubscribeBroadcastRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SubscribeBroadcastRequest.DiscardUnknown(m) } -func (c *yorkieServiceClient) RemoveDocument(ctx context.Context, in *RemoveDocumentRequest, opts ...grpc.CallOption) (*RemoveDocumentResponse, error) { - out := new(RemoveDocumentResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/RemoveDocument", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_SubscribeBroadcastRequest proto.InternalMessageInfo + +func (m *SubscribeBroadcastRequest) GetClientId() string { + if m != nil { + return m.ClientId } - return out, nil + return "" } -func (c *yorkieServiceClient) PushPullChanges(ctx context.Context, in *PushPullChangesRequest, opts ...grpc.CallOption) (*PushPullChangesResponse, error) { - out := new(PushPullChangesResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/PushPullChanges", in, out, opts...) - if err != nil { - return nil, err +func (m *SubscribeBroadcastRequest) GetDocumentId() string { + if m != nil { + return m.DocumentId } - return out, nil + return "" } -func (c *yorkieServiceClient) WatchDocument(ctx context.Context, in *WatchDocumentRequest, opts ...grpc.CallOption) (YorkieService_WatchDocumentClient, error) { - stream, err := c.cc.NewStream(ctx, &_YorkieService_serviceDesc.Streams[0], "/yorkie.v1.YorkieService/WatchDocument", opts...) - if err != nil { - return nil, err - } - x := &yorkieServiceWatchDocumentClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err +func (m *SubscribeBroadcastRequest) GetType() string { + if m != nil { + return m.Type } - return x, nil + return "" } -type YorkieService_WatchDocumentClient interface { - Recv() (*WatchDocumentResponse, error) - grpc.ClientStream +type SubscribeBroadcastResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -type yorkieServiceWatchDocumentClient struct { - grpc.ClientStream +func (m *SubscribeBroadcastResponse) Reset() { *m = SubscribeBroadcastResponse{} } +func (m *SubscribeBroadcastResponse) String() string { return proto.CompactTextString(m) } +func (*SubscribeBroadcastResponse) ProtoMessage() {} +func (*SubscribeBroadcastResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{17} } - -func (x *yorkieServiceWatchDocumentClient) Recv() (*WatchDocumentResponse, error) { - m := new(WatchDocumentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (m *SubscribeBroadcastResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SubscribeBroadcastResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SubscribeBroadcastResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return m, nil } - -// YorkieServiceServer is the server API for YorkieService service. -type YorkieServiceServer interface { - ActivateClient(context.Context, *ActivateClientRequest) (*ActivateClientResponse, error) - DeactivateClient(context.Context, *DeactivateClientRequest) (*DeactivateClientResponse, error) - AttachDocument(context.Context, *AttachDocumentRequest) (*AttachDocumentResponse, error) - DetachDocument(context.Context, *DetachDocumentRequest) (*DetachDocumentResponse, error) - RemoveDocument(context.Context, *RemoveDocumentRequest) (*RemoveDocumentResponse, error) - PushPullChanges(context.Context, *PushPullChangesRequest) (*PushPullChangesResponse, error) - WatchDocument(*WatchDocumentRequest, YorkieService_WatchDocumentServer) error +func (m *SubscribeBroadcastResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubscribeBroadcastResponse.Merge(m, src) } - -// UnimplementedYorkieServiceServer can be embedded to have forward compatible implementations. -type UnimplementedYorkieServiceServer struct { +func (m *SubscribeBroadcastResponse) XXX_Size() int { + return m.Size() +} +func (m *SubscribeBroadcastResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SubscribeBroadcastResponse.DiscardUnknown(m) } -func (*UnimplementedYorkieServiceServer) ActivateClient(ctx context.Context, req *ActivateClientRequest) (*ActivateClientResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ActivateClient not implemented") +var xxx_messageInfo_SubscribeBroadcastResponse proto.InternalMessageInfo + +type UnsubscribeBroadcastRequest struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (*UnimplementedYorkieServiceServer) DeactivateClient(ctx context.Context, req *DeactivateClientRequest) (*DeactivateClientResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeactivateClient not implemented") + +func (m *UnsubscribeBroadcastRequest) Reset() { *m = UnsubscribeBroadcastRequest{} } +func (m *UnsubscribeBroadcastRequest) String() string { return proto.CompactTextString(m) } +func (*UnsubscribeBroadcastRequest) ProtoMessage() {} +func (*UnsubscribeBroadcastRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{18} } -func (*UnimplementedYorkieServiceServer) AttachDocument(ctx context.Context, req *AttachDocumentRequest) (*AttachDocumentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AttachDocument not implemented") +func (m *UnsubscribeBroadcastRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedYorkieServiceServer) DetachDocument(ctx context.Context, req *DetachDocumentRequest) (*DetachDocumentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DetachDocument not implemented") +func (m *UnsubscribeBroadcastRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnsubscribeBroadcastRequest.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 (*UnimplementedYorkieServiceServer) RemoveDocument(ctx context.Context, req *RemoveDocumentRequest) (*RemoveDocumentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveDocument not implemented") +func (m *UnsubscribeBroadcastRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnsubscribeBroadcastRequest.Merge(m, src) } -func (*UnimplementedYorkieServiceServer) PushPullChanges(ctx context.Context, req *PushPullChangesRequest) (*PushPullChangesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PushPullChanges not implemented") +func (m *UnsubscribeBroadcastRequest) XXX_Size() int { + return m.Size() } -func (*UnimplementedYorkieServiceServer) WatchDocument(req *WatchDocumentRequest, srv YorkieService_WatchDocumentServer) error { - return status.Errorf(codes.Unimplemented, "method WatchDocument not implemented") +func (m *UnsubscribeBroadcastRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UnsubscribeBroadcastRequest.DiscardUnknown(m) } -func RegisterYorkieServiceServer(s *grpc.Server, srv YorkieServiceServer) { - s.RegisterService(&_YorkieService_serviceDesc, srv) +var xxx_messageInfo_UnsubscribeBroadcastRequest proto.InternalMessageInfo + +func (m *UnsubscribeBroadcastRequest) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" } -func _YorkieService_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 +func (m *UnsubscribeBroadcastRequest) GetDocumentId() string { + if m != nil { + return m.DocumentId } - if interceptor == nil { - return srv.(YorkieServiceServer).ActivateClient(ctx, in) + return "" +} + +func (m *UnsubscribeBroadcastRequest) GetType() string { + if m != nil { + return m.Type } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/yorkie.v1.YorkieService/ActivateClient", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).ActivateClient(ctx, req.(*ActivateClientRequest)) - } - return interceptor(ctx, in, info, handler) + return "" } -func _YorkieService_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.(YorkieServiceServer).DeactivateClient(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/yorkie.v1.YorkieService/DeactivateClient", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).DeactivateClient(ctx, req.(*DeactivateClientRequest)) - } - return interceptor(ctx, in, info, handler) +type UnsubscribeBroadcastResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func _YorkieService_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.(YorkieServiceServer).AttachDocument(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/yorkie.v1.YorkieService/AttachDocument", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).AttachDocument(ctx, req.(*AttachDocumentRequest)) +func (m *UnsubscribeBroadcastResponse) Reset() { *m = UnsubscribeBroadcastResponse{} } +func (m *UnsubscribeBroadcastResponse) String() string { return proto.CompactTextString(m) } +func (*UnsubscribeBroadcastResponse) ProtoMessage() {} +func (*UnsubscribeBroadcastResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{19} +} +func (m *UnsubscribeBroadcastResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UnsubscribeBroadcastResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnsubscribeBroadcastResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *UnsubscribeBroadcastResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnsubscribeBroadcastResponse.Merge(m, src) +} +func (m *UnsubscribeBroadcastResponse) XXX_Size() int { + return m.Size() +} +func (m *UnsubscribeBroadcastResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UnsubscribeBroadcastResponse.DiscardUnknown(m) } -func _YorkieService_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.(YorkieServiceServer).DetachDocument(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/yorkie.v1.YorkieService/DetachDocument", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).DetachDocument(ctx, req.(*DetachDocumentRequest)) - } - return interceptor(ctx, in, info, handler) +var xxx_messageInfo_UnsubscribeBroadcastResponse proto.InternalMessageInfo + +type BroadcastRequest struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + Event *BroadcastEvent `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func _YorkieService_RemoveDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveDocumentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServiceServer).RemoveDocument(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/yorkie.v1.YorkieService/RemoveDocument", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).RemoveDocument(ctx, req.(*RemoveDocumentRequest)) +func (m *BroadcastRequest) Reset() { *m = BroadcastRequest{} } +func (m *BroadcastRequest) String() string { return proto.CompactTextString(m) } +func (*BroadcastRequest) ProtoMessage() {} +func (*BroadcastRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{20} +} +func (m *BroadcastRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BroadcastRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BroadcastRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *BroadcastRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastRequest.Merge(m, src) +} +func (m *BroadcastRequest) XXX_Size() int { + return m.Size() +} +func (m *BroadcastRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastRequest.DiscardUnknown(m) } -func _YorkieService_PushPullChanges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PushPullChangesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServiceServer).PushPullChanges(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/yorkie.v1.YorkieService/PushPullChanges", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).PushPullChanges(ctx, req.(*PushPullChangesRequest)) +var xxx_messageInfo_BroadcastRequest proto.InternalMessageInfo + +func (m *BroadcastRequest) GetClientId() string { + if m != nil { + return m.ClientId } - return interceptor(ctx, in, info, handler) + return "" } -func _YorkieService_WatchDocument_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(WatchDocumentRequest) - if err := stream.RecvMsg(m); err != nil { - return err +func (m *BroadcastRequest) GetDocumentId() string { + if m != nil { + return m.DocumentId } - return srv.(YorkieServiceServer).WatchDocument(m, &yorkieServiceWatchDocumentServer{stream}) + return "" } -type YorkieService_WatchDocumentServer interface { - Send(*WatchDocumentResponse) error - grpc.ServerStream +func (m *BroadcastRequest) GetEvent() *BroadcastEvent { + if m != nil { + return m.Event + } + return nil } -type yorkieServiceWatchDocumentServer struct { - grpc.ServerStream +type BroadcastResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *yorkieServiceWatchDocumentServer) Send(m *WatchDocumentResponse) error { - return x.ServerStream.SendMsg(m) +func (m *BroadcastResponse) Reset() { *m = BroadcastResponse{} } +func (m *BroadcastResponse) String() string { return proto.CompactTextString(m) } +func (*BroadcastResponse) ProtoMessage() {} +func (*BroadcastResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{21} } - -var _YorkieService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "yorkie.v1.YorkieService", - HandlerType: (*YorkieServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ActivateClient", - Handler: _YorkieService_ActivateClient_Handler, - }, - { - MethodName: "DeactivateClient", - Handler: _YorkieService_DeactivateClient_Handler, - }, - { - MethodName: "AttachDocument", - Handler: _YorkieService_AttachDocument_Handler, - }, - { - MethodName: "DetachDocument", - Handler: _YorkieService_DetachDocument_Handler, - }, - { - MethodName: "RemoveDocument", - Handler: _YorkieService_RemoveDocument_Handler, - }, - { - MethodName: "PushPullChanges", - Handler: _YorkieService_PushPullChanges_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "WatchDocument", - Handler: _YorkieService_WatchDocument_Handler, - ServerStreams: true, - }, - }, - Metadata: "yorkie/v1/yorkie.proto", +func (m *BroadcastResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -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 +func (m *BroadcastResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BroadcastResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil } - -func (m *ActivateClientRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *BroadcastResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastResponse.Merge(m, src) } - -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 *BroadcastResponse) XXX_Size() int { + return m.Size() +} +func (m *BroadcastResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastResponse.DiscardUnknown(m) } -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 +var xxx_messageInfo_BroadcastResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*ActivateClientRequest)(nil), "yorkie.v1.ActivateClientRequest") + proto.RegisterType((*ActivateClientResponse)(nil), "yorkie.v1.ActivateClientResponse") + proto.RegisterType((*DeactivateClientRequest)(nil), "yorkie.v1.DeactivateClientRequest") + proto.RegisterType((*DeactivateClientResponse)(nil), "yorkie.v1.DeactivateClientResponse") + proto.RegisterType((*AttachDocumentRequest)(nil), "yorkie.v1.AttachDocumentRequest") + proto.RegisterType((*AttachDocumentResponse)(nil), "yorkie.v1.AttachDocumentResponse") + proto.RegisterType((*DetachDocumentRequest)(nil), "yorkie.v1.DetachDocumentRequest") + proto.RegisterType((*DetachDocumentResponse)(nil), "yorkie.v1.DetachDocumentResponse") + proto.RegisterType((*WatchDocumentRequest)(nil), "yorkie.v1.WatchDocumentRequest") + proto.RegisterType((*WatchDocumentResponse)(nil), "yorkie.v1.WatchDocumentResponse") + proto.RegisterType((*WatchDocumentResponse_Initialization)(nil), "yorkie.v1.WatchDocumentResponse.Initialization") + proto.RegisterType((*RemoveDocumentRequest)(nil), "yorkie.v1.RemoveDocumentRequest") + proto.RegisterType((*RemoveDocumentResponse)(nil), "yorkie.v1.RemoveDocumentResponse") + proto.RegisterType((*PushPullChangesRequest)(nil), "yorkie.v1.PushPullChangesRequest") + proto.RegisterType((*PushPullChangesResponse)(nil), "yorkie.v1.PushPullChangesResponse") + proto.RegisterType((*WatchBroadcastsRequest)(nil), "yorkie.v1.WatchBroadcastsRequest") + proto.RegisterType((*WatchBroadcastsResponse)(nil), "yorkie.v1.WatchBroadcastsResponse") + proto.RegisterType((*SubscribeBroadcastRequest)(nil), "yorkie.v1.SubscribeBroadcastRequest") + proto.RegisterType((*SubscribeBroadcastResponse)(nil), "yorkie.v1.SubscribeBroadcastResponse") + proto.RegisterType((*UnsubscribeBroadcastRequest)(nil), "yorkie.v1.UnsubscribeBroadcastRequest") + proto.RegisterType((*UnsubscribeBroadcastResponse)(nil), "yorkie.v1.UnsubscribeBroadcastResponse") + proto.RegisterType((*BroadcastRequest)(nil), "yorkie.v1.BroadcastRequest") + proto.RegisterType((*BroadcastResponse)(nil), "yorkie.v1.BroadcastResponse") } -func (m *ActivateClientResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func init() { proto.RegisterFile("yorkie/v1/yorkie.proto", fileDescriptor_40070c858814ab24) } + +var fileDescriptor_40070c858814ab24 = []byte{ + // 826 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcd, 0x6e, 0xda, 0x4a, + 0x14, 0x66, 0x12, 0x6e, 0x6e, 0x38, 0x28, 0x7f, 0x93, 0x40, 0x88, 0xc9, 0x25, 0xdc, 0xb9, 0x7f, + 0x91, 0x22, 0xc1, 0x25, 0x51, 0xb3, 0xe9, 0x2a, 0x09, 0x95, 0x42, 0x2b, 0xb5, 0x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 0xab, 0x1c, 0xfa, 0x70, 0x95, 0x43, 0x9f, 0xae, 0x72, + 0xe8, 0xcd, 0xe7, 0x5c, 0x0c, 0x96, 0x34, 0xea, 0xf6, 0xfd, 0x95, 0xb6, 0x5e, 0x70, 0x4b, 0x55, + 0x74, 0x16, 0x2f, 0xdc, 0x75, 0x4b, 0xf5, 0x19, 0xef, 0xef, 0xc5, 0xce, 0xd7, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x8e, 0x9a, 0x62, 0x25, 0x9e, 0x0c, 0x00, 0x00, } -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] = 0xa - } - return len(dAtA) - i, nil +// 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 + +// YorkieServiceClient is the client API for YorkieService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type YorkieServiceClient interface { + ActivateClient(ctx context.Context, in *ActivateClientRequest, opts ...grpc.CallOption) (*ActivateClientResponse, error) + DeactivateClient(ctx context.Context, in *DeactivateClientRequest, opts ...grpc.CallOption) (*DeactivateClientResponse, error) + AttachDocument(ctx context.Context, in *AttachDocumentRequest, opts ...grpc.CallOption) (*AttachDocumentResponse, error) + DetachDocument(ctx context.Context, in *DetachDocumentRequest, opts ...grpc.CallOption) (*DetachDocumentResponse, error) + RemoveDocument(ctx context.Context, in *RemoveDocumentRequest, opts ...grpc.CallOption) (*RemoveDocumentResponse, error) + PushPullChanges(ctx context.Context, in *PushPullChangesRequest, opts ...grpc.CallOption) (*PushPullChangesResponse, error) + WatchDocument(ctx context.Context, in *WatchDocumentRequest, opts ...grpc.CallOption) (YorkieService_WatchDocumentClient, error) + Broadcast(ctx context.Context, in *BroadcastRequest, opts ...grpc.CallOption) (*BroadcastResponse, error) + WatchBroadcasts(ctx context.Context, in *WatchBroadcastsRequest, opts ...grpc.CallOption) (YorkieService_WatchBroadcastsClient, error) + SubscribeBroadcast(ctx context.Context, in *SubscribeBroadcastRequest, opts ...grpc.CallOption) (*SubscribeBroadcastResponse, error) + UnsubscribeBroadcast(ctx context.Context, in *UnsubscribeBroadcastRequest, opts ...grpc.CallOption) (*UnsubscribeBroadcastResponse, error) } -func (m *DeactivateClientRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +type yorkieServiceClient struct { + cc *grpc.ClientConn +} + +func NewYorkieServiceClient(cc *grpc.ClientConn) YorkieServiceClient { + return &yorkieServiceClient{cc} +} + +func (c *yorkieServiceClient) ActivateClient(ctx context.Context, in *ActivateClientRequest, opts ...grpc.CallOption) (*ActivateClientResponse, error) { + out := new(ActivateClientResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/ActivateClient", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *DeactivateClientRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *yorkieServiceClient) DeactivateClient(ctx context.Context, in *DeactivateClientRequest, opts ...grpc.CallOption) (*DeactivateClientResponse, error) { + out := new(DeactivateClientResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/DeactivateClient", in, out, opts...) + if err != nil { + return nil, err + } + return out, 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) - } - 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 +func (c *yorkieServiceClient) AttachDocument(ctx context.Context, in *AttachDocumentRequest, opts ...grpc.CallOption) (*AttachDocumentResponse, error) { + out := new(AttachDocumentResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/AttachDocument", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *DeactivateClientResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *yorkieServiceClient) DetachDocument(ctx context.Context, in *DetachDocumentRequest, opts ...grpc.CallOption) (*DetachDocumentResponse, error) { + out := new(DetachDocumentResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/DetachDocument", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *DeactivateClientResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *yorkieServiceClient) RemoveDocument(ctx context.Context, in *RemoveDocumentRequest, opts ...grpc.CallOption) (*RemoveDocumentResponse, error) { + out := new(RemoveDocumentResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/RemoveDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -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) +func (c *yorkieServiceClient) PushPullChanges(ctx context.Context, in *PushPullChangesRequest, opts ...grpc.CallOption) (*PushPullChangesResponse, error) { + out := new(PushPullChangesResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/PushPullChanges", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *AttachDocumentRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *yorkieServiceClient) WatchDocument(ctx context.Context, in *WatchDocumentRequest, opts ...grpc.CallOption) (YorkieService_WatchDocumentClient, error) { + stream, err := c.cc.NewStream(ctx, &_YorkieService_serviceDesc.Streams[0], "/yorkie.v1.YorkieService/WatchDocument", opts...) if err != nil { return nil, err } - return dAtA[:n], nil + x := &yorkieServiceWatchDocumentClient{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 *AttachDocumentRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type YorkieService_WatchDocumentClient interface { + Recv() (*WatchDocumentResponse, error) + grpc.ClientStream } -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 +type yorkieServiceWatchDocumentClient struct { + grpc.ClientStream +} + +func (x *yorkieServiceWatchDocumentClient) Recv() (*WatchDocumentResponse, error) { + m := new(WatchDocumentResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err } - 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 m, nil +} + +func (c *yorkieServiceClient) Broadcast(ctx context.Context, in *BroadcastRequest, opts ...grpc.CallOption) (*BroadcastResponse, error) { + out := new(BroadcastResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/Broadcast", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *AttachDocumentResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *yorkieServiceClient) WatchBroadcasts(ctx context.Context, in *WatchBroadcastsRequest, opts ...grpc.CallOption) (YorkieService_WatchBroadcastsClient, error) { + stream, err := c.cc.NewStream(ctx, &_YorkieService_serviceDesc.Streams[1], "/yorkie.v1.YorkieService/WatchBroadcasts", opts...) if err != nil { return nil, err } - return dAtA[:n], nil + x := &yorkieServiceWatchBroadcastsClient{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 *AttachDocumentResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type YorkieService_WatchBroadcastsClient interface { + Recv() (*WatchBroadcastsResponse, error) + grpc.ClientStream } -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 +type yorkieServiceWatchBroadcastsClient struct { + grpc.ClientStream +} + +func (x *yorkieServiceWatchBroadcastsClient) Recv() (*WatchBroadcastsResponse, error) { + m := new(WatchBroadcastsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err } - if len(m.DocumentId) > 0 { - i -= len(m.DocumentId) - copy(dAtA[i:], m.DocumentId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) - i-- - dAtA[i] = 0xa + return m, nil +} + +func (c *yorkieServiceClient) SubscribeBroadcast(ctx context.Context, in *SubscribeBroadcastRequest, opts ...grpc.CallOption) (*SubscribeBroadcastResponse, error) { + out := new(SubscribeBroadcastResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/SubscribeBroadcast", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *DetachDocumentRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *yorkieServiceClient) UnsubscribeBroadcast(ctx context.Context, in *UnsubscribeBroadcastRequest, opts ...grpc.CallOption) (*UnsubscribeBroadcastResponse, error) { + out := new(UnsubscribeBroadcastResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/UnsubscribeBroadcast", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *DetachDocumentRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// YorkieServiceServer is the server API for YorkieService service. +type YorkieServiceServer interface { + ActivateClient(context.Context, *ActivateClientRequest) (*ActivateClientResponse, error) + DeactivateClient(context.Context, *DeactivateClientRequest) (*DeactivateClientResponse, error) + AttachDocument(context.Context, *AttachDocumentRequest) (*AttachDocumentResponse, error) + DetachDocument(context.Context, *DetachDocumentRequest) (*DetachDocumentResponse, error) + RemoveDocument(context.Context, *RemoveDocumentRequest) (*RemoveDocumentResponse, error) + PushPullChanges(context.Context, *PushPullChangesRequest) (*PushPullChangesResponse, error) + WatchDocument(*WatchDocumentRequest, YorkieService_WatchDocumentServer) error + Broadcast(context.Context, *BroadcastRequest) (*BroadcastResponse, error) + WatchBroadcasts(*WatchBroadcastsRequest, YorkieService_WatchBroadcastsServer) error + SubscribeBroadcast(context.Context, *SubscribeBroadcastRequest) (*SubscribeBroadcastResponse, error) + UnsubscribeBroadcast(context.Context, *UnsubscribeBroadcastRequest) (*UnsubscribeBroadcastResponse, error) } -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.RemoveIfNotAttached { - i-- - if m.RemoveIfNotAttached { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - 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] = 0x1a - } - if len(m.DocumentId) > 0 { - i -= len(m.DocumentId) - copy(dAtA[i:], m.DocumentId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) - 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 +// UnimplementedYorkieServiceServer can be embedded to have forward compatible implementations. +type UnimplementedYorkieServiceServer struct { } -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 (*UnimplementedYorkieServiceServer) ActivateClient(ctx context.Context, req *ActivateClientRequest) (*ActivateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ActivateClient not implemented") +} +func (*UnimplementedYorkieServiceServer) DeactivateClient(ctx context.Context, req *DeactivateClientRequest) (*DeactivateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeactivateClient not implemented") +} +func (*UnimplementedYorkieServiceServer) AttachDocument(ctx context.Context, req *AttachDocumentRequest) (*AttachDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AttachDocument not implemented") +} +func (*UnimplementedYorkieServiceServer) DetachDocument(ctx context.Context, req *DetachDocumentRequest) (*DetachDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DetachDocument not implemented") +} +func (*UnimplementedYorkieServiceServer) RemoveDocument(ctx context.Context, req *RemoveDocumentRequest) (*RemoveDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveDocument not implemented") +} +func (*UnimplementedYorkieServiceServer) PushPullChanges(ctx context.Context, req *PushPullChangesRequest) (*PushPullChangesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushPullChanges not implemented") +} +func (*UnimplementedYorkieServiceServer) WatchDocument(req *WatchDocumentRequest, srv YorkieService_WatchDocumentServer) error { + return status.Errorf(codes.Unimplemented, "method WatchDocument not implemented") +} +func (*UnimplementedYorkieServiceServer) Broadcast(ctx context.Context, req *BroadcastRequest) (*BroadcastResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented") +} +func (*UnimplementedYorkieServiceServer) WatchBroadcasts(req *WatchBroadcastsRequest, srv YorkieService_WatchBroadcastsServer) error { + return status.Errorf(codes.Unimplemented, "method WatchBroadcasts not implemented") +} +func (*UnimplementedYorkieServiceServer) SubscribeBroadcast(ctx context.Context, req *SubscribeBroadcastRequest) (*SubscribeBroadcastResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubscribeBroadcast not implemented") +} +func (*UnimplementedYorkieServiceServer) UnsubscribeBroadcast(ctx context.Context, req *UnsubscribeBroadcastRequest) (*UnsubscribeBroadcastResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnsubscribeBroadcast not implemented") } -func (m *DetachDocumentResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func RegisterYorkieServiceServer(s *grpc.Server, srv YorkieServiceServer) { + s.RegisterService(&_YorkieService_serviceDesc, srv) } -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 _YorkieService_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 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 interceptor == nil { + return srv.(YorkieServiceServer).ActivateClient(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/yorkie.v1.YorkieService/ActivateClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServiceServer).ActivateClient(ctx, req.(*ActivateClientRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *WatchDocumentRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _YorkieService_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 dAtA[:n], nil + if interceptor == nil { + return srv.(YorkieServiceServer).DeactivateClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/yorkie.v1.YorkieService/DeactivateClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServiceServer).DeactivateClient(ctx, req.(*DeactivateClientRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *WatchDocumentRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _YorkieService_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.(YorkieServiceServer).AttachDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/yorkie.v1.YorkieService/AttachDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServiceServer).AttachDocument(ctx, req.(*AttachDocumentRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *WatchDocumentRequest) 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 _YorkieService_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 len(m.DocumentId) > 0 { - i -= len(m.DocumentId) - copy(dAtA[i:], m.DocumentId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) - i-- - dAtA[i] = 0x12 + if interceptor == nil { + return srv.(YorkieServiceServer).DetachDocument(ctx, in) } - 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 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/yorkie.v1.YorkieService/DetachDocument", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServiceServer).DetachDocument(ctx, req.(*DetachDocumentRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *WatchDocumentResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _YorkieService_RemoveDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveDocumentRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(YorkieServiceServer).RemoveDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/yorkie.v1.YorkieService/RemoveDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServiceServer).RemoveDocument(ctx, req.(*RemoveDocumentRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *WatchDocumentResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _YorkieService_PushPullChanges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushPullChangesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(YorkieServiceServer).PushPullChanges(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/yorkie.v1.YorkieService/PushPullChanges", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServiceServer).PushPullChanges(ctx, req.(*PushPullChangesRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *WatchDocumentResponse) 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 - } - } +func _YorkieService_WatchDocument_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(WatchDocumentRequest) + if err := stream.RecvMsg(m); err != nil { + return err } - return len(dAtA) - i, nil + return srv.(YorkieServiceServer).WatchDocument(m, &yorkieServiceWatchDocumentServer{stream}) } -func (m *WatchDocumentResponse_Initialization_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type YorkieService_WatchDocumentServer interface { + Send(*WatchDocumentResponse) error + grpc.ServerStream } -func (m *WatchDocumentResponse_Initialization_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Initialization != nil { +type yorkieServiceWatchDocumentServer struct { + grpc.ServerStream +} + +func (x *yorkieServiceWatchDocumentServer) Send(m *WatchDocumentResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _YorkieService_Broadcast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BroadcastRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(YorkieServiceServer).Broadcast(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/yorkie.v1.YorkieService/Broadcast", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServiceServer).Broadcast(ctx, req.(*BroadcastRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _YorkieService_WatchBroadcasts_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(WatchBroadcastsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(YorkieServiceServer).WatchBroadcasts(m, &yorkieServiceWatchBroadcastsServer{stream}) +} + +type YorkieService_WatchBroadcastsServer interface { + Send(*WatchBroadcastsResponse) error + grpc.ServerStream +} + +type yorkieServiceWatchBroadcastsServer struct { + grpc.ServerStream +} + +func (x *yorkieServiceWatchBroadcastsServer) Send(m *WatchBroadcastsResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _YorkieService_SubscribeBroadcast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubscribeBroadcastRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(YorkieServiceServer).SubscribeBroadcast(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/yorkie.v1.YorkieService/SubscribeBroadcast", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServiceServer).SubscribeBroadcast(ctx, req.(*SubscribeBroadcastRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _YorkieService_UnsubscribeBroadcast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnsubscribeBroadcastRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(YorkieServiceServer).UnsubscribeBroadcast(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/yorkie.v1.YorkieService/UnsubscribeBroadcast", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(YorkieServiceServer).UnsubscribeBroadcast(ctx, req.(*UnsubscribeBroadcastRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _YorkieService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "yorkie.v1.YorkieService", + HandlerType: (*YorkieServiceServer)(nil), + Methods: []grpc.MethodDesc{ { - 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 + MethodName: "ActivateClient", + Handler: _YorkieService_ActivateClient_Handler, + }, + { + MethodName: "DeactivateClient", + Handler: _YorkieService_DeactivateClient_Handler, + }, + { + MethodName: "AttachDocument", + Handler: _YorkieService_AttachDocument_Handler, + }, + { + MethodName: "DetachDocument", + Handler: _YorkieService_DetachDocument_Handler, + }, + { + MethodName: "RemoveDocument", + Handler: _YorkieService_RemoveDocument_Handler, + }, + { + MethodName: "PushPullChanges", + Handler: _YorkieService_PushPullChanges_Handler, + }, + { + MethodName: "Broadcast", + Handler: _YorkieService_Broadcast_Handler, + }, + { + MethodName: "SubscribeBroadcast", + Handler: _YorkieService_SubscribeBroadcast_Handler, + }, + { + MethodName: "UnsubscribeBroadcast", + Handler: _YorkieService_UnsubscribeBroadcast_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "WatchDocument", + Handler: _YorkieService_WatchDocument_Handler, + ServerStreams: true, + }, + { + StreamName: "WatchBroadcasts", + Handler: _YorkieService_WatchBroadcasts_Handler, + ServerStreams: true, + }, + }, + Metadata: "yorkie/v1/yorkie.proto", +} + +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 len(dAtA) - i, nil + return dAtA[:n], nil } -func (m *WatchDocumentResponse_Event) MarshalTo(dAtA []byte) (int, error) { + +func (m *ActivateClientRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WatchDocumentResponse_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ActivateClientRequest) 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 + 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] = 0x12 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *WatchDocumentResponse_Initialization) Marshal() (dAtA []byte, err error) { + +func (m *ActivateClientResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1693,12 +1883,12 @@ func (m *WatchDocumentResponse_Initialization) Marshal() (dAtA []byte, err error return dAtA[:n], nil } -func (m *WatchDocumentResponse_Initialization) MarshalTo(dAtA []byte) (int, error) { +func (m *ActivateClientResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WatchDocumentResponse_Initialization) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ActivateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1707,19 +1897,17 @@ func (m *WatchDocumentResponse_Initialization) MarshalToSizedBuffer(dAtA []byte) i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.ClientIds) > 0 { - for iNdEx := len(m.ClientIds) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ClientIds[iNdEx]) - copy(dAtA[i:], m.ClientIds[iNdEx]) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientIds[iNdEx]))) - i-- - dAtA[i] = 0xa - } + 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 *RemoveDocumentRequest) Marshal() (dAtA []byte, err error) { +func (m *DeactivateClientRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1729,12 +1917,12 @@ func (m *RemoveDocumentRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoveDocumentRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *DeactivateClientRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemoveDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeactivateClientRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1743,25 +1931,6 @@ func (m *RemoveDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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] = 0x1a - } - if len(m.DocumentId) > 0 { - i -= len(m.DocumentId) - copy(dAtA[i:], m.DocumentId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) - i-- - dAtA[i] = 0x12 - } if len(m.ClientId) > 0 { i -= len(m.ClientId) copy(dAtA[i:], m.ClientId) @@ -1772,7 +1941,7 @@ func (m *RemoveDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *RemoveDocumentResponse) Marshal() (dAtA []byte, err error) { +func (m *DeactivateClientResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1782,12 +1951,12 @@ func (m *RemoveDocumentResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoveDocumentResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *DeactivateClientResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemoveDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeactivateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1796,22 +1965,10 @@ func (m *RemoveDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) 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] = 0xa - } return len(dAtA) - i, nil } -func (m *PushPullChangesRequest) Marshal() (dAtA []byte, err error) { +func (m *AttachDocumentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1821,12 +1978,12 @@ func (m *PushPullChangesRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PushPullChangesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AttachDocumentRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PushPullChangesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AttachDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1835,16 +1992,6 @@ func (m *PushPullChangesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.PushOnly { - i-- - if m.PushOnly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } if m.ChangePack != nil { { size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) @@ -1855,13 +2002,6 @@ func (m *PushPullChangesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintYorkie(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - } - if len(m.DocumentId) > 0 { - i -= len(m.DocumentId) - copy(dAtA[i:], m.DocumentId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) - i-- dAtA[i] = 0x12 } if len(m.ClientId) > 0 { @@ -1874,7 +2014,7 @@ func (m *PushPullChangesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *PushPullChangesResponse) Marshal() (dAtA []byte, err error) { +func (m *AttachDocumentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1884,12 +2024,12 @@ func (m *PushPullChangesResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PushPullChangesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *AttachDocumentResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PushPullChangesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AttachDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1908,332 +2048,2040 @@ func (m *PushPullChangesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintYorkie(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x12 + } + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) + i-- dAtA[i] = 0xa } 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++ +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 } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -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 *DetachDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ActivateClientResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *DetachDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i 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) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n -} - -func (m *DeactivateClientRequest) Size() (n int) { - if m == nil { - return 0 + if m.RemoveIfNotAttached { + i-- + if m.RemoveIfNotAttached { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) + 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] = 0x1a } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) + i-- + dAtA[i] = 0x12 } - return n + 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) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +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 n + return dAtA[:n], nil } -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 *DetachDocumentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AttachDocumentResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *DetachDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.DocumentId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ChangePack != nil { - l = m.ChangePack.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + { + 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 n + return len(dAtA) - i, nil } -func (m *DetachDocumentRequest) Size() (n int) { - if m == nil { - return 0 +func (m *WatchDocumentRequest) 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 *WatchDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.DocumentId) - 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 { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.RemoveIfNotAttached { - n += 2 + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - n += len(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 n + return len(dAtA) - i, nil } -func (m *DetachDocumentResponse) Size() (n int) { - if m == nil { - return 0 +func (m *WatchDocumentResponse) 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 *WatchDocumentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = 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) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n + 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 *WatchDocumentRequest) 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)) - } - l = len(m.DocumentId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WatchDocumentResponse) 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 *WatchDocumentResponse_Initialization_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WatchDocumentResponse_Initialization_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l +func (m *WatchDocumentResponse_Initialization_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Initialization != nil { - l = m.Initialization.Size() - n += 1 + l + sovYorkie(uint64(l)) + { + 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 n + return len(dAtA) - i, nil } -func (m *WatchDocumentResponse_Event) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l +func (m *WatchDocumentResponse_Event) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchDocumentResponse_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Event != nil { - l = m.Event.Size() - n += 1 + l + sovYorkie(uint64(l)) + { + 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 n + return len(dAtA) - i, nil } -func (m *WatchDocumentResponse_Initialization) Size() (n int) { - if m == nil { - return 0 +func (m *WatchDocumentResponse_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 *WatchDocumentResponse_Initialization) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchDocumentResponse_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.ClientIds) > 0 { - for _, s := range m.ClientIds { - l = len(s) - n += 1 + l + sovYorkie(uint64(l)) + for iNdEx := len(m.ClientIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ClientIds[iNdEx]) + copy(dAtA[i:], m.ClientIds[iNdEx]) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientIds[iNdEx]))) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n + return len(dAtA) - i, nil } -func (m *RemoveDocumentRequest) Size() (n int) { - if m == nil { - return 0 +func (m *RemoveDocumentRequest) 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 *RemoveDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.DocumentId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ChangePack != nil { - l = m.ChangePack.Size() - n += 1 + l + sovYorkie(uint64(l)) + { + size, err := m.ChangePack.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) + i-- + dAtA[i] = 0x12 } - return n + 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 *RemoveDocumentResponse) Size() (n int) { - if m == nil { - return 0 +func (m *RemoveDocumentResponse) 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 *RemoveDocumentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = 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) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n + 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] = 0xa + } + return len(dAtA) - i, nil } -func (m *PushPullChangesRequest) Size() (n int) { - if m == nil { - return 0 +func (m *PushPullChangesRequest) 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 *PushPullChangesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PushPullChangesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.DocumentId) - 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 { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.PushOnly { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i-- + if m.PushOnly { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 } - return n + 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] = 0x1a + } + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) + 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 *PushPullChangesResponse) Size() (n int) { - if m == nil { - return 0 +func (m *PushPullChangesResponse) 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 *PushPullChangesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PushPullChangesResponse) 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 { - l = m.ChangePack.Size() - n += 1 + l + sovYorkie(uint64(l)) + { + size, err := m.ChangePack.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 *WatchBroadcastsRequest) 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 *WatchBroadcastsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchBroadcastsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) + 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 *WatchBroadcastsResponse) 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 *WatchBroadcastsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchBroadcastsResponse) 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SubscribeBroadcastRequest) 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 *SubscribeBroadcastRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscribeBroadcastRequest) 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.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x1a + } + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) + 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 *SubscribeBroadcastResponse) 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 *SubscribeBroadcastResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscribeBroadcastResponse) 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 *UnsubscribeBroadcastRequest) 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 *UnsubscribeBroadcastRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnsubscribeBroadcastRequest) 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.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x1a + } + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) + 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 *UnsubscribeBroadcastResponse) 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 *UnsubscribeBroadcastResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnsubscribeBroadcastResponse) 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 *BroadcastRequest) 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 *BroadcastRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BroadcastRequest) 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] = 0x1a + } + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) + 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 *BroadcastResponse) 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 *BroadcastResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BroadcastResponse) 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 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 *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.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 + 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.DocumentId) + 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)) + } + l = len(m.DocumentId) + 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.RemoveIfNotAttached { + n += 2 + } + 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 + 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 *WatchDocumentRequest) 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)) + } + l = len(m.DocumentId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *WatchDocumentResponse) 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 *WatchDocumentResponse_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 *WatchDocumentResponse_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 *WatchDocumentResponse_Initialization) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ClientIds) > 0 { + for _, s := range m.ClientIds { + l = len(s) + n += 1 + l + sovYorkie(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RemoveDocumentRequest) 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)) + } + l = len(m.DocumentId) + 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 *RemoveDocumentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = 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 *PushPullChangesRequest) 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)) + } + l = len(m.DocumentId) + 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.PushOnly { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PushPullChangesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = 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 *WatchBroadcastsRequest) 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)) + } + l = len(m.DocumentId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *WatchBroadcastsResponse) 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)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SubscribeBroadcastRequest) 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)) + } + l = len(m.DocumentId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SubscribeBroadcastResponse) 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 *UnsubscribeBroadcastRequest) 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)) + } + l = len(m.DocumentId) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *UnsubscribeBroadcastResponse) 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 *BroadcastRequest) 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)) + } + l = len(m.DocumentId) + 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 *BroadcastResponse) 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 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 *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 ClientId", 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.ClientId = 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 *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 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.ClientId = 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 *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 { + 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 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.ClientId = 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 *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 DocumentId", 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.DocumentId = 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 *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 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.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", 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.DocumentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RemoveIfNotAttached", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RemoveIfNotAttached = bool(v != 0) + 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 n + 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 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 + } + } -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)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *ActivateClientRequest) Unmarshal(dAtA []byte) error { +func (m *WatchDocumentRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2256,15 +4104,15 @@ func (m *ActivateClientRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ActivateClientRequest: wiretype end group for non-group") + return fmt.Errorf("proto: WatchDocumentRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ActivateClientRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WatchDocumentRequest: 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) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2292,7 +4140,160 @@ func (m *ActivateClientRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientKey = string(dAtA[iNdEx:postIndex]) + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", 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.DocumentId = 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 *WatchDocumentResponse) 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: WatchDocumentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WatchDocumentResponse: 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 := &WatchDocumentResponse_Initialization{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &WatchDocumentResponse_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 = &WatchDocumentResponse_Event{v} iNdEx = postIndex default: iNdEx = preIndex @@ -2316,7 +4317,7 @@ func (m *ActivateClientRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *ActivateClientResponse) Unmarshal(dAtA []byte) error { +func (m *WatchDocumentResponse_Initialization) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2339,15 +4340,15 @@ func (m *ActivateClientResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ActivateClientResponse: wiretype end group for non-group") + return fmt.Errorf("proto: Initialization: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ActivateClientResponse: 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 ClientId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientIds", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2375,7 +4376,7 @@ func (m *ActivateClientResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) + m.ClientIds = append(m.ClientIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -2399,7 +4400,7 @@ func (m *ActivateClientResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeactivateClientRequest) Unmarshal(dAtA []byte) error { +func (m *RemoveDocumentRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2422,10 +4423,10 @@ func (m *DeactivateClientRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeactivateClientRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RemoveDocumentRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeactivateClientRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RemoveDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2460,111 +4461,9 @@ func (m *DeactivateClientRequest) Unmarshal(dAtA []byte) error { } m.ClientId = 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 *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 { - 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: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2592,9 +4491,9 @@ func (m *AttachDocumentRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) + m.DocumentId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) } @@ -2652,7 +4551,7 @@ func (m *AttachDocumentRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AttachDocumentResponse) Unmarshal(dAtA []byte) error { +func (m *RemoveDocumentResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2675,45 +4574,13 @@ func (m *AttachDocumentResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AttachDocumentResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RemoveDocumentResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AttachDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RemoveDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", 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.DocumentId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) } @@ -2771,7 +4638,7 @@ func (m *AttachDocumentResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DetachDocumentRequest) Unmarshal(dAtA []byte) error { +func (m *PushPullChangesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2794,10 +4661,10 @@ func (m *DetachDocumentRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DetachDocumentRequest: wiretype end group for non-group") + return fmt.Errorf("proto: PushPullChangesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DetachDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PushPullChangesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2902,7 +4769,7 @@ func (m *DetachDocumentRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RemoveIfNotAttached", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PushOnly", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -2919,7 +4786,7 @@ func (m *DetachDocumentRequest) Unmarshal(dAtA []byte) error { break } } - m.RemoveIfNotAttached = bool(v != 0) + m.PushOnly = bool(v != 0) default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -2942,7 +4809,7 @@ func (m *DetachDocumentRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DetachDocumentResponse) Unmarshal(dAtA []byte) error { +func (m *PushPullChangesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2965,13 +4832,13 @@ func (m *DetachDocumentResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DetachDocumentResponse: wiretype end group for non-group") + return fmt.Errorf("proto: PushPullChangesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DetachDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PushPullChangesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 2: + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) } @@ -3029,7 +4896,7 @@ func (m *DetachDocumentResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *WatchDocumentRequest) Unmarshal(dAtA []byte) error { +func (m *WatchBroadcastsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3052,10 +4919,10 @@ func (m *WatchDocumentRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WatchDocumentRequest: wiretype end group for non-group") + return fmt.Errorf("proto: WatchBroadcastsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WatchDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WatchBroadcastsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3088,13 +4955,96 @@ func (m *WatchDocumentRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", 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.DocumentId = 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 *WatchBroadcastsResponse) 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: WatchBroadcastsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WatchBroadcastsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -3104,23 +5054,27 @@ func (m *WatchDocumentRequest) 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.DocumentId = string(dAtA[iNdEx:postIndex]) + if m.Event == nil { + m.Event = &BroadcastEvent{} + } + if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -3144,7 +5098,7 @@ func (m *WatchDocumentRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *WatchDocumentResponse) Unmarshal(dAtA []byte) error { +func (m *SubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3167,17 +5121,17 @@ func (m *WatchDocumentResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WatchDocumentResponse: wiretype end group for non-group") + return fmt.Errorf("proto: SubscribeBroadcastRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WatchDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SubscribeBroadcastRequest: 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) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -3187,32 +5141,29 @@ func (m *WatchDocumentResponse) 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 } - v := &WatchDocumentResponse_Initialization{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &WatchDocumentResponse_Initialization_{v} + m.ClientId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -3222,26 +5173,55 @@ func (m *WatchDocumentResponse) 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 } - v := &DocEvent{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.DocumentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - m.Body = &WatchDocumentResponse_Event{v} + 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.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3265,7 +5245,7 @@ func (m *WatchDocumentResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *WatchDocumentResponse_Initialization) Unmarshal(dAtA []byte) error { +func (m *SubscribeBroadcastResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3288,44 +5268,12 @@ func (m *WatchDocumentResponse_Initialization) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Initialization: wiretype end group for non-group") + return fmt.Errorf("proto: SubscribeBroadcastResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Initialization: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SubscribeBroadcastResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientIds", 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.ClientIds = append(m.ClientIds, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -3348,7 +5296,7 @@ func (m *WatchDocumentResponse_Initialization) Unmarshal(dAtA []byte) error { } return nil } -func (m *RemoveDocumentRequest) Unmarshal(dAtA []byte) error { +func (m *UnsubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3371,10 +5319,10 @@ func (m *RemoveDocumentRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RemoveDocumentRequest: wiretype end group for non-group") + return fmt.Errorf("proto: UnsubscribeBroadcastRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UnsubscribeBroadcastRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3443,9 +5391,9 @@ func (m *RemoveDocumentRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -3455,27 +5403,23 @@ func (m *RemoveDocumentRequest) 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.ChangePack == nil { - m.ChangePack = &ChangePack{} - } - if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3499,7 +5443,7 @@ func (m *RemoveDocumentRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RemoveDocumentResponse) Unmarshal(dAtA []byte) error { +func (m *UnsubscribeBroadcastResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3522,48 +5466,12 @@ func (m *RemoveDocumentResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RemoveDocumentResponse: wiretype end group for non-group") + return fmt.Errorf("proto: UnsubscribeBroadcastResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UnsubscribeBroadcastResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - 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:]) @@ -3586,7 +5494,7 @@ func (m *RemoveDocumentResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *PushPullChangesRequest) Unmarshal(dAtA []byte) error { +func (m *BroadcastRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3609,10 +5517,10 @@ func (m *PushPullChangesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PushPullChangesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: BroadcastRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PushPullChangesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BroadcastRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3681,7 +5589,7 @@ func (m *PushPullChangesRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChangePack", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3708,33 +5616,13 @@ func (m *PushPullChangesRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ChangePack == nil { - m.ChangePack = &ChangePack{} + if m.Event == nil { + m.Event = &BroadcastEvent{} } - if err := m.ChangePack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PushOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PushOnly = bool(v != 0) default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -3757,7 +5645,7 @@ func (m *PushPullChangesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *PushPullChangesResponse) Unmarshal(dAtA []byte) error { +func (m *BroadcastResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3780,48 +5668,12 @@ func (m *PushPullChangesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PushPullChangesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: BroadcastResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PushPullChangesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BroadcastResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - 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:]) diff --git a/api/yorkie/v1/yorkie.proto b/api/yorkie/v1/yorkie.proto index d5445e8ec..2d9690b3b 100644 --- a/api/yorkie/v1/yorkie.proto +++ b/api/yorkie/v1/yorkie.proto @@ -36,10 +36,10 @@ service YorkieService { rpc WatchDocument (WatchDocumentRequest) returns (stream WatchDocumentResponse) {} - rpc WatchEvents (WatchEventsRequest) returns (stream WatchEventsResponse) {} - rpc SubscribeEvent (SubscribeEventRequest) returns (SubscribeEventResponse) {} - rpc UnsubscribeEvent (UnsubscribeEventRequest) returns (UnsubscribeEventResponse) {} - rpc BroadcastEvent (BroadcastEventRequest) returns (BroadcastEventResponse) {} + rpc Broadcast (BroadcastRequest) returns (BroadcastResponse) {} + rpc WatchBroadcasts (WatchBroadcastsRequest) returns (stream WatchBroadcastsResponse) {} + rpc SubscribeBroadcast (SubscribeBroadcastRequest) returns (SubscribeBroadcastResponse) {} + rpc UnsubscribeBroadcast (UnsubscribeBroadcastRequest) returns (UnsubscribeBroadcastResponse) {} } message ActivateClientRequest { @@ -115,38 +115,38 @@ message PushPullChangesResponse { ChangePack change_pack = 1; } -message WatchEventsRequest { +message WatchBroadcastsRequest { string client_id = 1; string document_id = 2; } -message WatchEventsResponse { +message WatchBroadcastsResponse { BroadcastEvent event = 1; } -message SubscribeEventRequest { +message SubscribeBroadcastRequest { string client_id = 1; string document_id = 2; string type = 3; } -message SubscribeEventResponse { +message SubscribeBroadcastResponse { } -message UnsubscribeEventRequest { +message UnsubscribeBroadcastRequest { string client_id = 1; string document_id = 2; string type = 3; } -message UnsubscribeEventResponse { +message UnsubscribeBroadcastResponse { } -message BroadcastEventRequest { +message BroadcastRequest { string client_id = 1; string document_id = 2; BroadcastEvent event = 3; } -message BroadcastEventResponse { +message BroadcastResponse { } \ No newline at end of file From cc90ee816715dd58fd2aa0d495e451e50f9470d7 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 30 Aug 2023 18:34:00 +0900 Subject: [PATCH 03/24] Add event type concept to pubsub --- server/backend/sync/memory/pubsub.go | 337 ++++++++++++++++++++------- server/backend/sync/pubsub.go | 91 ++++++-- 2 files changed, 324 insertions(+), 104 deletions(-) diff --git a/server/backend/sync/memory/pubsub.go b/server/backend/sync/memory/pubsub.go index a01703784..d058dc85d 100644 --- a/server/backend/sync/memory/pubsub.go +++ b/server/backend/sync/memory/pubsub.go @@ -29,166 +29,310 @@ import ( "github.com/yorkie-team/yorkie/server/logging" ) -// subscriptions is a map of subscriptions. -type subscriptions struct { - internalMap map[string]*sync.Subscription +// subscriptionIDs is a set of subscriptionIDs. +type subscriptionIDs map[string]struct{} + +func (s subscriptionIDs) Add(subID string) { + s[subID] = struct{}{} +} + +func (s subscriptionIDs) Contains(subID string) bool { + _, exists := s[subID] + return exists +} + +func (s subscriptionIDs) Remove(subID string) { + delete(s, subID) +} + +func (s subscriptionIDs) Len() int { + return len(s) +} + +type DocSubs[E sync.Event] struct { + documentID types.ID + subMapBySubIDs map[string]*sync.Subscription[E] + subIDsMapByEvent map[types.EventType]subscriptionIDs } -func newSubscriptions() *subscriptions { - return &subscriptions{ - internalMap: make(map[string]*sync.Subscription), +func NewDocSubs[E sync.Event](docID types.ID) *DocSubs[E] { + return &DocSubs[E]{ + documentID: docID, + subMapBySubIDs: make(map[string]*sync.Subscription[E]), + subIDsMapByEvent: make(map[types.EventType]subscriptionIDs), } } -// Add adds the given subscription. -func (s *subscriptions) Add(sub *sync.Subscription) { - s.internalMap[sub.ID()] = sub +func (s *DocSubs[E]) Len() int { + return len(s.subMapBySubIDs) } -// Map returns the internal map of these subscriptions. -func (s *subscriptions) Map() map[string]*sync.Subscription { - return s.internalMap +func (s *DocSubs[E]) Add(sub *sync.Subscription[E]) { + s.subMapBySubIDs[sub.ID()] = sub } -// Delete deletes the subscription of the given id. -func (s *subscriptions) Delete(id string) { - if subscription, ok := s.internalMap[id]; ok { - subscription.Close() +func (s *DocSubs[E]) Remove(subID string) { + if sub, ok := s.subMapBySubIDs[subID]; ok { + // Close the subscription + sub.Close() + + // Remove the subID from subIDsMapByEvent + for _, t := range sub.Types() { + if subIDs, ok := s.subIDsMapByEvent[t]; ok { + subIDs.Remove(subID) + + if subIDs.Len() == 0 { + delete(s.subIDsMapByEvent, t) + } + } + } } - delete(s.internalMap, id) + + // Remove the subscription from subMapBySubIDs + delete(s.subMapBySubIDs, subID) } -// Len returns the length of these subscriptions. -func (s *subscriptions) Len() int { - return len(s.internalMap) +func (s *DocSubs[E]) SubscribeEvent(eventType types.EventType, subID string) { + if sub, ok := s.subMapBySubIDs[subID]; ok { + if _, ok := s.subIDsMapByEvent[eventType]; !ok { + s.subIDsMapByEvent[eventType] = make(subscriptionIDs) + } + s.subIDsMapByEvent[eventType].Add(subID) + + sub.AddType(eventType) + } +} + +func (s *DocSubs[E]) UnsubscribeEvent(eventType types.EventType, subID string) { + if sub, ok := s.subMapBySubIDs[subID]; ok { + if subIDs, ok := s.subIDsMapByEvent[eventType]; ok { + subIDs.Remove(subID) + } + + sub.RemoveType(eventType) + } } // PubSub is the memory implementation of PubSub, used for single server. -type PubSub struct { - subscriptionsMapMu *gosync.RWMutex - subscriptionsMapByDocID map[types.ID]*subscriptions +type PubSub[E sync.Event] struct { + docSubsMapMu *gosync.RWMutex + docSubsMapByDocID map[types.ID]*DocSubs[E] } // NewPubSub creates an instance of PubSub. -func NewPubSub() *PubSub { - return &PubSub{ - subscriptionsMapMu: &gosync.RWMutex{}, - subscriptionsMapByDocID: make(map[types.ID]*subscriptions), +func NewPubSub[E sync.Event]() *PubSub[E] { + return &PubSub[E]{ + docSubsMapMu: &gosync.RWMutex{}, + docSubsMapByDocID: make(map[types.ID]*DocSubs[E]), } } -// Subscribe subscribes to the given document keys. -func (m *PubSub) Subscribe( +// Watch subscribes to the given document keys. +func (m *PubSub[E]) SubscribeDoc( ctx context.Context, subscriber *time.ActorID, documentID types.ID, -) (*sync.Subscription, error) { +) (string, error) { + m.docSubsMapMu.Lock() + defer m.docSubsMapMu.Unlock() + if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `Subscribe(%s,%s) Start`, + `SubscribeDoc(%s,%s) Start`, documentID.String(), subscriber.String(), ) } - m.subscriptionsMapMu.Lock() - defer m.subscriptionsMapMu.Unlock() - - sub := sync.NewSubscription(subscriber) - if _, ok := m.subscriptionsMapByDocID[documentID]; !ok { - m.subscriptionsMapByDocID[documentID] = newSubscriptions() + sub := sync.NewSubscription[E](documentID, subscriber) + if _, ok := m.docSubsMapByDocID[documentID]; !ok { + m.docSubsMapByDocID[documentID] = NewDocSubs[E](documentID) } - m.subscriptionsMapByDocID[documentID].Add(sub) + + m.docSubsMapByDocID[documentID].Add(sub) if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `Subscribe(%s,%s) End`, + `SubscribeDoc(%s,%s) End`, documentID.String(), subscriber.String(), ) } - return sub, nil + return sub.ID(), nil } -// Unsubscribe unsubscribes the given docKeys. -func (m *PubSub) Unsubscribe( +// Unwatch unsubscribes the given docKeys. +func (m *PubSub[E]) UnsubscribeDoc( ctx context.Context, documentID types.ID, - sub *sync.Subscription, + subID string, ) { - m.subscriptionsMapMu.Lock() - defer m.subscriptionsMapMu.Unlock() + m.docSubsMapMu.Lock() + defer m.docSubsMapMu.Unlock() + + docSubs, ok := m.docSubsMapByDocID[documentID] + if !ok { + return + } + + sub, ok := docSubs.subMapBySubIDs[subID] + if !ok { + return + } if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `Unsubscribe(%s,%s) Start`, + `UnsubscribeDoc(%s,%s) Start`, documentID, sub.Subscriber().String(), ) } - sub.Close() + docSubs.Remove(subID) - if subs, ok := m.subscriptionsMapByDocID[documentID]; ok { - subs.Delete(sub.ID()) - - if subs.Len() == 0 { - delete(m.subscriptionsMapByDocID, documentID) - } + if docSubs.Len() == 0 { + delete(m.docSubsMapByDocID, documentID) } if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `Unsubscribe(%s,%s) End`, + `UnsubscribeDoc(%s,%s) End`, documentID, sub.Subscriber().String(), ) } } +func (m *PubSub[E]) SubscribeEvent( + ctx context.Context, + documentID types.ID, + eventType types.EventType, + subID string, +) { + m.docSubsMapMu.Lock() + defer m.docSubsMapMu.Unlock() + + docSubs, ok := m.docSubsMapByDocID[documentID] + if !ok { + return + } + + // TODO(sejongk): log subscriber info + if logging.Enabled(zap.DebugLevel) { + logging.From(ctx).Debugf( + `SubscribeEvent(%s,%s,%s) Start`, + documentID, + eventType, + subID, + ) + } + + docSubs.SubscribeEvent(eventType, subID) + + if logging.Enabled(zap.DebugLevel) { + logging.From(ctx).Debugf( + `SubscribeEvent(%s,%s,%s) End`, + documentID, + eventType, + subID, + ) + } +} + +func (m *PubSub[E]) UnsubscribeEvent( + ctx context.Context, + documentID types.ID, + eventType types.EventType, + subID string, +) { + m.docSubsMapMu.Lock() + defer m.docSubsMapMu.Unlock() + + docSubs, ok := m.docSubsMapByDocID[documentID] + if !ok { + return + } + + // TODO(sejongk): log subscriber info + if logging.Enabled(zap.DebugLevel) { + logging.From(ctx).Debugf( + `SubscribeEvent(%s,%s,%s) Start`, + documentID, + eventType, + subID, + ) + } + + docSubs.UnsubscribeEvent(eventType, subID) + + if logging.Enabled(zap.DebugLevel) { + logging.From(ctx).Debugf( + `SubscribeEvent(%s,%s,%s) End`, + documentID, + eventType, + subID, + ) + } +} + // Publish publishes the given event. -func (m *PubSub) Publish( +func (m *PubSub[E]) Publish( ctx context.Context, + documentID types.ID, + eventType types.EventType, publisherID *time.ActorID, - event sync.DocEvent, + event E, ) { - m.subscriptionsMapMu.RLock() - defer m.subscriptionsMapMu.RUnlock() + m.docSubsMapMu.RLock() + defer m.docSubsMapMu.RUnlock() - documentID := event.DocumentID if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf(`Publish(%s,%s) Start`, documentID.String(), publisherID.String()) } - if subs, ok := m.subscriptionsMapByDocID[documentID]; ok { - for _, sub := range subs.Map() { - if sub.Subscriber().Compare(publisherID) == 0 { - continue - } + docSubs, ok := m.docSubsMapByDocID[documentID] + if !ok { + return + } - if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf( - `Publish %s(%s,%s) to %s`, - event.Type, - documentID.String(), - publisherID.String(), - sub.Subscriber().String(), - ) - } + subIDs, ok := docSubs.subIDsMapByEvent[eventType] + if !ok { + return + } - // NOTE: When a subscription is being closed by a subscriber, - // the subscriber may not receive messages. - select { - case sub.Events() <- event: - case <-gotime.After(100 * gotime.Millisecond): - logging.From(ctx).Warnf( - `Publish(%s,%s) to %s timeout`, - documentID.String(), - publisherID.String(), - sub.Subscriber().String(), - ) - } + for subID := range subIDs { + sub, ok := docSubs.subMapBySubIDs[subID] + if !ok { + continue + } + + if sub.Subscriber().Compare(publisherID) == 0 { + continue } + + if logging.Enabled(zap.DebugLevel) { + logging.From(ctx).Debugf( + `Publish %s(%s,%s) to %s`, + eventType, + documentID.String(), + publisherID.String(), + sub.Subscriber().String(), + ) + } + + // NOTE: When a subscription is being closed by a subscriber, + // the subscriber may not receive messages. + select { + case sub.Events() <- event: + case <-gotime.After(100 * gotime.Millisecond): + logging.From(ctx).Warnf( + `Publish(%s,%s) to %s timeout`, + documentID.String(), + publisherID.String(), + sub.Subscriber().String(), + ) + } + } if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf(`Publish(%s,%s) End`, documentID.String(), publisherID.String()) @@ -196,13 +340,26 @@ func (m *PubSub) Publish( } // ClientIDs returns the clients of the given document. -func (m *PubSub) ClientIDs(documentID types.ID) []*time.ActorID { - m.subscriptionsMapMu.RLock() - defer m.subscriptionsMapMu.RUnlock() +func (m *PubSub[E]) ClientIDs(documentID types.ID, eventType types.EventType) []*time.ActorID { + m.docSubsMapMu.RLock() + defer m.docSubsMapMu.RUnlock() + + docSubs, ok := m.docSubsMapByDocID[documentID] + if !ok { + return nil + } + + subIDs, ok := docSubs.subIDsMapByEvent[eventType] + if !ok { + return nil + } var ids []*time.ActorID - for _, sub := range m.subscriptionsMapByDocID[documentID].Map() { - ids = append(ids, sub.Subscriber()) + for subID := range subIDs { + if sub, ok := docSubs.subMapBySubIDs[subID]; ok { + ids = append(ids, sub.Subscriber()) + } } + return ids } diff --git a/server/backend/sync/pubsub.go b/server/backend/sync/pubsub.go index 80ce74164..8292a744b 100644 --- a/server/backend/sync/pubsub.go +++ b/server/backend/sync/pubsub.go @@ -24,46 +24,66 @@ import ( ) // Subscription represents a subscription of a subscriber to documents. -type Subscription struct { +type Subscription[E Event] struct { id string + docID types.ID + types []types.EventType subscriber *time.ActorID closed bool - events chan DocEvent + events chan E } // NewSubscription creates a new instance of Subscription. -func NewSubscription(subscriber *time.ActorID) *Subscription { - return &Subscription{ +func NewSubscription[E Event](docID types.ID, subscriber *time.ActorID) *Subscription[E] { + return &Subscription[E]{ id: xid.New().String(), + docID: docID, + types: make([]types.EventType, 0), subscriber: subscriber, - events: make(chan DocEvent, 1), + events: make(chan E, 1), } } // ID returns the id of this subscription. -func (s *Subscription) ID() string { +func (s *Subscription[E]) ID() string { return s.id } -// DocEvent represents events that occur related to the document. -type DocEvent struct { - Type types.DocEventType - Publisher *time.ActorID - DocumentID types.ID +// // DocID returns the doc id of this subscription. +// func (s *Subscription[E]) DocID() types.ID { +// return s.docID +// } + +func (s *Subscription[E]) Types() []types.EventType { + return s.types +} + +func (s *Subscription[E]) AddType(t types.EventType) { + s.types = append(s.types, t) +} + +func (s *Subscription[E]) RemoveType(t types.EventType) { + var idx int + for i, v := range s.types { + if v == t { + idx = i + } + } + s.types = append(s.types[:idx], s.types[idx+1:]...) } // Events returns the DocEvent channel of this subscription. -func (s *Subscription) Events() chan DocEvent { +func (s *Subscription[E]) Events() chan E { return s.events } // Subscriber returns the subscriber of this subscription. -func (s *Subscription) Subscriber() *time.ActorID { +func (s *Subscription[E]) Subscriber() *time.ActorID { return s.subscriber } // Close closes all resources of this Subscription. -func (s *Subscription) Close() { +func (s *Subscription[E]) Close() { if s.closed { return } @@ -71,3 +91,46 @@ func (s *Subscription) Close() { s.closed = true close(s.events) } + +type Event interface { + TypeString() string + PublisherString() string + PayloadString() string +} + +// DocEvent represents events that occur related to the document. +type DocEvent struct { + Type types.DocEventType + Publisher *time.ActorID + DocumentID types.ID +} + +func (e *DocEvent) TypeString() string { + return string(e.Type) +} + +func (e *DocEvent) PublisherString() string { + return e.Publisher.String() +} + +func (e *DocEvent) PayloadString() string { + return string(e.DocumentID) +} + +type BroadcastEvent struct { + Type string + Publisher *time.ActorID + Payload string +} + +func (e *BroadcastEvent) TypeString() string { + return e.Type +} + +func (e *BroadcastEvent) PublisherString() string { + return e.Publisher.String() +} + +func (e *BroadcastEvent) PayloadString() string { + return e.Payload +} From 70383a4e6ca0bac9db6478f2aa4413cdf8bd2f45 Mon Sep 17 00:00:00 2001 From: sejongk Date: Thu, 31 Aug 2023 17:43:36 +0900 Subject: [PATCH 04/24] Add broadcast API to server --- api/converter/from_pb.go | 13 + api/converter/to_pb.go | 9 + api/types/auth_webhook.go | 22 +- api/yorkie/v1/resources.pb.go | 370 +++++++++--------- api/yorkie/v1/resources.proto | 4 +- api/yorkie/v1/yorkie.pb.go | 209 +++++++--- api/yorkie/v1/yorkie.proto | 2 + server/backend/sync/coordinator.go | 49 ++- server/backend/sync/memory/coordinator.go | 86 +++- .../backend/sync/memory/coordinator_test.go | 2 +- server/backend/sync/memory/pubsub.go | 26 +- server/backend/sync/memory/pubsub_test.go | 12 +- server/backend/sync/pubsub.go | 35 +- server/packs/packs.go | 4 +- server/rpc/admin_server.go | 4 +- server/rpc/yorkie_server.go | 212 +++++++++- 16 files changed, 730 insertions(+), 329 deletions(-) diff --git a/api/converter/from_pb.go b/api/converter/from_pb.go index dcc119b6f..acc0987d0 100644 --- a/api/converter/from_pb.go +++ b/api/converter/from_pb.go @@ -29,6 +29,7 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/operations" "github.com/yorkie-team/yorkie/pkg/document/time" + "github.com/yorkie-team/yorkie/server/backend/sync" ) // FromUser converts the given Protobuf formats to model format. @@ -856,3 +857,15 @@ func FromUpdatableProjectFields(pbProjectFields *api.UpdatableProjectFields) (*t return updatableProjectFields, nil } + +func FromBroadcastEvent(event *api.BroadcastEvent) (*sync.BroadcastEvent, error) { + publisher, err := time.ActorIDFromHex(event.Publisher) + if err != nil { + return nil, err + } + return &sync.BroadcastEvent{ + Type: types.EventType(event.Type), + Publisher: publisher, + Payload: event.Payload, + }, nil +} diff --git a/api/converter/to_pb.go b/api/converter/to_pb.go index 1b1206203..ce63a70b0 100644 --- a/api/converter/to_pb.go +++ b/api/converter/to_pb.go @@ -29,6 +29,7 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/innerpresence" "github.com/yorkie-team/yorkie/pkg/document/operations" "github.com/yorkie-team/yorkie/pkg/document/time" + "github.com/yorkie-team/yorkie/server/backend/sync" ) // ToUser converts the given model format to Protobuf format. @@ -536,3 +537,11 @@ func ToUpdatableProjectFields(fields *types.UpdatableProjectFields) (*api.Updata } return pbUpdatableProjectFields, nil } + +func ToBroadcastEvent(event *sync.BroadcastEvent) *api.BroadcastEvent { + return &api.BroadcastEvent{ + Type: event.TypeString(), + Publisher: event.PublisherString(), + Payload: event.Payload, + } +} diff --git a/api/types/auth_webhook.go b/api/types/auth_webhook.go index 46fc678d1..e348a0db6 100644 --- a/api/types/auth_webhook.go +++ b/api/types/auth_webhook.go @@ -50,13 +50,17 @@ type Method string // Belows are the names of RPCs. const ( - ActivateClient Method = "ActivateClient" - DeactivateClient Method = "DeactivateClient" - AttachDocument Method = "AttachDocument" - DetachDocument Method = "DetachDocument" - RemoveDocument Method = "RemoveDocument" - PushPull Method = "PushPull" - WatchDocuments Method = "WatchDocuments" + ActivateClient Method = "ActivateClient" + DeactivateClient Method = "DeactivateClient" + AttachDocument Method = "AttachDocument" + DetachDocument Method = "DetachDocument" + RemoveDocument Method = "RemoveDocument" + PushPull Method = "PushPull" + WatchDocuments Method = "WatchDocuments" + Broadcast Method = "Broadcast" + WatchBroadcasts Method = "WatchBroadcasts" + SubscribeBroadcast Method = "SubscribeBroadcast" + UnsubscribeBroadcast Method = "UnsubscribeBroadcast" ) // IsAuthMethod returns whether the given method can be used for authorization. @@ -79,6 +83,10 @@ func AuthMethods() []Method { RemoveDocument, PushPull, WatchDocuments, + Broadcast, + WatchBroadcasts, + SubscribeBroadcast, + UnsubscribeBroadcast, } } diff --git a/api/yorkie/v1/resources.pb.go b/api/yorkie/v1/resources.pb.go index c17b57331..483c78f8e 100644 --- a/api/yorkie/v1/resources.pb.go +++ b/api/yorkie/v1/resources.pb.go @@ -3322,8 +3322,8 @@ func (m *DocEvent) GetPublisher() string { } type BroadcastEvent struct { - Publisher string `protobuf:"bytes,1,opt,name=publisher,proto3" json:"publisher,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Publisher string `protobuf:"bytes,2,opt,name=publisher,proto3" json:"publisher,omitempty"` Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -3363,16 +3363,16 @@ func (m *BroadcastEvent) XXX_DiscardUnknown() { var xxx_messageInfo_BroadcastEvent proto.InternalMessageInfo -func (m *BroadcastEvent) GetPublisher() string { +func (m *BroadcastEvent) GetType() string { if m != nil { - return m.Publisher + return m.Type } return "" } -func (m *BroadcastEvent) GetType() string { +func (m *BroadcastEvent) GetPublisher() string { if m != nil { - return m.Type + return m.Publisher } return "" } @@ -3446,172 +3446,172 @@ func init() { func init() { proto.RegisterFile("yorkie/v1/resources.proto", fileDescriptor_36361b2f5d0f0896) } var fileDescriptor_36361b2f5d0f0896 = []byte{ - // 2632 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xcf, 0x8f, 0x1b, 0x49, - 0xf5, 0x9f, 0x6e, 0xb7, 0x7f, 0xf4, 0x9b, 0x64, 0xc6, 0xa9, 0xc9, 0x0f, 0xc7, 0x49, 0x66, 0x27, - 0xde, 0xef, 0xee, 0x77, 0x36, 0x01, 0xcf, 0x0f, 0x76, 0x97, 0x25, 0x21, 0x80, 0xc7, 0xee, 0x64, - 0x9c, 0x9d, 0x78, 0x86, 0xb6, 0x27, 0x4b, 0x56, 0x8b, 0x5a, 0x3d, 0xdd, 0x35, 0x33, 0xbd, 0x63, - 0x77, 0x7b, 0xbb, 0xdb, 0xde, 0x58, 0x42, 0x42, 0x42, 0x20, 0x71, 0xe5, 0x06, 0x7f, 0x02, 0x17, - 0xee, 0x7b, 0x84, 0x03, 0x42, 0x42, 0x88, 0x95, 0x58, 0x89, 0x2b, 0x1b, 0x0e, 0x08, 0x6e, 0x08, - 0x89, 0x1b, 0x12, 0xaa, 0x1f, 0xdd, 0x6e, 0xdb, 0x6d, 0x8f, 0x63, 0x86, 0x55, 0x22, 0x6e, 0x5d, - 0x55, 0x9f, 0x57, 0xf5, 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 0x29, 0xba, 0xea, 0xd4, 0xed, 0x06, 0x09, 0x58, 0x2a, 0x03, 0xcc, 0x98, 0x95, 0x47, 0x39, - 0x99, 0x98, 0x81, 0x93, 0xd2, 0x74, 0x9c, 0xcc, 0xff, 0x41, 0x00, 0x39, 0xf4, 0xea, 0x44, 0xab, - 0x1e, 0x94, 0x5e, 0x1e, 0xab, 0xfe, 0x2a, 0x80, 0x1c, 0x32, 0x2d, 0x5c, 0x77, 0xc2, 0xf4, 0xeb, - 0x4e, 0x8c, 0xac, 0xbb, 0x19, 0xcf, 0x84, 0x51, 0x5b, 0xa5, 0x19, 0x6c, 0x4d, 0x4e, 0x69, 0xeb, - 0xef, 0x05, 0x90, 0xc8, 0xc2, 0x40, 0x6f, 0x0c, 0x3a, 0x6f, 0x29, 0x26, 0xf7, 0x7b, 0x39, 0xbc, - 0xf7, 0x17, 0x01, 0xd2, 0x7c, 0xd1, 0xfe, 0x2f, 0xf8, 0xce, 0xc5, 0x78, 0xa2, 0xef, 0x78, 0x02, - 0xf4, 0x52, 0xf8, 0x2e, 0xdc, 0x9f, 0x1f, 0x41, 0x9a, 0xc7, 0xc1, 0x98, 0xed, 0x7d, 0x1d, 0xd2, - 0x98, 0xc5, 0xd8, 0x98, 0x13, 0x4d, 0xf4, 0xf2, 0x23, 0x80, 0x15, 0x0c, 0x48, 0xf3, 0x00, 0x44, - 0x92, 0x22, 0x9b, 0x6c, 0x15, 0xc2, 0x48, 0xba, 0x13, 0x84, 0x28, 0xda, 0x3e, 0xc3, 0x20, 0x8f, - 0x21, 0x43, 0xe4, 0x49, 0x7a, 0xd2, 0x67, 0x93, 0x10, 0xc9, 0x40, 0xc8, 0x9c, 0x74, 0xda, 0xe6, - 0x74, 0x73, 0xcf, 0x81, 0x25, 0xbf, 0xf0, 0x3b, 0x11, 0x32, 0xc1, 0x0a, 0x44, 0xaf, 0x45, 0x6e, - 0x05, 0x2e, 0xc5, 0x2c, 0x51, 0x7e, 0x2f, 0x10, 0x9b, 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0x1e, 0x11, 0x49, 0xec, 0xd7, - 0x20, 0x13, 0x3c, 0x50, 0x98, 0xf4, 0x30, 0x25, 0x04, 0x15, 0x5a, 0xc1, 0xb3, 0x14, 0xd2, 0x09, - 0xba, 0x06, 0x57, 0xca, 0xdb, 0xa5, 0xda, 0x03, 0x45, 0x6b, 0x3c, 0xd9, 0x53, 0xb4, 0xfd, 0x5a, - 0x7d, 0x4f, 0x29, 0x57, 0xef, 0x57, 0x95, 0x4a, 0x76, 0x0e, 0x2d, 0xc1, 0x62, 0xb4, 0x71, 0x6f, - 0xbf, 0x91, 0x15, 0xd0, 0x65, 0x40, 0xd1, 0xca, 0x8a, 0xb2, 0xa3, 0x34, 0x94, 0xac, 0x88, 0x2e, - 0xc1, 0x85, 0x68, 0x7d, 0x79, 0x47, 0x29, 0xa9, 0xd9, 0x44, 0xa1, 0x0b, 0x99, 0x40, 0x09, 0xb4, - 0x01, 0x12, 0xa1, 0x32, 0xdf, 0x7d, 0x6e, 0xc4, 0xe8, 0x59, 0xac, 0xe8, 0xbe, 0xce, 0xb6, 0x46, - 0x0a, 0xcd, 0x7f, 0x15, 0xe4, 0xb0, 0xea, 0x79, 0x7e, 0x85, 0x15, 0x6a, 0xc4, 0xcc, 0xf0, 0x8d, - 0xcc, 0xe0, 0x43, 0x0c, 0x21, 0xee, 0x21, 0xc6, 0xe0, 0x53, 0x0e, 0x71, 0xe8, 0x29, 0x47, 0xe1, - 0x87, 0x02, 0xcc, 0x47, 0x2e, 0x09, 0xce, 0x76, 0x3f, 0x44, 0xff, 0x0f, 0x8b, 0x2e, 0x6e, 0xea, - 0xe4, 0x40, 0xae, 0x71, 0x40, 0x82, 0x02, 0x16, 0x82, 0xea, 0x5d, 0xb6, 0x71, 0x1a, 0x00, 0xfd, - 0x9e, 0xa3, 0x8f, 0x47, 0x84, 0xd1, 0xc7, 0x23, 0xd7, 0x41, 0x36, 0x71, 0x93, 0x9c, 0xf3, 0xb1, - 0x1b, 0x18, 0x14, 0x56,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, 0x7a, 0x92, 0x95, 0x87, 0xfa, 0x6a, - 0x28, 0xdf, 0x69, 0x64, 0x61, 0xa8, 0x2f, 0x6e, 0x91, 0x56, 0xae, 0x35, 0xb2, 0xf3, 0xe8, 0x0a, - 0x2c, 0x0d, 0x59, 0x45, 0x1b, 0xce, 0x0d, 0xf7, 0xa4, 0x2a, 0x4a, 0xf6, 0xfc, 0xad, 0xef, 0xc3, - 0xb9, 0xa8, 0xa3, 0xd1, 0xab, 0xf0, 0x4a, 0x65, 0xb7, 0xac, 0x29, 0x8f, 0x95, 0x5a, 0x23, 0x98, - 0x82, 0xf2, 0xfe, 0x23, 0x52, 0x62, 0xcb, 0x9f, 0x04, 0x8e, 0x09, 0xa0, 0xf7, 0x4a, 0x8d, 0xf2, - 0xb6, 0x52, 0xc9, 0x0a, 0xe8, 0x35, 0xb8, 0x39, 0x0e, 0xb4, 0x5f, 0x0b, 0x60, 0xe2, 0xd6, 0xed, - 0xdf, 0x3c, 0x5b, 0x16, 0x3e, 0x7d, 0xb6, 0x2c, 0xfc, 0xe9, 0xd9, 0xb2, 0xf0, 0xd3, 0x3f, 0x2f, - 0xcf, 0xc1, 0x05, 0x13, 0x77, 0x03, 0x1e, 0xea, 0x6d, 0xab, 0xd8, 0xdd, 0xd8, 0x13, 0xde, 0x97, - 0x8a, 0x77, 0xbb, 0x1b, 0x07, 0x29, 0x1a, 0x79, 0xbf, 0xf2, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x9d, 0x46, 0xe4, 0x41, 0xb2, 0x28, 0x00, 0x00, + // 2630 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xcf, 0x8f, 0x23, 0x47, + 0xf5, 0x9f, 0x6e, 0xb7, 0x7f, 0xf4, 0x9b, 0xdd, 0x19, 0x6f, 0xcd, 0xfe, 0xf0, 0x7a, 0x77, 0x27, + 0xb3, 0xce, 0x37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x6b, 0xe2, 0x16, 0x6e, 0x07, 0x3a, 0xc5, 0xa0, + 0x6f, 0x81, 0xda, 0xf1, 0xb0, 0x8f, 0xdb, 0x16, 0xf6, 0x73, 0xf2, 0x5a, 0x62, 0x7d, 0x71, 0xbb, + 0x20, 0x08, 0x84, 0x7d, 0x16, 0x0f, 0x42, 0x90, 0xd6, 0x0e, 0xbc, 0xbe, 0x3e, 0x10, 0xca, 0x7f, + 0x1b, 0x96, 0x86, 0x1b, 0x51, 0x16, 0x12, 0x67, 0xb8, 0x4f, 0x87, 0x57, 0x75, 0xf2, 0x89, 0x5e, + 0x80, 0x64, 0xcf, 0x6c, 0x76, 0x71, 0x4e, 0xa6, 0x2a, 0xad, 0x08, 0x23, 0x84, 0xb2, 0x3a, 0x43, + 0xbc, 0x2a, 0xbf, 0x22, 0x15, 0x7e, 0x22, 0x03, 0x94, 0x4f, 0xcd, 0xf6, 0x09, 0x3e, 0x30, 0xad, + 0x33, 0x74, 0x17, 0x2e, 0xd9, 0xae, 0xd5, 0x25, 0x5a, 0x1b, 0x83, 0x8e, 0x17, 0xc3, 0xba, 0xb7, + 0x70, 0x1f, 0xbd, 0x04, 0x60, 0x9d, 0x62, 0xeb, 0xac, 0xe3, 0x3a, 0xed, 0x80, 0x8f, 0x72, 0x4d, + 0x18, 0xa5, 0x1c, 0x35, 0xea, 0x02, 0x10, 0xe5, 0x21, 0xe3, 0x73, 0x0b, 0x73, 0x89, 0x35, 0x69, + 0xfd, 0x92, 0x1e, 0x95, 0xd1, 0x7d, 0x48, 0x5b, 0x54, 0x07, 0x3f, 0xa7, 0xd0, 0x79, 0xb9, 0x32, + 0xd4, 0x1f, 0x69, 0xd1, 0x43, 0x04, 0x2a, 0xc1, 0x95, 0x96, 0xd3, 0x36, 0xfc, 0x7e, 0xdb, 0xc2, + 0xb6, 0x11, 0x38, 0xd6, 0x19, 0x0e, 0x72, 0xc9, 0x31, 0x35, 0x1a, 0x4e, 0x0b, 0x37, 0x68, 0xa3, + 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0x44, 0x67, 0xe8, 0x49, 0x3d, 0x1c, 0x84, 0x38, 0xd2, 0x43, 0x24, 0x84, 0xb6, + 0x40, 0x09, 0xf0, 0xe3, 0x90, 0x46, 0xb7, 0x26, 0x08, 0x93, 0x2d, 0x8c, 0x1c, 0x8d, 0x09, 0x14, + 0xbd, 0x4a, 0xb2, 0xae, 0x6e, 0x3b, 0xc0, 0x1e, 0x0f, 0x00, 0xab, 0x13, 0xa4, 0xca, 0x0c, 0xb5, + 0xbb, 0xa0, 0x87, 0x02, 0x74, 0x38, 0x0f, 0x87, 0xc7, 0xe3, 0x89, 0xc3, 0x79, 0x98, 0x9e, 0xf8, + 0x09, 0x34, 0xff, 0x89, 0x04, 0x30, 0x98, 0x43, 0xb4, 0x0e, 0xc9, 0x36, 0x89, 0x4a, 0x39, 0x89, + 0xae, 0x24, 0x71, 0xd5, 0xe9, 0xbb, 0x0d, 0x12, 0xb0, 0x74, 0x06, 0x98, 0x33, 0x2b, 0x17, 0x39, + 0x99, 0x98, 0x83, 0x93, 0xca, 0x6c, 0x9c, 0xcc, 0xff, 0x41, 0x02, 0x35, 0xf2, 0xea, 0x54, 0xab, + 0x1e, 0x94, 0xbe, 0x38, 0x56, 0xfd, 0x55, 0x02, 0x35, 0x62, 0x5a, 0xb4, 0xee, 0xa4, 0xd9, 0xd7, + 0x9d, 0x2c, 0xac, 0xbb, 0x39, 0xcf, 0x84, 0xa2, 0xad, 0xca, 0x1c, 0xb6, 0x26, 0x67, 0xb4, 0xf5, + 0xf7, 0x12, 0x28, 0x64, 0x61, 0xa0, 0x17, 0x86, 0x9d, 0xb7, 0x12, 0x93, 0xfb, 0x7d, 0x31, 0xbc, + 0xf7, 0x17, 0x09, 0xd2, 0x7c, 0xd1, 0xfe, 0x2f, 0xf8, 0xce, 0xc3, 0x78, 0xaa, 0xef, 0x78, 0x02, + 0xf4, 0x85, 0xf0, 0x5d, 0xb4, 0x3f, 0x3f, 0x84, 0x34, 0x8f, 0x83, 0x31, 0xd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e, 0x9a, 0x1d, 0xa7, 0xd8, 0xdb, 0x3a, 0x90, 0xde, 0x55, 0x8a, 0xaf, + 0xf5, 0xb6, 0x8e, 0x52, 0x34, 0xf2, 0x7e, 0xe5, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcf, 0xf4, + 0xeb, 0x2c, 0xb2, 0x28, 0x00, 0x00, } func (m *Snapshot) Marshal() (dAtA []byte, err error) { @@ -6860,18 +6860,18 @@ func (m *BroadcastEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintResources(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x12 - } if len(m.Publisher) > 0 { i -= len(m.Publisher) copy(dAtA[i:], m.Publisher) i = encodeVarintResources(dAtA, i, uint64(len(m.Publisher))) i-- + dAtA[i] = 0x12 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintResources(dAtA, i, uint64(len(m.Type))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -8287,11 +8287,11 @@ func (m *BroadcastEvent) Size() (n int) { } var l int _ = l - l = len(m.Publisher) + l = len(m.Type) if l > 0 { n += 1 + l + sovResources(uint64(l)) } - l = len(m.Type) + l = len(m.Publisher) if l > 0 { n += 1 + l + sovResources(uint64(l)) } @@ -17043,7 +17043,7 @@ func (m *BroadcastEvent) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17071,11 +17071,11 @@ func (m *BroadcastEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Publisher = string(dAtA[iNdEx:postIndex]) + m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17103,7 +17103,7 @@ func (m *BroadcastEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.Publisher = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { diff --git a/api/yorkie/v1/resources.proto b/api/yorkie/v1/resources.proto index 50fefd507..ac3e261d4 100644 --- a/api/yorkie/v1/resources.proto +++ b/api/yorkie/v1/resources.proto @@ -365,7 +365,7 @@ message DocEvent { } message BroadcastEvent { - string publisher = 1; - string type = 2; + string type = 1; + string publisher = 2; bytes payload = 3; } \ No newline at end of file diff --git a/api/yorkie/v1/yorkie.pb.go b/api/yorkie/v1/yorkie.pb.go index 7582b1720..c367a4265 100644 --- a/api/yorkie/v1/yorkie.pb.go +++ b/api/yorkie/v1/yorkie.pb.go @@ -958,6 +958,7 @@ type SubscribeBroadcastRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + SubID string `protobuf:"bytes,4,opt,name=subID,proto3" json:"subID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1017,6 +1018,13 @@ func (m *SubscribeBroadcastRequest) GetType() string { return "" } +func (m *SubscribeBroadcastRequest) GetSubID() string { + if m != nil { + return m.SubID + } + return "" +} + type SubscribeBroadcastResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1060,6 +1068,7 @@ type UnsubscribeBroadcastRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + SubID string `protobuf:"bytes,4,opt,name=subID,proto3" json:"subID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1119,6 +1128,13 @@ func (m *UnsubscribeBroadcastRequest) GetType() string { return "" } +func (m *UnsubscribeBroadcastRequest) GetSubID() string { + if m != nil { + return m.SubID + } + return "" +} + type UnsubscribeBroadcastResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1289,59 +1305,60 @@ func init() { func init() { proto.RegisterFile("yorkie/v1/yorkie.proto", fileDescriptor_40070c858814ab24) } var fileDescriptor_40070c858814ab24 = []byte{ - // 826 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcd, 0x6e, 0xda, 0x4a, - 0x14, 0x66, 0x12, 0x6e, 0x6e, 0x38, 0x28, 0x7f, 0x93, 0x40, 0x88, 0xc9, 0x25, 0xdc, 0xb9, 0x7f, - 0x91, 0x22, 0xc1, 0x25, 0x51, 0xb3, 0xe9, 0x2a, 0x09, 0x95, 0x42, 0x2b, 0xb5, 0xd4, 0x69, 0x13, - 0x25, 0x6a, 0x85, 0x8c, 0x3d, 0x29, 0x16, 0xc4, 0x26, 0xb6, 0xb1, 0x44, 0x77, 0x7d, 0x80, 0xee, - 0xfb, 0x0e, 0x7d, 0x8b, 0xae, 0xba, 0xec, 0xb2, 0xcb, 0x2a, 0x7d, 0x8f, 0xaa, 0xc2, 0x1e, 0x1c, - 0x8f, 0x99, 0x00, 0x6d, 0x50, 0xdb, 0x9d, 0x99, 0x39, 0xe7, 0x3b, 0xdf, 0x39, 0x73, 0xe6, 0x3b, - 0x03, 0xa4, 0xbb, 0xa6, 0xd5, 0xd4, 0x69, 0xd1, 0x2d, 0x15, 0xfd, 0xaf, 0x42, 0xdb, 0x32, 0x1d, - 0x13, 0x27, 0xd8, 0x2f, 0xb7, 0x24, 0xad, 0x5d, 0x9b, 0x58, 0xd4, 0x36, 0x3b, 0x96, 0x4a, 0x6d, - 0xdf, 0x8a, 0xec, 0x42, 0x6a, 0x4f, 0x75, 0x74, 0x57, 0x71, 0xe8, 0x41, 0x4b, 0xa7, 0x86, 0x23, - 0xd3, 0xcb, 0x0e, 0xb5, 0x1d, 0xfc, 0x07, 0x80, 0xea, 0x2d, 0xd4, 0x9a, 0xb4, 0x9b, 0x41, 0x79, - 0xb4, 0x99, 0x90, 0x13, 0xfe, 0xca, 0x03, 0xda, 0x25, 0x77, 0x20, 0x1d, 0xf5, 0xb3, 0xdb, 0xa6, - 0x61, 0x53, 0x9c, 0x05, 0x66, 0x56, 0xd3, 0x35, 0xe6, 0x37, 0xeb, 0x2f, 0x54, 0x34, 0xb2, 0x0b, - 0xab, 0x65, 0xaa, 0x08, 0x03, 0x0e, 0xf5, 0x93, 0x20, 0x33, 0xe8, 0xe7, 0x07, 0x24, 0x2d, 0x48, - 0xed, 0x39, 0x8e, 0xa2, 0x36, 0xca, 0xa6, 0xda, 0xb9, 0x18, 0x13, 0x11, 0xef, 0x42, 0x52, 0x6d, - 0x28, 0xc6, 0x0b, 0x5a, 0x6b, 0x2b, 0x6a, 0x33, 0x33, 0x95, 0x47, 0x9b, 0xc9, 0xed, 0x54, 0x21, - 0x28, 0x5a, 0xe1, 0xc0, 0xdb, 0xad, 0x2a, 0x6a, 0x53, 0x06, 0x35, 0xf8, 0x26, 0x97, 0x90, 0x8e, - 0x46, 0x63, 0x89, 0x6f, 0x40, 0x52, 0x63, 0x6b, 0xd7, 0x01, 0xa1, 0xbf, 0x74, 0x8b, 0x90, 0xef, - 0x10, 0xa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a, 0x62, 0x25, 0x9e, 0x0c, 0x00, 0x00, + // 841 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4d, 0x4f, 0xdb, 0x4c, + 0x10, 0xce, 0x42, 0xe0, 0x25, 0x13, 0xf1, 0xb5, 0x90, 0x10, 0x1c, 0xde, 0x90, 0x77, 0xdf, 0x2f, + 0x24, 0xa4, 0xa4, 0x01, 0x95, 0x4b, 0x4f, 0x40, 0x2a, 0x91, 0x56, 0x6a, 0x53, 0xd3, 0x82, 0x40, + 0xad, 0x22, 0xc7, 0x5e, 0x1a, 0x2b, 0xc1, 0x0e, 0xfe, 0x92, 0xd2, 0x5b, 0x55, 0xf5, 0xd8, 0x7b, + 0xff, 0x43, 0xff, 0x45, 0x4f, 0x3d, 0xf6, 0xd8, 0x63, 0x45, 0xff, 0x47, 0x55, 0xc5, 0x76, 0x8c, + 0xd7, 0x59, 0x92, 0xb4, 0x44, 0xa2, 0x37, 0x67, 0x77, 0xe6, 0xd9, 0x67, 0x66, 0x67, 0x9f, 0x99, + 0x40, 0xba, 0xa3, 0x1b, 0x4d, 0x95, 0x16, 0x9d, 0x52, 0xd1, 0xfb, 0x2a, 0xb4, 0x0d, 0xdd, 0xd2, + 0x71, 0xc2, 0xff, 0xe5, 0x94, 0x84, 0xd5, 0x2b, 0x13, 0x83, 0x9a, 0xba, 0x6d, 0xc8, 0xd4, 0xf4, + 0xac, 0xc8, 0x0e, 0xa4, 0x76, 0x65, 0x4b, 0x75, 0x24, 0x8b, 0xee, 0xb7, 0x54, 0xaa, 0x59, 0x22, + 0xbd, 0xb0, 0xa9, 0x69, 0xe1, 0x3f, 0x01, 0x64, 0x77, 0xa1, 0xd6, 0xa4, 0x9d, 0x0c, 0xca, 0xa3, + 0x8d, 0x84, 0x98, 0xf0, 0x56, 0x1e, 0xd2, 0x0e, 0xb9, 0x0b, 0xe9, 0xa8, 0x9f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x7c, 0x00, 0x89, 0xa0, 0x3a, 0x71, 0x96, 0x57, 0xcc, 0x3d, 0xbc, 0x35, 0xfe, 0x66, 0xc0, + 0xf0, 0x39, 0xcc, 0x47, 0x34, 0x90, 0x89, 0x9e, 0xaf, 0xbb, 0x4c, 0xf4, 0xd7, 0x48, 0xa8, 0xcb, + 0x53, 0x06, 0xdc, 0xaf, 0x47, 0xf8, 0x9f, 0x90, 0xf7, 0xb5, 0x9a, 0x29, 0xfc, 0x3b, 0xc4, 0x2a, + 0x08, 0x41, 0x85, 0x65, 0x9e, 0x9c, 0xe0, 0xff, 0x42, 0x00, 0x03, 0x64, 0x4f, 0xf8, 0x7f, 0xa8, + 0x5d, 0xef, 0xa8, 0xbd, 0xcd, 0x4f, 0x97, 0x39, 0xf4, 0xf9, 0x32, 0x87, 0xbe, 0x5e, 0xe6, 0xd0, + 0xfb, 0x6f, 0xb9, 0x18, 0x2c, 0x2a, 0xd4, 0xe9, 0xf9, 0x4b, 0x6d, 0xb5, 0xe0, 0x94, 0xaa, 0xe8, + 0x34, 0x5e, 0xb8, 0xe7, 0x94, 0xea, 0xd3, 0xee, 0x9f, 0x91, 0xed, 0x1f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xab, 0xeb, 0xd8, 0xa8, 0xcc, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2615,6 +2632,13 @@ func (m *SubscribeBroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.SubID) > 0 { + i -= len(m.SubID) + copy(dAtA[i:], m.SubID) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.SubID))) + i-- + dAtA[i] = 0x22 + } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) @@ -2690,6 +2714,13 @@ func (m *UnsubscribeBroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, er i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.SubID) > 0 { + i -= len(m.SubID) + copy(dAtA[i:], m.SubID) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.SubID))) + i-- + dAtA[i] = 0x22 + } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) @@ -3189,6 +3220,10 @@ func (m *SubscribeBroadcastRequest) Size() (n int) { if l > 0 { n += 1 + l + sovYorkie(uint64(l)) } + l = len(m.SubID) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -3225,6 +3260,10 @@ func (m *UnsubscribeBroadcastRequest) Size() (n int) { if l > 0 { n += 1 + l + sovYorkie(uint64(l)) } + l = len(m.SubID) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -5223,6 +5262,38 @@ func (m *SubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubID", 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.SubID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -5421,6 +5492,38 @@ func (m *UnsubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubID", 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.SubID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) diff --git a/api/yorkie/v1/yorkie.proto b/api/yorkie/v1/yorkie.proto index 2d9690b3b..81c36149a 100644 --- a/api/yorkie/v1/yorkie.proto +++ b/api/yorkie/v1/yorkie.proto @@ -128,6 +128,7 @@ message SubscribeBroadcastRequest { string client_id = 1; string document_id = 2; string type = 3; + string subID = 4; } message SubscribeBroadcastResponse { @@ -137,6 +138,7 @@ message UnsubscribeBroadcastRequest { string client_id = 1; string document_id = 2; string type = 3; + string subID = 4; } message UnsubscribeBroadcastResponse { diff --git a/server/backend/sync/coordinator.go b/server/backend/sync/coordinator.go index deab2105c..40919ecf3 100644 --- a/server/backend/sync/coordinator.go +++ b/server/backend/sync/coordinator.go @@ -38,24 +38,59 @@ type Coordinator interface { NewLocker(ctx context.Context, key Key) (Locker, error) // Subscribe subscribes to the given documents. - Subscribe( + SubscribeDocEvent( ctx context.Context, subscriber *time.ActorID, documentID types.ID, - ) (*Subscription, []*time.ActorID, error) + ) (*Subscription[*DocEvent], []*time.ActorID, error) // Unsubscribe unsubscribes from the given documents. - Unsubscribe( + UnsubscribeDocEvent( ctx context.Context, documentID types.ID, - sub *Subscription, + sub *Subscription[*DocEvent], ) error // Publish publishes the given event. - Publish(ctx context.Context, publisherID *time.ActorID, event DocEvent) + PublishDocEvent( + ctx context.Context, + publisherID *time.ActorID, + event *DocEvent, + ) + + SubscribeBroadcasts( + ctx context.Context, + subscriber *time.ActorID, + documentID types.ID, + ) (*Subscription[*BroadcastEvent], error) + + UnsubscribeBroadcasts( + ctx context.Context, + documentID types.ID, + sub *Subscription[*BroadcastEvent], + ) error - // PublishToLocal publishes the given event. - PublishToLocal(ctx context.Context, publisherID *time.ActorID, event DocEvent) + SubscribeBroadcastEvent( + ctx context.Context, + documentID types.ID, + eventType types.EventType, + subID string, + ) + + UnsubscribeBroadcastEvent( + ctx context.Context, + documentID types.ID, + eventType types.EventType, + subID string, + ) + + PublishBroadcastEvent( + ctx context.Context, + documentID types.ID, + eventType types.EventType, + publisherID *time.ActorID, + event *BroadcastEvent, + ) // Members returns the members of this cluster. Members() map[string]*ServerInfo diff --git a/server/backend/sync/memory/coordinator.go b/server/backend/sync/memory/coordinator.go index 57b6ca909..287df2277 100644 --- a/server/backend/sync/memory/coordinator.go +++ b/server/backend/sync/memory/coordinator.go @@ -30,16 +30,18 @@ import ( type Coordinator struct { serverInfo *sync.ServerInfo - locks *locker.Locker - pubSub *PubSub + locks *locker.Locker + docPubSub *PubSub[*sync.DocEvent] + broadcastPubSub *PubSub[*sync.BroadcastEvent] } // NewCoordinator creates an instance of Coordinator. func NewCoordinator(serverInfo *sync.ServerInfo) *Coordinator { return &Coordinator{ - serverInfo: serverInfo, - locks: locker.New(), - pubSub: NewPubSub(), + serverInfo: serverInfo, + locks: locker.New(), + docPubSub: NewPubSub[*sync.DocEvent](), + broadcastPubSub: NewPubSub[*sync.BroadcastEvent](), } } @@ -55,46 +57,92 @@ func (c *Coordinator) NewLocker( } // Subscribe subscribes to the given documents. -func (c *Coordinator) Subscribe( +func (c *Coordinator) SubscribeDocEvent( ctx context.Context, subscriber *time.ActorID, documentID types.ID, -) (*sync.Subscription, []*time.ActorID, error) { - sub, err := c.pubSub.Subscribe(ctx, subscriber, documentID) +) (*sync.Subscription[*sync.DocEvent], []*time.ActorID, error) { + sub, err := c.docPubSub.SubscribeDoc(ctx, subscriber, documentID) if err != nil { return nil, nil, err } - ids := c.pubSub.ClientIDs(documentID) + c.docPubSub.SubscribeEvent(ctx, documentID, "document", sub.ID()) + + ids := c.docPubSub.ClientIDs(documentID) return sub, ids, nil } // Unsubscribe unsubscribes the given documents. -func (c *Coordinator) Unsubscribe( +func (c *Coordinator) UnsubscribeDocEvent( ctx context.Context, documentID types.ID, - sub *sync.Subscription, + sub *sync.Subscription[*sync.DocEvent], ) error { - c.pubSub.Unsubscribe(ctx, documentID, sub) + c.docPubSub.UnsubscribeDoc(ctx, documentID, sub) return nil } // Publish publishes the given event. -func (c *Coordinator) Publish( +func (c *Coordinator) PublishDocEvent( ctx context.Context, publisherID *time.ActorID, - event sync.DocEvent, + event *sync.DocEvent, ) { - c.pubSub.Publish(ctx, publisherID, event) + c.docPubSub.Publish(ctx, event.DocumentID, "document", publisherID, event) } -// PublishToLocal publishes the given event. -func (c *Coordinator) PublishToLocal( +// Subscribe subscribes to the given documents. +func (c *Coordinator) SubscribeBroadcasts( ctx context.Context, + subscriber *time.ActorID, + documentID types.ID, +) (*sync.Subscription[*sync.BroadcastEvent], error) { + sub, err := c.broadcastPubSub.SubscribeDoc(ctx, subscriber, documentID) + if err != nil { + return nil, err + } + + return sub, nil +} + +// Unsubscribe unsubscribes the given documents. +func (c *Coordinator) UnsubscribeBroadcasts( + ctx context.Context, + documentID types.ID, + sub *sync.Subscription[*sync.BroadcastEvent], +) error { + c.broadcastPubSub.UnsubscribeDoc(ctx, documentID, sub) + return nil +} + +func (c *Coordinator) SubscribeBroadcastEvent( + ctx context.Context, + documentID types.ID, + eventType types.EventType, + subID string, +) { + c.broadcastPubSub.SubscribeEvent(ctx, documentID, eventType, subID) +} + +func (c *Coordinator) UnsubscribeBroadcastEvent( + ctx context.Context, + documentID types.ID, + eventType types.EventType, + subID string, +) { + c.broadcastPubSub.UnsubscribeEvent(ctx, documentID, eventType, subID) +} + +// Publish publishes the given event. +func (c *Coordinator) PublishBroadcastEvent( + ctx context.Context, + documentID types.ID, + eventType types.EventType, publisherID *time.ActorID, - event sync.DocEvent, + event *sync.BroadcastEvent, ) { - c.pubSub.Publish(ctx, publisherID, event) + c.broadcastPubSub.Publish(ctx, documentID, eventType, publisherID, event) } // Members returns the members of this cluster. diff --git a/server/backend/sync/memory/coordinator_test.go b/server/backend/sync/memory/coordinator_test.go index 02e2e5ce4..3d487c911 100644 --- a/server/backend/sync/memory/coordinator_test.go +++ b/server/backend/sync/memory/coordinator_test.go @@ -37,7 +37,7 @@ func TestCoordinator(t *testing.T) { id, err := time.ActorIDFromBytes([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, byte(i)}) assert.NoError(t, err) - _, clientIDs, err := coordinator.Subscribe(ctx, id, docID) + _, clientIDs, err := coordinator.SubscribeDocEvent(ctx, id, docID) assert.NoError(t, err) assert.Len(t, clientIDs, i+1) } diff --git a/server/backend/sync/memory/pubsub.go b/server/backend/sync/memory/pubsub.go index d058dc85d..3572dca66 100644 --- a/server/backend/sync/memory/pubsub.go +++ b/server/backend/sync/memory/pubsub.go @@ -132,7 +132,7 @@ func (m *PubSub[E]) SubscribeDoc( ctx context.Context, subscriber *time.ActorID, documentID types.ID, -) (string, error) { +) (*sync.Subscription[E], error) { m.docSubsMapMu.Lock() defer m.docSubsMapMu.Unlock() @@ -158,14 +158,14 @@ func (m *PubSub[E]) SubscribeDoc( subscriber.String(), ) } - return sub.ID(), nil + return sub, nil } // Unwatch unsubscribes the given docKeys. func (m *PubSub[E]) UnsubscribeDoc( ctx context.Context, documentID types.ID, - subID string, + sub *sync.Subscription[E], ) { m.docSubsMapMu.Lock() defer m.docSubsMapMu.Unlock() @@ -175,11 +175,6 @@ func (m *PubSub[E]) UnsubscribeDoc( return } - sub, ok := docSubs.subMapBySubIDs[subID] - if !ok { - return - } - if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( `UnsubscribeDoc(%s,%s) Start`, @@ -188,7 +183,7 @@ func (m *PubSub[E]) UnsubscribeDoc( ) } - docSubs.Remove(subID) + docSubs.Remove(sub.ID()) if docSubs.Len() == 0 { delete(m.docSubsMapByDocID, documentID) @@ -340,7 +335,7 @@ func (m *PubSub[E]) Publish( } // ClientIDs returns the clients of the given document. -func (m *PubSub[E]) ClientIDs(documentID types.ID, eventType types.EventType) []*time.ActorID { +func (m *PubSub[E]) ClientIDs(documentID types.ID) []*time.ActorID { m.docSubsMapMu.RLock() defer m.docSubsMapMu.RUnlock() @@ -349,16 +344,9 @@ func (m *PubSub[E]) ClientIDs(documentID types.ID, eventType types.EventType) [] return nil } - subIDs, ok := docSubs.subIDsMapByEvent[eventType] - if !ok { - return nil - } - var ids []*time.ActorID - for subID := range subIDs { - if sub, ok := docSubs.subMapBySubIDs[subID]; ok { - ids = append(ids, sub.Subscriber()) - } + for _, sub := range docSubs.subMapBySubIDs { + ids = append(ids, sub.Subscriber()) } return ids diff --git a/server/backend/sync/memory/pubsub_test.go b/server/backend/sync/memory/pubsub_test.go index f1152bfcc..fc6ad759a 100644 --- a/server/backend/sync/memory/pubsub_test.go +++ b/server/backend/sync/memory/pubsub_test.go @@ -36,7 +36,7 @@ func TestPubSub(t *testing.T) { assert.NoError(t, err) t.Run("publish subscribe test", func(t *testing.T) { - pubSub := memory.NewPubSub() + pubSub := memory.NewPubSub[sync.DocEvent]() id := types.ID(t.Name() + "id") docEvent := sync.DocEvent{ Type: types.DocumentWatchedEvent, @@ -46,10 +46,14 @@ func TestPubSub(t *testing.T) { ctx := context.Background() // subscribe the documents by actorA - subA, err := pubSub.Subscribe(ctx, idA, id) + subA, err := pubSub.SubscribeDoc(ctx, idA, id) assert.NoError(t, err) + + // subscribe "document" type events + pubSub.SubscribeEvent(ctx, id, "document", subA.ID()) + defer func() { - pubSub.Unsubscribe(ctx, id, subA) + pubSub.UnsubscribeDoc(ctx, id, subA) }() var wg gosync.WaitGroup @@ -61,7 +65,7 @@ func TestPubSub(t *testing.T) { }() // publish the event to the documents by actorB - pubSub.Publish(ctx, idB, docEvent) + pubSub.Publish(ctx, id, "document", idB, docEvent) wg.Wait() }) } diff --git a/server/backend/sync/pubsub.go b/server/backend/sync/pubsub.go index 8292a744b..b9966659b 100644 --- a/server/backend/sync/pubsub.go +++ b/server/backend/sync/pubsub.go @@ -26,7 +26,6 @@ import ( // Subscription represents a subscription of a subscriber to documents. type Subscription[E Event] struct { id string - docID types.ID types []types.EventType subscriber *time.ActorID closed bool @@ -37,7 +36,6 @@ type Subscription[E Event] struct { func NewSubscription[E Event](docID types.ID, subscriber *time.ActorID) *Subscription[E] { return &Subscription[E]{ id: xid.New().String(), - docID: docID, types: make([]types.EventType, 0), subscriber: subscriber, events: make(chan E, 1), @@ -49,11 +47,6 @@ func (s *Subscription[E]) ID() string { return s.id } -// // DocID returns the doc id of this subscription. -// func (s *Subscription[E]) DocID() types.ID { -// return s.docID -// } - func (s *Subscription[E]) Types() []types.EventType { return s.types } @@ -63,13 +56,15 @@ func (s *Subscription[E]) AddType(t types.EventType) { } func (s *Subscription[E]) RemoveType(t types.EventType) { - var idx int + found := -1 for i, v := range s.types { if v == t { - idx = i + found = i } } - s.types = append(s.types[:idx], s.types[idx+1:]...) + if found != -1 { + s.types = append(s.types[:found], s.types[found+1:]...) + } } // Events returns the DocEvent channel of this subscription. @@ -105,32 +100,32 @@ type DocEvent struct { DocumentID types.ID } -func (e *DocEvent) TypeString() string { +func (e DocEvent) TypeString() string { return string(e.Type) } -func (e *DocEvent) PublisherString() string { +func (e DocEvent) PublisherString() string { return e.Publisher.String() } -func (e *DocEvent) PayloadString() string { +func (e DocEvent) PayloadString() string { return string(e.DocumentID) } type BroadcastEvent struct { - Type string + Type types.EventType Publisher *time.ActorID - Payload string + Payload []byte } -func (e *BroadcastEvent) TypeString() string { - return e.Type +func (e BroadcastEvent) TypeString() string { + return string(e.Type) } -func (e *BroadcastEvent) PublisherString() string { +func (e BroadcastEvent) PublisherString() string { return e.Publisher.String() } -func (e *BroadcastEvent) PayloadString() string { - return e.Payload +func (e BroadcastEvent) PayloadString() string { + return string(e.Payload) } diff --git a/server/packs/packs.go b/server/packs/packs.go index 180644891..551ccd1d5 100644 --- a/server/packs/packs.go +++ b/server/packs/packs.go @@ -128,10 +128,10 @@ func PushPull( return } - be.Coordinator.Publish( + be.Coordinator.PublishDocEvent( ctx, publisherID, - sync.DocEvent{ + &sync.DocEvent{ Type: types.DocumentChangedEvent, Publisher: publisherID, DocumentID: docInfo.ID, diff --git a/server/rpc/admin_server.go b/server/rpc/admin_server.go index 2e754ff25..a8ae2ba38 100644 --- a/server/rpc/admin_server.go +++ b/server/rpc/admin_server.go @@ -371,10 +371,10 @@ func (s *adminServer) RemoveDocumentByAdmin( // TODO(emplam27): Change the publisherID to the actual user ID. This is a temporary solution. publisherID := time.InitialActorID - s.backend.Coordinator.Publish( + s.backend.Coordinator.PublishDocEvent( ctx, publisherID, - sync.DocEvent{ + &sync.DocEvent{ Type: types.DocumentChangedEvent, Publisher: publisherID, DocumentID: docInfo.ID, diff --git a/server/rpc/yorkie_server.go b/server/rpc/yorkie_server.go index c0c2aef09..46d450df7 100644 --- a/server/rpc/yorkie_server.go +++ b/server/rpc/yorkie_server.go @@ -506,17 +506,17 @@ func (s *yorkieServer) watchDoc( ctx context.Context, clientID *time.ActorID, documentID types.ID, -) (*sync.Subscription, []*time.ActorID, error) { - subscription, clientIDs, err := s.backend.Coordinator.Subscribe(ctx, clientID, documentID) +) (*sync.Subscription[*sync.DocEvent], []*time.ActorID, error) { + subscription, clientIDs, err := s.backend.Coordinator.SubscribeDocEvent(ctx, clientID, documentID) if err != nil { logging.From(ctx).Error(err) return nil, nil, err } - s.backend.Coordinator.Publish( + s.backend.Coordinator.PublishDocEvent( ctx, subscription.Subscriber(), - sync.DocEvent{ + &sync.DocEvent{ Type: types.DocumentWatchedEvent, Publisher: subscription.Subscriber(), DocumentID: documentID, @@ -527,18 +527,214 @@ func (s *yorkieServer) watchDoc( } func (s *yorkieServer) unwatchDoc( - subscription *sync.Subscription, + subscription *sync.Subscription[*sync.DocEvent], documentID types.ID, ) { ctx := context.Background() - _ = s.backend.Coordinator.Unsubscribe(ctx, documentID, subscription) - s.backend.Coordinator.Publish( + _ = s.backend.Coordinator.UnsubscribeDocEvent(ctx, documentID, subscription) + s.backend.Coordinator.PublishDocEvent( ctx, subscription.Subscriber(), - sync.DocEvent{ + &sync.DocEvent{ Type: types.DocumentUnwatchedEvent, Publisher: subscription.Subscriber(), DocumentID: documentID, }, ) } + +func (s *yorkieServer) Broadcast( + ctx context.Context, + req *api.BroadcastRequest, +) (*api.BroadcastResponse, error) { + clientID, err := time.ActorIDFromHex(req.ClientId) + if err != nil { + return nil, err + } + + docID := types.ID(req.DocumentId) + if err := docID.Validate(); err != nil { + return nil, err + } + + docInfo, err := documents.FindDocInfo( + ctx, + s.backend, + projects.From(ctx), + docID, + ) + if err != nil { + return nil, err + } + + event, err := converter.FromBroadcastEvent(req.Event) + if err != nil { + return nil, err + } + + if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ + Method: types.Broadcast, + Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), + }); err != nil { + return nil, err + } + + project := projects.From(ctx) + if _, err = clients.FindClientInfo(ctx, s.backend.DB, project, clientID); err != nil { + return nil, err + } + + s.backend.Coordinator.PublishBroadcastEvent(ctx, docID, event.Type, event.Publisher, event) + + return &api.BroadcastResponse{}, nil +} + +func (s *yorkieServer) WatchBroadcasts( + req *api.WatchBroadcastsRequest, + stream api.YorkieService_WatchBroadcastsServer, +) error { + clientID, err := time.ActorIDFromHex(req.ClientId) + if err != nil { + return err + } + docID, err := converter.FromDocumentID(req.DocumentId) + if err != nil { + return err + } + + docInfo, err := documents.FindDocInfo( + stream.Context(), + s.backend, + projects.From(stream.Context()), + docID, + ) + if err != nil { + return nil + } + + if err := auth.VerifyAccess(stream.Context(), s.backend, &types.AccessInfo{ + Method: types.WatchBroadcasts, + Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), + }); err != nil { + return err + } + + project := projects.From(stream.Context()) + if _, err = clients.FindClientInfo(stream.Context(), s.backend.DB, project, clientID); err != nil { + return err + } + + subscription, err := s.backend.Coordinator.SubscribeBroadcasts(stream.Context(), clientID, docID) + if err != nil { + logging.From(stream.Context()).Error(err) + return err + } + + defer func() { + _ = s.backend.Coordinator.UnsubscribeBroadcasts(stream.Context(), docID, subscription) + }() + + for { + select { + case <-s.serviceCtx.Done(): + return nil + case <-stream.Context().Done(): + return nil + case event := <-subscription.Events(): + pbEvent := converter.ToBroadcastEvent(event) + if err != nil { + return err + } + + if err := stream.Send(&api.WatchBroadcastsResponse{ + Event: pbEvent, + }); err != nil { + return err + } + } + } +} + +func (s *yorkieServer) SubscribeBroadcast( + ctx context.Context, + req *api.SubscribeBroadcastRequest, +) (*api.SubscribeBroadcastResponse, error) { + clientID, err := time.ActorIDFromHex(req.ClientId) + if err != nil { + return nil, err + } + docID, err := converter.FromDocumentID(req.DocumentId) + if err != nil { + return nil, err + } + + docInfo, err := documents.FindDocInfo( + ctx, + s.backend, + projects.From(ctx), + docID, + ) + if err != nil { + return nil, nil + } + + eventType := types.EventType(req.Type) + + if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ + Method: types.WatchBroadcasts, + Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), + }); err != nil { + return nil, err + } + + project := projects.From(ctx) + if _, err = clients.FindClientInfo(ctx, s.backend.DB, project, clientID); err != nil { + return nil, err + } + + s.backend.Coordinator.SubscribeBroadcastEvent(ctx, docID, eventType, req.SubID) + + return &api.SubscribeBroadcastResponse{}, nil +} + +func (s *yorkieServer) UnsubscribeBroadcast( + ctx context.Context, + req *api.UnsubscribeBroadcastRequest, +) (*api.UnsubscribeBroadcastResponse, error) { + clientID, err := time.ActorIDFromHex(req.ClientId) + if err != nil { + return nil, err + } + docID, err := converter.FromDocumentID(req.DocumentId) + if err != nil { + return nil, err + } + + docInfo, err := documents.FindDocInfo( + ctx, + s.backend, + projects.From(ctx), + docID, + ) + if err != nil { + return nil, nil + } + + eventType := types.EventType(req.Type) + + if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ + Method: types.WatchBroadcasts, + Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), + }); err != nil { + return nil, err + } + + project := projects.From(ctx) + if _, err = clients.FindClientInfo(ctx, s.backend.DB, project, clientID); err != nil { + return nil, err + } + + s.backend.Coordinator.UnsubscribeBroadcastEvent(ctx, docID, eventType, req.SubID) + + return &api.UnsubscribeBroadcastResponse{}, nil +} From 6ab323f485f946ff7066d798cd01a00b6c158e35 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 10:58:39 +0900 Subject: [PATCH 05/24] Use event value instead of reference --- api/converter/from_pb.go | 10 +++++----- api/converter/to_pb.go | 9 --------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/api/converter/from_pb.go b/api/converter/from_pb.go index acc0987d0..9f0d9be9d 100644 --- a/api/converter/from_pb.go +++ b/api/converter/from_pb.go @@ -29,7 +29,6 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/operations" "github.com/yorkie-team/yorkie/pkg/document/time" - "github.com/yorkie-team/yorkie/server/backend/sync" ) // FromUser converts the given Protobuf formats to model format. @@ -858,13 +857,14 @@ func FromUpdatableProjectFields(pbProjectFields *api.UpdatableProjectFields) (*t return updatableProjectFields, nil } -func FromBroadcastEvent(event *api.BroadcastEvent) (*sync.BroadcastEvent, error) { +// FromBroadcastEvent converts the given Protobuf event to types.BroadcastEvent. +func FromBroadcastEvent(event *api.BroadcastEvent) (types.BroadcastEvent, error) { publisher, err := time.ActorIDFromHex(event.Publisher) if err != nil { - return nil, err + return types.BroadcastEvent{}, err } - return &sync.BroadcastEvent{ - Type: types.EventType(event.Type), + return types.BroadcastEvent{ + Type: event.Type, Publisher: publisher, Payload: event.Payload, }, nil diff --git a/api/converter/to_pb.go b/api/converter/to_pb.go index ce63a70b0..1b1206203 100644 --- a/api/converter/to_pb.go +++ b/api/converter/to_pb.go @@ -29,7 +29,6 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/innerpresence" "github.com/yorkie-team/yorkie/pkg/document/operations" "github.com/yorkie-team/yorkie/pkg/document/time" - "github.com/yorkie-team/yorkie/server/backend/sync" ) // ToUser converts the given model format to Protobuf format. @@ -537,11 +536,3 @@ func ToUpdatableProjectFields(fields *types.UpdatableProjectFields) (*api.Updata } return pbUpdatableProjectFields, nil } - -func ToBroadcastEvent(event *sync.BroadcastEvent) *api.BroadcastEvent { - return &api.BroadcastEvent{ - Type: event.TypeString(), - Publisher: event.PublisherString(), - Payload: event.Payload, - } -} From 6f8299182696d35156f7688bc1cf6ddf000c1e3b Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 10:59:24 +0900 Subject: [PATCH 06/24] Add broadcast api to auth webhook methods --- api/types/auth_webhook.go | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/api/types/auth_webhook.go b/api/types/auth_webhook.go index e348a0db6..deb643c42 100644 --- a/api/types/auth_webhook.go +++ b/api/types/auth_webhook.go @@ -50,17 +50,16 @@ type Method string // Belows are the names of RPCs. const ( - ActivateClient Method = "ActivateClient" - DeactivateClient Method = "DeactivateClient" - AttachDocument Method = "AttachDocument" - DetachDocument Method = "DetachDocument" - RemoveDocument Method = "RemoveDocument" - PushPull Method = "PushPull" - WatchDocuments Method = "WatchDocuments" - Broadcast Method = "Broadcast" - WatchBroadcasts Method = "WatchBroadcasts" - SubscribeBroadcast Method = "SubscribeBroadcast" - UnsubscribeBroadcast Method = "UnsubscribeBroadcast" + ActivateClient Method = "ActivateClient" + DeactivateClient Method = "DeactivateClient" + AttachDocument Method = "AttachDocument" + DetachDocument Method = "DetachDocument" + RemoveDocument Method = "RemoveDocument" + PushPull Method = "PushPull" + WatchDocuments Method = "WatchDocuments" + Broadcast Method = "Broadcast" + SubscribeBroadcastEvent Method = "SubscribeBroadcastEvent" + UnsubscribeBroadcastEvent Method = "UnsubscribeBroadcastEvent" ) // IsAuthMethod returns whether the given method can be used for authorization. @@ -84,9 +83,8 @@ func AuthMethods() []Method { PushPull, WatchDocuments, Broadcast, - WatchBroadcasts, - SubscribeBroadcast, - UnsubscribeBroadcast, + SubscribeBroadcastEvent, + UnsubscribeBroadcastEvent, } } From 329b3b46a75e16951787e602c2a07d8c0da1f7a7 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 11:06:37 +0900 Subject: [PATCH 07/24] Change pubsub to handle multiple general events --- api/types/event.go | 16 + api/yorkie/v1/yorkie.pb.go | 1072 +++++------------ api/yorkie/v1/yorkie.proto | 27 +- server/backend/sync/coordinator.go | 34 +- server/backend/sync/memory/coordinator.go | 84 +- .../backend/sync/memory/coordinator_test.go | 2 +- server/backend/sync/memory/pubsub.go | 167 +-- server/backend/sync/memory/pubsub_test.go | 7 +- server/backend/sync/pubsub.go | 78 +- 9 files changed, 461 insertions(+), 1026 deletions(-) diff --git a/api/types/event.go b/api/types/event.go index dc4a2baba..394614781 100644 --- a/api/types/event.go +++ b/api/types/event.go @@ -1,5 +1,21 @@ package types +import "github.com/yorkie-team/yorkie/pkg/document/time" + +// DocEvent represents events that occur related to the document. +type DocEvent struct { + Type DocEventType + Publisher *time.ActorID + DocumentID ID +} + +// BroadcastEvent represents events that are delievered to subscribers. +type BroadcastEvent struct { + Type string + Publisher *time.ActorID + Payload []byte +} + // DocEventType represents the event that the Server delivers to the client. type DocEventType string diff --git a/api/yorkie/v1/yorkie.pb.go b/api/yorkie/v1/yorkie.pb.go index c367a4265..8a330a9d2 100644 --- a/api/yorkie/v1/yorkie.pb.go +++ b/api/yorkie/v1/yorkie.pb.go @@ -492,7 +492,8 @@ func (m *WatchDocumentRequest) GetDocumentId() string { type WatchDocumentResponse struct { // Types that are valid to be assigned to Body: // *WatchDocumentResponse_Initialization_ - // *WatchDocumentResponse_Event + // *WatchDocumentResponse_DocEvent + // *WatchDocumentResponse_BroadcastEvent Body isWatchDocumentResponse_Body `protobuf_oneof:"body"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -541,12 +542,16 @@ type isWatchDocumentResponse_Body interface { type WatchDocumentResponse_Initialization_ struct { Initialization *WatchDocumentResponse_Initialization `protobuf:"bytes,1,opt,name=initialization,proto3,oneof" json:"initialization,omitempty"` } -type WatchDocumentResponse_Event struct { - Event *DocEvent `protobuf:"bytes,2,opt,name=event,proto3,oneof" json:"event,omitempty"` +type WatchDocumentResponse_DocEvent struct { + DocEvent *DocEvent `protobuf:"bytes,2,opt,name=doc_event,json=docEvent,proto3,oneof" json:"doc_event,omitempty"` +} +type WatchDocumentResponse_BroadcastEvent struct { + BroadcastEvent *BroadcastEvent `protobuf:"bytes,3,opt,name=broadcast_event,json=broadcastEvent,proto3,oneof" json:"broadcast_event,omitempty"` } func (*WatchDocumentResponse_Initialization_) isWatchDocumentResponse_Body() {} -func (*WatchDocumentResponse_Event) isWatchDocumentResponse_Body() {} +func (*WatchDocumentResponse_DocEvent) isWatchDocumentResponse_Body() {} +func (*WatchDocumentResponse_BroadcastEvent) isWatchDocumentResponse_Body() {} func (m *WatchDocumentResponse) GetBody() isWatchDocumentResponse_Body { if m != nil { @@ -562,9 +567,16 @@ func (m *WatchDocumentResponse) GetInitialization() *WatchDocumentResponse_Initi return nil } -func (m *WatchDocumentResponse) GetEvent() *DocEvent { - if x, ok := m.GetBody().(*WatchDocumentResponse_Event); ok { - return x.Event +func (m *WatchDocumentResponse) GetDocEvent() *DocEvent { + if x, ok := m.GetBody().(*WatchDocumentResponse_DocEvent); ok { + return x.DocEvent + } + return nil +} + +func (m *WatchDocumentResponse) GetBroadcastEvent() *BroadcastEvent { + if x, ok := m.GetBody().(*WatchDocumentResponse_BroadcastEvent); ok { + return x.BroadcastEvent } return nil } @@ -573,7 +585,8 @@ func (m *WatchDocumentResponse) GetEvent() *DocEvent { func (*WatchDocumentResponse) XXX_OneofWrappers() []interface{} { return []interface{}{ (*WatchDocumentResponse_Initialization_)(nil), - (*WatchDocumentResponse_Event)(nil), + (*WatchDocumentResponse_DocEvent)(nil), + (*WatchDocumentResponse_BroadcastEvent)(nil), } } @@ -852,130 +865,27 @@ func (m *PushPullChangesResponse) GetChangePack() *ChangePack { return nil } -type WatchBroadcastsRequest struct { - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WatchBroadcastsRequest) Reset() { *m = WatchBroadcastsRequest{} } -func (m *WatchBroadcastsRequest) String() string { return proto.CompactTextString(m) } -func (*WatchBroadcastsRequest) ProtoMessage() {} -func (*WatchBroadcastsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{14} -} -func (m *WatchBroadcastsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchBroadcastsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchBroadcastsRequest.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 *WatchBroadcastsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchBroadcastsRequest.Merge(m, src) -} -func (m *WatchBroadcastsRequest) XXX_Size() int { - return m.Size() -} -func (m *WatchBroadcastsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WatchBroadcastsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchBroadcastsRequest proto.InternalMessageInfo - -func (m *WatchBroadcastsRequest) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" -} - -func (m *WatchBroadcastsRequest) GetDocumentId() string { - if m != nil { - return m.DocumentId - } - return "" -} - -type WatchBroadcastsResponse struct { - Event *BroadcastEvent `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WatchBroadcastsResponse) Reset() { *m = WatchBroadcastsResponse{} } -func (m *WatchBroadcastsResponse) String() string { return proto.CompactTextString(m) } -func (*WatchBroadcastsResponse) ProtoMessage() {} -func (*WatchBroadcastsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{15} -} -func (m *WatchBroadcastsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchBroadcastsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchBroadcastsResponse.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 *WatchBroadcastsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchBroadcastsResponse.Merge(m, src) -} -func (m *WatchBroadcastsResponse) XXX_Size() int { - return m.Size() -} -func (m *WatchBroadcastsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_WatchBroadcastsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchBroadcastsResponse proto.InternalMessageInfo - -func (m *WatchBroadcastsResponse) GetEvent() *BroadcastEvent { - if m != nil { - return m.Event - } - return nil -} - -type SubscribeBroadcastRequest struct { +type SubscribeBroadcastEventRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - SubID string `protobuf:"bytes,4,opt,name=subID,proto3" json:"subID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *SubscribeBroadcastRequest) Reset() { *m = SubscribeBroadcastRequest{} } -func (m *SubscribeBroadcastRequest) String() string { return proto.CompactTextString(m) } -func (*SubscribeBroadcastRequest) ProtoMessage() {} -func (*SubscribeBroadcastRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{16} +func (m *SubscribeBroadcastEventRequest) Reset() { *m = SubscribeBroadcastEventRequest{} } +func (m *SubscribeBroadcastEventRequest) String() string { return proto.CompactTextString(m) } +func (*SubscribeBroadcastEventRequest) ProtoMessage() {} +func (*SubscribeBroadcastEventRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{14} } -func (m *SubscribeBroadcastRequest) XXX_Unmarshal(b []byte) error { +func (m *SubscribeBroadcastEventRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SubscribeBroadcastRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SubscribeBroadcastEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SubscribeBroadcastRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_SubscribeBroadcastEventRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -985,64 +895,57 @@ func (m *SubscribeBroadcastRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *SubscribeBroadcastRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscribeBroadcastRequest.Merge(m, src) +func (m *SubscribeBroadcastEventRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubscribeBroadcastEventRequest.Merge(m, src) } -func (m *SubscribeBroadcastRequest) XXX_Size() int { +func (m *SubscribeBroadcastEventRequest) XXX_Size() int { return m.Size() } -func (m *SubscribeBroadcastRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SubscribeBroadcastRequest.DiscardUnknown(m) +func (m *SubscribeBroadcastEventRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SubscribeBroadcastEventRequest.DiscardUnknown(m) } -var xxx_messageInfo_SubscribeBroadcastRequest proto.InternalMessageInfo +var xxx_messageInfo_SubscribeBroadcastEventRequest proto.InternalMessageInfo -func (m *SubscribeBroadcastRequest) GetClientId() string { +func (m *SubscribeBroadcastEventRequest) GetClientId() string { if m != nil { return m.ClientId } return "" } -func (m *SubscribeBroadcastRequest) GetDocumentId() string { +func (m *SubscribeBroadcastEventRequest) GetDocumentId() string { if m != nil { return m.DocumentId } return "" } -func (m *SubscribeBroadcastRequest) GetType() string { +func (m *SubscribeBroadcastEventRequest) GetType() string { if m != nil { return m.Type } return "" } -func (m *SubscribeBroadcastRequest) GetSubID() string { - if m != nil { - return m.SubID - } - return "" -} - -type SubscribeBroadcastResponse struct { +type SubscribeBroadcastEventResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *SubscribeBroadcastResponse) Reset() { *m = SubscribeBroadcastResponse{} } -func (m *SubscribeBroadcastResponse) String() string { return proto.CompactTextString(m) } -func (*SubscribeBroadcastResponse) ProtoMessage() {} -func (*SubscribeBroadcastResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{17} +func (m *SubscribeBroadcastEventResponse) Reset() { *m = SubscribeBroadcastEventResponse{} } +func (m *SubscribeBroadcastEventResponse) String() string { return proto.CompactTextString(m) } +func (*SubscribeBroadcastEventResponse) ProtoMessage() {} +func (*SubscribeBroadcastEventResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{15} } -func (m *SubscribeBroadcastResponse) XXX_Unmarshal(b []byte) error { +func (m *SubscribeBroadcastEventResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SubscribeBroadcastResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SubscribeBroadcastEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SubscribeBroadcastResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_SubscribeBroadcastEventResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1052,40 +955,39 @@ func (m *SubscribeBroadcastResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *SubscribeBroadcastResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscribeBroadcastResponse.Merge(m, src) +func (m *SubscribeBroadcastEventResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubscribeBroadcastEventResponse.Merge(m, src) } -func (m *SubscribeBroadcastResponse) XXX_Size() int { +func (m *SubscribeBroadcastEventResponse) XXX_Size() int { return m.Size() } -func (m *SubscribeBroadcastResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SubscribeBroadcastResponse.DiscardUnknown(m) +func (m *SubscribeBroadcastEventResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SubscribeBroadcastEventResponse.DiscardUnknown(m) } -var xxx_messageInfo_SubscribeBroadcastResponse proto.InternalMessageInfo +var xxx_messageInfo_SubscribeBroadcastEventResponse proto.InternalMessageInfo -type UnsubscribeBroadcastRequest struct { +type UnsubscribeBroadcastEventRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - SubID string `protobuf:"bytes,4,opt,name=subID,proto3" json:"subID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *UnsubscribeBroadcastRequest) Reset() { *m = UnsubscribeBroadcastRequest{} } -func (m *UnsubscribeBroadcastRequest) String() string { return proto.CompactTextString(m) } -func (*UnsubscribeBroadcastRequest) ProtoMessage() {} -func (*UnsubscribeBroadcastRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{18} +func (m *UnsubscribeBroadcastEventRequest) Reset() { *m = UnsubscribeBroadcastEventRequest{} } +func (m *UnsubscribeBroadcastEventRequest) String() string { return proto.CompactTextString(m) } +func (*UnsubscribeBroadcastEventRequest) ProtoMessage() {} +func (*UnsubscribeBroadcastEventRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{16} } -func (m *UnsubscribeBroadcastRequest) XXX_Unmarshal(b []byte) error { +func (m *UnsubscribeBroadcastEventRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *UnsubscribeBroadcastRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *UnsubscribeBroadcastEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_UnsubscribeBroadcastRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_UnsubscribeBroadcastEventRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1095,64 +997,57 @@ func (m *UnsubscribeBroadcastRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *UnsubscribeBroadcastRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnsubscribeBroadcastRequest.Merge(m, src) +func (m *UnsubscribeBroadcastEventRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnsubscribeBroadcastEventRequest.Merge(m, src) } -func (m *UnsubscribeBroadcastRequest) XXX_Size() int { +func (m *UnsubscribeBroadcastEventRequest) XXX_Size() int { return m.Size() } -func (m *UnsubscribeBroadcastRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UnsubscribeBroadcastRequest.DiscardUnknown(m) +func (m *UnsubscribeBroadcastEventRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UnsubscribeBroadcastEventRequest.DiscardUnknown(m) } -var xxx_messageInfo_UnsubscribeBroadcastRequest proto.InternalMessageInfo +var xxx_messageInfo_UnsubscribeBroadcastEventRequest proto.InternalMessageInfo -func (m *UnsubscribeBroadcastRequest) GetClientId() string { +func (m *UnsubscribeBroadcastEventRequest) GetClientId() string { if m != nil { return m.ClientId } return "" } -func (m *UnsubscribeBroadcastRequest) GetDocumentId() string { +func (m *UnsubscribeBroadcastEventRequest) GetDocumentId() string { if m != nil { return m.DocumentId } return "" } -func (m *UnsubscribeBroadcastRequest) GetType() string { +func (m *UnsubscribeBroadcastEventRequest) GetType() string { if m != nil { return m.Type } return "" } -func (m *UnsubscribeBroadcastRequest) GetSubID() string { - if m != nil { - return m.SubID - } - return "" -} - -type UnsubscribeBroadcastResponse struct { +type UnsubscribeBroadcastEventResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *UnsubscribeBroadcastResponse) Reset() { *m = UnsubscribeBroadcastResponse{} } -func (m *UnsubscribeBroadcastResponse) String() string { return proto.CompactTextString(m) } -func (*UnsubscribeBroadcastResponse) ProtoMessage() {} -func (*UnsubscribeBroadcastResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{19} +func (m *UnsubscribeBroadcastEventResponse) Reset() { *m = UnsubscribeBroadcastEventResponse{} } +func (m *UnsubscribeBroadcastEventResponse) String() string { return proto.CompactTextString(m) } +func (*UnsubscribeBroadcastEventResponse) ProtoMessage() {} +func (*UnsubscribeBroadcastEventResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40070c858814ab24, []int{17} } -func (m *UnsubscribeBroadcastResponse) XXX_Unmarshal(b []byte) error { +func (m *UnsubscribeBroadcastEventResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *UnsubscribeBroadcastResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *UnsubscribeBroadcastEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_UnsubscribeBroadcastResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_UnsubscribeBroadcastEventResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1162,17 +1057,17 @@ func (m *UnsubscribeBroadcastResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *UnsubscribeBroadcastResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnsubscribeBroadcastResponse.Merge(m, src) +func (m *UnsubscribeBroadcastEventResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnsubscribeBroadcastEventResponse.Merge(m, src) } -func (m *UnsubscribeBroadcastResponse) XXX_Size() int { +func (m *UnsubscribeBroadcastEventResponse) XXX_Size() int { return m.Size() } -func (m *UnsubscribeBroadcastResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UnsubscribeBroadcastResponse.DiscardUnknown(m) +func (m *UnsubscribeBroadcastEventResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UnsubscribeBroadcastEventResponse.DiscardUnknown(m) } -var xxx_messageInfo_UnsubscribeBroadcastResponse proto.InternalMessageInfo +var xxx_messageInfo_UnsubscribeBroadcastEventResponse proto.InternalMessageInfo type BroadcastRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` @@ -1187,7 +1082,7 @@ func (m *BroadcastRequest) Reset() { *m = BroadcastRequest{} } func (m *BroadcastRequest) String() string { return proto.CompactTextString(m) } func (*BroadcastRequest) ProtoMessage() {} func (*BroadcastRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{20} + return fileDescriptor_40070c858814ab24, []int{18} } func (m *BroadcastRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1247,7 +1142,7 @@ func (m *BroadcastResponse) Reset() { *m = BroadcastResponse{} } func (m *BroadcastResponse) String() string { return proto.CompactTextString(m) } func (*BroadcastResponse) ProtoMessage() {} func (*BroadcastResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{21} + return fileDescriptor_40070c858814ab24, []int{19} } func (m *BroadcastResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1292,12 +1187,10 @@ func init() { proto.RegisterType((*RemoveDocumentResponse)(nil), "yorkie.v1.RemoveDocumentResponse") proto.RegisterType((*PushPullChangesRequest)(nil), "yorkie.v1.PushPullChangesRequest") proto.RegisterType((*PushPullChangesResponse)(nil), "yorkie.v1.PushPullChangesResponse") - proto.RegisterType((*WatchBroadcastsRequest)(nil), "yorkie.v1.WatchBroadcastsRequest") - proto.RegisterType((*WatchBroadcastsResponse)(nil), "yorkie.v1.WatchBroadcastsResponse") - proto.RegisterType((*SubscribeBroadcastRequest)(nil), "yorkie.v1.SubscribeBroadcastRequest") - proto.RegisterType((*SubscribeBroadcastResponse)(nil), "yorkie.v1.SubscribeBroadcastResponse") - proto.RegisterType((*UnsubscribeBroadcastRequest)(nil), "yorkie.v1.UnsubscribeBroadcastRequest") - proto.RegisterType((*UnsubscribeBroadcastResponse)(nil), "yorkie.v1.UnsubscribeBroadcastResponse") + proto.RegisterType((*SubscribeBroadcastEventRequest)(nil), "yorkie.v1.SubscribeBroadcastEventRequest") + proto.RegisterType((*SubscribeBroadcastEventResponse)(nil), "yorkie.v1.SubscribeBroadcastEventResponse") + proto.RegisterType((*UnsubscribeBroadcastEventRequest)(nil), "yorkie.v1.UnsubscribeBroadcastEventRequest") + proto.RegisterType((*UnsubscribeBroadcastEventResponse)(nil), "yorkie.v1.UnsubscribeBroadcastEventResponse") proto.RegisterType((*BroadcastRequest)(nil), "yorkie.v1.BroadcastRequest") proto.RegisterType((*BroadcastResponse)(nil), "yorkie.v1.BroadcastResponse") } @@ -1305,60 +1198,58 @@ func init() { func init() { proto.RegisterFile("yorkie/v1/yorkie.proto", fileDescriptor_40070c858814ab24) } var fileDescriptor_40070c858814ab24 = []byte{ - // 841 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4d, 0x4f, 0xdb, 0x4c, - 0x10, 0xce, 0x42, 0xe0, 0x25, 0x13, 0xf1, 0xb5, 0x90, 0x10, 0x1c, 0xde, 0x90, 0x77, 0xdf, 0x2f, - 0x24, 0xa4, 0xa4, 0x01, 0x95, 0x4b, 0x4f, 0x40, 0x2a, 0x91, 0x56, 0x6a, 0x53, 0xd3, 0x82, 0x40, - 0xad, 0x22, 0xc7, 0x5e, 0x1a, 0x2b, 0xc1, 0x0e, 0xfe, 0x92, 0xd2, 0x5b, 0x55, 0xf5, 0xd8, 0x7b, - 0xff, 0x43, 0xff, 0x45, 0x4f, 0x3d, 0xf6, 0xd8, 0x63, 0x45, 0xff, 0x47, 0x55, 0xc5, 0x76, 0x8c, - 0xd7, 0x59, 0x92, 0xb4, 0x44, 0xa2, 0x37, 0x67, 0x77, 0xe6, 0xd9, 0x67, 0x66, 0x67, 0x9f, 0x99, - 0x40, 0xba, 0xa3, 0x1b, 0x4d, 0x95, 0x16, 0x9d, 0x52, 0xd1, 0xfb, 0x2a, 0xb4, 0x0d, 0xdd, 0xd2, - 0x71, 0xc2, 0xff, 0xe5, 0x94, 0x84, 0xd5, 0x2b, 0x13, 0x83, 0x9a, 0xba, 0x6d, 0xc8, 0xd4, 0xf4, - 0xac, 0xc8, 0x0e, 0xa4, 0x76, 0x65, 0x4b, 0x75, 0x24, 0x8b, 0xee, 0xb7, 0x54, 0xaa, 0x59, 0x22, - 0xbd, 0xb0, 0xa9, 0x69, 0xe1, 0x3f, 0x01, 0x64, 0x77, 0xa1, 0xd6, 0xa4, 0x9d, 0x0c, 0xca, 0xa3, - 0x8d, 0x84, 0x98, 0xf0, 0x56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, 0xb8, 0xf9, 0x61, 0x7d, 0x97, 0xc4, 0xee, - 0x20, 0x7c, 0x00, 0x89, 0xa0, 0x3a, 0x71, 0x96, 0x57, 0xcc, 0x3d, 0xbc, 0x35, 0xfe, 0x66, 0xc0, - 0xf0, 0x39, 0xcc, 0x47, 0x34, 0x90, 0x89, 0x9e, 0xaf, 0xbb, 0x4c, 0xf4, 0xd7, 0x48, 0xa8, 0xcb, - 0x53, 0x06, 0xdc, 0xaf, 0x47, 0xf8, 0x9f, 0x90, 0xf7, 0xb5, 0x9a, 0x29, 0xfc, 0x3b, 0xc4, 0x2a, - 0x08, 0x41, 0x85, 0x65, 0x9e, 0x9c, 0xe0, 0xff, 0x42, 0x00, 0x03, 0x64, 0x4f, 0xf8, 0x7f, 0xa8, - 0x5d, 0xef, 0xa8, 0xbd, 0xcd, 0x4f, 0x97, 0x39, 0xf4, 0xf9, 0x32, 0x87, 0xbe, 0x5e, 0xe6, 0xd0, - 0xfb, 0x6f, 0xb9, 0x18, 0x2c, 0x2a, 0xd4, 0xe9, 0xf9, 0x4b, 0x6d, 0xb5, 0xe0, 0x94, 0xaa, 0xe8, - 0x34, 0x5e, 0xb8, 0xe7, 0x94, 0xea, 0xd3, 0xee, 0x9f, 0x91, 0xed, 0x1f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xab, 0xeb, 0xd8, 0xa8, 0xcc, 0x0c, 0x00, 0x00, + // 810 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x4f, 0xdb, 0x48, + 0x14, 0x8f, 0x21, 0xcb, 0x26, 0x2f, 0x22, 0xc0, 0xb0, 0x09, 0xc1, 0xec, 0x86, 0x30, 0x5c, 0xd8, + 0x65, 0x95, 0x6c, 0x82, 0x96, 0xcb, 0x9e, 0x80, 0xac, 0x44, 0x54, 0xa9, 0x4d, 0x4d, 0x5b, 0x04, + 0x52, 0x65, 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0x2c, 0xbb, 0xd5, 0xa6, + 0x74, 0x9a, 0x2c, 0xff, 0xe7, 0x56, 0x5b, 0x73, 0xde, 0xdb, 0x7e, 0xe7, 0x4b, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x2d, 0x96, 0xd2, 0x36, 0x1b, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1381,9 +1272,8 @@ type YorkieServiceClient interface { PushPullChanges(ctx context.Context, in *PushPullChangesRequest, opts ...grpc.CallOption) (*PushPullChangesResponse, error) WatchDocument(ctx context.Context, in *WatchDocumentRequest, opts ...grpc.CallOption) (YorkieService_WatchDocumentClient, error) Broadcast(ctx context.Context, in *BroadcastRequest, opts ...grpc.CallOption) (*BroadcastResponse, error) - WatchBroadcasts(ctx context.Context, in *WatchBroadcastsRequest, opts ...grpc.CallOption) (YorkieService_WatchBroadcastsClient, error) - SubscribeBroadcast(ctx context.Context, in *SubscribeBroadcastRequest, opts ...grpc.CallOption) (*SubscribeBroadcastResponse, error) - UnsubscribeBroadcast(ctx context.Context, in *UnsubscribeBroadcastRequest, opts ...grpc.CallOption) (*UnsubscribeBroadcastResponse, error) + SubscribeBroadcastEvent(ctx context.Context, in *SubscribeBroadcastEventRequest, opts ...grpc.CallOption) (*SubscribeBroadcastEventResponse, error) + UnsubscribeBroadcastEvent(ctx context.Context, in *UnsubscribeBroadcastEventRequest, opts ...grpc.CallOption) (*UnsubscribeBroadcastEventResponse, error) } type yorkieServiceClient struct { @@ -1489,50 +1379,18 @@ func (c *yorkieServiceClient) Broadcast(ctx context.Context, in *BroadcastReques return out, nil } -func (c *yorkieServiceClient) WatchBroadcasts(ctx context.Context, in *WatchBroadcastsRequest, opts ...grpc.CallOption) (YorkieService_WatchBroadcastsClient, error) { - stream, err := c.cc.NewStream(ctx, &_YorkieService_serviceDesc.Streams[1], "/yorkie.v1.YorkieService/WatchBroadcasts", opts...) - if err != nil { - return nil, err - } - x := &yorkieServiceWatchBroadcastsClient{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 YorkieService_WatchBroadcastsClient interface { - Recv() (*WatchBroadcastsResponse, error) - grpc.ClientStream -} - -type yorkieServiceWatchBroadcastsClient struct { - grpc.ClientStream -} - -func (x *yorkieServiceWatchBroadcastsClient) Recv() (*WatchBroadcastsResponse, error) { - m := new(WatchBroadcastsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *yorkieServiceClient) SubscribeBroadcast(ctx context.Context, in *SubscribeBroadcastRequest, opts ...grpc.CallOption) (*SubscribeBroadcastResponse, error) { - out := new(SubscribeBroadcastResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/SubscribeBroadcast", in, out, opts...) +func (c *yorkieServiceClient) SubscribeBroadcastEvent(ctx context.Context, in *SubscribeBroadcastEventRequest, opts ...grpc.CallOption) (*SubscribeBroadcastEventResponse, error) { + out := new(SubscribeBroadcastEventResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/SubscribeBroadcastEvent", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *yorkieServiceClient) UnsubscribeBroadcast(ctx context.Context, in *UnsubscribeBroadcastRequest, opts ...grpc.CallOption) (*UnsubscribeBroadcastResponse, error) { - out := new(UnsubscribeBroadcastResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/UnsubscribeBroadcast", in, out, opts...) +func (c *yorkieServiceClient) UnsubscribeBroadcastEvent(ctx context.Context, in *UnsubscribeBroadcastEventRequest, opts ...grpc.CallOption) (*UnsubscribeBroadcastEventResponse, error) { + out := new(UnsubscribeBroadcastEventResponse) + err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/UnsubscribeBroadcastEvent", in, out, opts...) if err != nil { return nil, err } @@ -1549,9 +1407,8 @@ type YorkieServiceServer interface { PushPullChanges(context.Context, *PushPullChangesRequest) (*PushPullChangesResponse, error) WatchDocument(*WatchDocumentRequest, YorkieService_WatchDocumentServer) error Broadcast(context.Context, *BroadcastRequest) (*BroadcastResponse, error) - WatchBroadcasts(*WatchBroadcastsRequest, YorkieService_WatchBroadcastsServer) error - SubscribeBroadcast(context.Context, *SubscribeBroadcastRequest) (*SubscribeBroadcastResponse, error) - UnsubscribeBroadcast(context.Context, *UnsubscribeBroadcastRequest) (*UnsubscribeBroadcastResponse, error) + SubscribeBroadcastEvent(context.Context, *SubscribeBroadcastEventRequest) (*SubscribeBroadcastEventResponse, error) + UnsubscribeBroadcastEvent(context.Context, *UnsubscribeBroadcastEventRequest) (*UnsubscribeBroadcastEventResponse, error) } // UnimplementedYorkieServiceServer can be embedded to have forward compatible implementations. @@ -1582,14 +1439,11 @@ func (*UnimplementedYorkieServiceServer) WatchDocument(req *WatchDocumentRequest func (*UnimplementedYorkieServiceServer) Broadcast(ctx context.Context, req *BroadcastRequest) (*BroadcastResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented") } -func (*UnimplementedYorkieServiceServer) WatchBroadcasts(req *WatchBroadcastsRequest, srv YorkieService_WatchBroadcastsServer) error { - return status.Errorf(codes.Unimplemented, "method WatchBroadcasts not implemented") -} -func (*UnimplementedYorkieServiceServer) SubscribeBroadcast(ctx context.Context, req *SubscribeBroadcastRequest) (*SubscribeBroadcastResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubscribeBroadcast not implemented") +func (*UnimplementedYorkieServiceServer) SubscribeBroadcastEvent(ctx context.Context, req *SubscribeBroadcastEventRequest) (*SubscribeBroadcastEventResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubscribeBroadcastEvent not implemented") } -func (*UnimplementedYorkieServiceServer) UnsubscribeBroadcast(ctx context.Context, req *UnsubscribeBroadcastRequest) (*UnsubscribeBroadcastResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnsubscribeBroadcast not implemented") +func (*UnimplementedYorkieServiceServer) UnsubscribeBroadcastEvent(ctx context.Context, req *UnsubscribeBroadcastEventRequest) (*UnsubscribeBroadcastEventResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnsubscribeBroadcastEvent not implemented") } func RegisterYorkieServiceServer(s *grpc.Server, srv YorkieServiceServer) { @@ -1743,59 +1597,38 @@ func _YorkieService_Broadcast_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _YorkieService_WatchBroadcasts_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(WatchBroadcastsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(YorkieServiceServer).WatchBroadcasts(m, &yorkieServiceWatchBroadcastsServer{stream}) -} - -type YorkieService_WatchBroadcastsServer interface { - Send(*WatchBroadcastsResponse) error - grpc.ServerStream -} - -type yorkieServiceWatchBroadcastsServer struct { - grpc.ServerStream -} - -func (x *yorkieServiceWatchBroadcastsServer) Send(m *WatchBroadcastsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _YorkieService_SubscribeBroadcast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SubscribeBroadcastRequest) +func _YorkieService_SubscribeBroadcastEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubscribeBroadcastEventRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(YorkieServiceServer).SubscribeBroadcast(ctx, in) + return srv.(YorkieServiceServer).SubscribeBroadcastEvent(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/yorkie.v1.YorkieService/SubscribeBroadcast", + FullMethod: "/yorkie.v1.YorkieService/SubscribeBroadcastEvent", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).SubscribeBroadcast(ctx, req.(*SubscribeBroadcastRequest)) + return srv.(YorkieServiceServer).SubscribeBroadcastEvent(ctx, req.(*SubscribeBroadcastEventRequest)) } return interceptor(ctx, in, info, handler) } -func _YorkieService_UnsubscribeBroadcast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnsubscribeBroadcastRequest) +func _YorkieService_UnsubscribeBroadcastEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnsubscribeBroadcastEventRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(YorkieServiceServer).UnsubscribeBroadcast(ctx, in) + return srv.(YorkieServiceServer).UnsubscribeBroadcastEvent(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/yorkie.v1.YorkieService/UnsubscribeBroadcast", + FullMethod: "/yorkie.v1.YorkieService/UnsubscribeBroadcastEvent", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).UnsubscribeBroadcast(ctx, req.(*UnsubscribeBroadcastRequest)) + return srv.(YorkieServiceServer).UnsubscribeBroadcastEvent(ctx, req.(*UnsubscribeBroadcastEventRequest)) } return interceptor(ctx, in, info, handler) } @@ -1833,12 +1666,12 @@ var _YorkieService_serviceDesc = grpc.ServiceDesc{ Handler: _YorkieService_Broadcast_Handler, }, { - MethodName: "SubscribeBroadcast", - Handler: _YorkieService_SubscribeBroadcast_Handler, + MethodName: "SubscribeBroadcastEvent", + Handler: _YorkieService_SubscribeBroadcastEvent_Handler, }, { - MethodName: "UnsubscribeBroadcast", - Handler: _YorkieService_UnsubscribeBroadcast_Handler, + MethodName: "UnsubscribeBroadcastEvent", + Handler: _YorkieService_UnsubscribeBroadcastEvent_Handler, }, }, Streams: []grpc.StreamDesc{ @@ -1847,11 +1680,6 @@ var _YorkieService_serviceDesc = grpc.ServiceDesc{ Handler: _YorkieService_WatchDocument_Handler, ServerStreams: true, }, - { - StreamName: "WatchBroadcasts", - Handler: _YorkieService_WatchBroadcasts_Handler, - ServerStreams: true, - }, }, Metadata: "yorkie/v1/yorkie.proto", } @@ -2277,16 +2105,16 @@ func (m *WatchDocumentResponse_Initialization_) MarshalToSizedBuffer(dAtA []byte } return len(dAtA) - i, nil } -func (m *WatchDocumentResponse_Event) MarshalTo(dAtA []byte) (int, error) { +func (m *WatchDocumentResponse_DocEvent) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WatchDocumentResponse_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WatchDocumentResponse_DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.Event != nil { + if m.DocEvent != nil { { - size, err := m.Event.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DocEvent.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2298,6 +2126,27 @@ func (m *WatchDocumentResponse_Event) MarshalToSizedBuffer(dAtA []byte) (int, er } return len(dAtA) - i, nil } +func (m *WatchDocumentResponse_BroadcastEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchDocumentResponse_BroadcastEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BroadcastEvent != nil { + { + size, err := m.BroadcastEvent.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 *WatchDocumentResponse_Initialization) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2528,87 +2377,7 @@ func (m *PushPullChangesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *WatchBroadcastsRequest) 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 *WatchBroadcastsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchBroadcastsRequest) 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.DocumentId) > 0 { - i -= len(m.DocumentId) - copy(dAtA[i:], m.DocumentId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) - 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 *WatchBroadcastsResponse) 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 *WatchBroadcastsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchBroadcastsResponse) 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] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SubscribeBroadcastRequest) Marshal() (dAtA []byte, err error) { +func (m *SubscribeBroadcastEventRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2618,12 +2387,12 @@ func (m *SubscribeBroadcastRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SubscribeBroadcastRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *SubscribeBroadcastEventRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SubscribeBroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SubscribeBroadcastEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2632,13 +2401,6 @@ func (m *SubscribeBroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.SubID) > 0 { - i -= len(m.SubID) - copy(dAtA[i:], m.SubID) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.SubID))) - i-- - dAtA[i] = 0x22 - } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) @@ -2663,7 +2425,7 @@ func (m *SubscribeBroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *SubscribeBroadcastResponse) Marshal() (dAtA []byte, err error) { +func (m *SubscribeBroadcastEventResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2673,12 +2435,12 @@ func (m *SubscribeBroadcastResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SubscribeBroadcastResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *SubscribeBroadcastEventResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SubscribeBroadcastResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SubscribeBroadcastEventResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2690,7 +2452,7 @@ func (m *SubscribeBroadcastResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *UnsubscribeBroadcastRequest) Marshal() (dAtA []byte, err error) { +func (m *UnsubscribeBroadcastEventRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2700,12 +2462,12 @@ func (m *UnsubscribeBroadcastRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UnsubscribeBroadcastRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *UnsubscribeBroadcastEventRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UnsubscribeBroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UnsubscribeBroadcastEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2714,13 +2476,6 @@ func (m *UnsubscribeBroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, er i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.SubID) > 0 { - i -= len(m.SubID) - copy(dAtA[i:], m.SubID) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.SubID))) - i-- - dAtA[i] = 0x22 - } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) @@ -2745,7 +2500,7 @@ func (m *UnsubscribeBroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *UnsubscribeBroadcastResponse) Marshal() (dAtA []byte, err error) { +func (m *UnsubscribeBroadcastEventResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2755,12 +2510,12 @@ func (m *UnsubscribeBroadcastResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UnsubscribeBroadcastResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *UnsubscribeBroadcastEventResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UnsubscribeBroadcastResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UnsubscribeBroadcastEventResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3053,14 +2808,26 @@ func (m *WatchDocumentResponse_Initialization_) Size() (n int) { } return n } -func (m *WatchDocumentResponse_Event) Size() (n int) { +func (m *WatchDocumentResponse_DocEvent) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Event != nil { - l = m.Event.Size() + if m.DocEvent != nil { + l = m.DocEvent.Size() + n += 1 + l + sovYorkie(uint64(l)) + } + return n +} +func (m *WatchDocumentResponse_BroadcastEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BroadcastEvent != nil { + l = m.BroadcastEvent.Size() n += 1 + l + sovYorkie(uint64(l)) } return n @@ -3166,7 +2933,7 @@ func (m *PushPullChangesResponse) Size() (n int) { return n } -func (m *WatchBroadcastsRequest) Size() (n int) { +func (m *SubscribeBroadcastEventRequest) Size() (n int) { if m == nil { return 0 } @@ -3180,29 +2947,29 @@ func (m *WatchBroadcastsRequest) Size() (n int) { if l > 0 { n += 1 + l + sovYorkie(uint64(l)) } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *WatchBroadcastsResponse) Size() (n int) { +func (m *SubscribeBroadcastEventResponse) 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)) - } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *SubscribeBroadcastRequest) Size() (n int) { +func (m *UnsubscribeBroadcastEventRequest) Size() (n int) { if m == nil { return 0 } @@ -3220,57 +2987,13 @@ func (m *SubscribeBroadcastRequest) Size() (n int) { if l > 0 { n += 1 + l + sovYorkie(uint64(l)) } - l = len(m.SubID) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *SubscribeBroadcastResponse) 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 *UnsubscribeBroadcastRequest) 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)) - } - l = len(m.DocumentId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.SubID) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UnsubscribeBroadcastResponse) Size() (n int) { +func (m *UnsubscribeBroadcastEventResponse) Size() (n int) { if m == nil { return 0 } @@ -4301,7 +4024,7 @@ func (m *WatchDocumentResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DocEvent", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4332,7 +4055,42 @@ func (m *WatchDocumentResponse) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Body = &WatchDocumentResponse_Event{v} + m.Body = &WatchDocumentResponse_DocEvent{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BroadcastEvent", 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 := &BroadcastEvent{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Body = &WatchDocumentResponse_BroadcastEvent{v} iNdEx = postIndex default: iNdEx = preIndex @@ -4935,209 +4693,7 @@ func (m *PushPullChangesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *WatchBroadcastsRequest) 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: WatchBroadcastsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchBroadcastsRequest: 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 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.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", 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.DocumentId = 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 *WatchBroadcastsResponse) 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: WatchBroadcastsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchBroadcastsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 = &BroadcastEvent{} - } - 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 *SubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { +func (m *SubscribeBroadcastEventRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5160,10 +4716,10 @@ func (m *SubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SubscribeBroadcastRequest: wiretype end group for non-group") + return fmt.Errorf("proto: SubscribeBroadcastEventRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SubscribeBroadcastRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SubscribeBroadcastEventRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5262,38 +4818,6 @@ func (m *SubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubID", 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.SubID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -5316,7 +4840,7 @@ func (m *SubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *SubscribeBroadcastResponse) Unmarshal(dAtA []byte) error { +func (m *SubscribeBroadcastEventResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5339,10 +4863,10 @@ func (m *SubscribeBroadcastResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SubscribeBroadcastResponse: wiretype end group for non-group") + return fmt.Errorf("proto: SubscribeBroadcastEventResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SubscribeBroadcastResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SubscribeBroadcastEventResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -5367,7 +4891,7 @@ func (m *SubscribeBroadcastResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *UnsubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { +func (m *UnsubscribeBroadcastEventRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5390,10 +4914,10 @@ func (m *UnsubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UnsubscribeBroadcastRequest: wiretype end group for non-group") + return fmt.Errorf("proto: UnsubscribeBroadcastEventRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UnsubscribeBroadcastRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UnsubscribeBroadcastEventRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5492,38 +5016,6 @@ func (m *UnsubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubID", 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.SubID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYorkie(dAtA[iNdEx:]) @@ -5546,7 +5038,7 @@ func (m *UnsubscribeBroadcastRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *UnsubscribeBroadcastResponse) Unmarshal(dAtA []byte) error { +func (m *UnsubscribeBroadcastEventResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5569,10 +5061,10 @@ func (m *UnsubscribeBroadcastResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UnsubscribeBroadcastResponse: wiretype end group for non-group") + return fmt.Errorf("proto: UnsubscribeBroadcastEventResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UnsubscribeBroadcastResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UnsubscribeBroadcastEventResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/api/yorkie/v1/yorkie.proto b/api/yorkie/v1/yorkie.proto index 81c36149a..3b69d96af 100644 --- a/api/yorkie/v1/yorkie.proto +++ b/api/yorkie/v1/yorkie.proto @@ -37,9 +37,8 @@ service YorkieService { rpc WatchDocument (WatchDocumentRequest) returns (stream WatchDocumentResponse) {} rpc Broadcast (BroadcastRequest) returns (BroadcastResponse) {} - rpc WatchBroadcasts (WatchBroadcastsRequest) returns (stream WatchBroadcastsResponse) {} - rpc SubscribeBroadcast (SubscribeBroadcastRequest) returns (SubscribeBroadcastResponse) {} - rpc UnsubscribeBroadcast (UnsubscribeBroadcastRequest) returns (UnsubscribeBroadcastResponse) {} + rpc SubscribeBroadcastEvent (SubscribeBroadcastEventRequest) returns (SubscribeBroadcastEventResponse) {} + rpc UnsubscribeBroadcastEvent (UnsubscribeBroadcastEventRequest) returns (UnsubscribeBroadcastEventResponse) {} } message ActivateClientRequest { @@ -90,7 +89,8 @@ message WatchDocumentResponse { oneof body { Initialization initialization = 1; - DocEvent event = 2; + DocEvent doc_event = 2; + BroadcastEvent broadcast_event = 3; } } @@ -115,33 +115,22 @@ message PushPullChangesResponse { ChangePack change_pack = 1; } -message WatchBroadcastsRequest { - string client_id = 1; - string document_id = 2; -} - -message WatchBroadcastsResponse { - BroadcastEvent event = 1; -} - -message SubscribeBroadcastRequest { +message SubscribeBroadcastEventRequest { string client_id = 1; string document_id = 2; string type = 3; - string subID = 4; } -message SubscribeBroadcastResponse { +message SubscribeBroadcastEventResponse { } -message UnsubscribeBroadcastRequest { +message UnsubscribeBroadcastEventRequest { string client_id = 1; string document_id = 2; string type = 3; - string subID = 4; } -message UnsubscribeBroadcastResponse { +message UnsubscribeBroadcastEventResponse { } message BroadcastRequest { diff --git a/server/backend/sync/coordinator.go b/server/backend/sync/coordinator.go index 40919ecf3..96c721fbd 100644 --- a/server/backend/sync/coordinator.go +++ b/server/backend/sync/coordinator.go @@ -38,58 +38,46 @@ type Coordinator interface { NewLocker(ctx context.Context, key Key) (Locker, error) // Subscribe subscribes to the given documents. - SubscribeDocEvent( + SubscribeDoc( ctx context.Context, subscriber *time.ActorID, documentID types.ID, - ) (*Subscription[*DocEvent], []*time.ActorID, error) + ) (*Subscription, []*time.ActorID, error) // Unsubscribe unsubscribes from the given documents. - UnsubscribeDocEvent( + UnsubscribeDoc( ctx context.Context, documentID types.ID, - sub *Subscription[*DocEvent], + sub *Subscription, ) error // Publish publishes the given event. PublishDocEvent( ctx context.Context, publisherID *time.ActorID, - event *DocEvent, + event types.DocEvent, ) - SubscribeBroadcasts( - ctx context.Context, - subscriber *time.ActorID, - documentID types.ID, - ) (*Subscription[*BroadcastEvent], error) - - UnsubscribeBroadcasts( - ctx context.Context, - documentID types.ID, - sub *Subscription[*BroadcastEvent], - ) error - SubscribeBroadcastEvent( ctx context.Context, documentID types.ID, - eventType types.EventType, - subID string, + eventType string, + subscriber *time.ActorID, ) UnsubscribeBroadcastEvent( ctx context.Context, documentID types.ID, - eventType types.EventType, - subID string, + eventType string, + subscriber *time.ActorID, ) PublishBroadcastEvent( ctx context.Context, documentID types.ID, - eventType types.EventType, + eventType string, publisherID *time.ActorID, - event *BroadcastEvent, + event types.BroadcastEvent, ) // Members returns the members of this cluster. diff --git a/server/backend/sync/memory/coordinator.go b/server/backend/sync/memory/coordinator.go index 287df2277..69ddae3b4 100644 --- a/server/backend/sync/memory/coordinator.go +++ b/server/backend/sync/memory/coordinator.go @@ -30,18 +30,16 @@ import ( type Coordinator struct { serverInfo *sync.ServerInfo - locks *locker.Locker - docPubSub *PubSub[*sync.DocEvent] - broadcastPubSub *PubSub[*sync.BroadcastEvent] + locks *locker.Locker + pubSub *PubSub } // NewCoordinator creates an instance of Coordinator. func NewCoordinator(serverInfo *sync.ServerInfo) *Coordinator { return &Coordinator{ - serverInfo: serverInfo, - locks: locker.New(), - docPubSub: NewPubSub[*sync.DocEvent](), - broadcastPubSub: NewPubSub[*sync.BroadcastEvent](), + serverInfo: serverInfo, + locks: locker.New(), + pubSub: NewPubSub(), } } @@ -56,93 +54,71 @@ func (c *Coordinator) NewLocker( }, nil } -// Subscribe subscribes to the given documents. -func (c *Coordinator) SubscribeDocEvent( +// SubscribeDoc subscribes to the given documents. +func (c *Coordinator) SubscribeDoc( ctx context.Context, subscriber *time.ActorID, documentID types.ID, -) (*sync.Subscription[*sync.DocEvent], []*time.ActorID, error) { - sub, err := c.docPubSub.SubscribeDoc(ctx, subscriber, documentID) +) (*sync.Subscription, []*time.ActorID, error) { + sub, err := c.pubSub.SubscribeDoc(ctx, subscriber, documentID) if err != nil { return nil, nil, err } - c.docPubSub.SubscribeEvent(ctx, documentID, "document", sub.ID()) + c.pubSub.SubscribeEvent(ctx, documentID, "document", subscriber) - ids := c.docPubSub.ClientIDs(documentID) + ids := c.pubSub.ClientIDs(documentID) return sub, ids, nil } -// Unsubscribe unsubscribes the given documents. -func (c *Coordinator) UnsubscribeDocEvent( +// UnsubscribeDoc unsubscribes the given documents. +func (c *Coordinator) UnsubscribeDoc( ctx context.Context, documentID types.ID, - sub *sync.Subscription[*sync.DocEvent], + sub *sync.Subscription, ) error { - c.docPubSub.UnsubscribeDoc(ctx, documentID, sub) + c.pubSub.UnsubscribeDoc(ctx, documentID, sub) return nil } -// Publish publishes the given event. +// PublishDocEvent publishes the given document event. func (c *Coordinator) PublishDocEvent( ctx context.Context, publisherID *time.ActorID, - event *sync.DocEvent, + event types.DocEvent, ) { - c.docPubSub.Publish(ctx, event.DocumentID, "document", publisherID, event) -} - -// Subscribe subscribes to the given documents. -func (c *Coordinator) SubscribeBroadcasts( - ctx context.Context, - subscriber *time.ActorID, - documentID types.ID, -) (*sync.Subscription[*sync.BroadcastEvent], error) { - sub, err := c.broadcastPubSub.SubscribeDoc(ctx, subscriber, documentID) - if err != nil { - return nil, err - } - - return sub, nil -} - -// Unsubscribe unsubscribes the given documents. -func (c *Coordinator) UnsubscribeBroadcasts( - ctx context.Context, - documentID types.ID, - sub *sync.Subscription[*sync.BroadcastEvent], -) error { - c.broadcastPubSub.UnsubscribeDoc(ctx, documentID, sub) - return nil + c.pubSub.Publish(ctx, event.DocumentID, "document", publisherID, event) } +// SubscribeBroadcastEvent subscribes the given broadcast event type. func (c *Coordinator) SubscribeBroadcastEvent( ctx context.Context, documentID types.ID, - eventType types.EventType, - subID string, + eventType string, + subscriber *time.ActorID, ) { - c.broadcastPubSub.SubscribeEvent(ctx, documentID, eventType, subID) + c.pubSub.SubscribeEvent(ctx, documentID, eventType, subscriber) } +// UnsubscribeBroadcastEvent unsubscribes the given broadcast event type. func (c *Coordinator) UnsubscribeBroadcastEvent( ctx context.Context, documentID types.ID, - eventType types.EventType, - subID string, + eventType string, + subscriber *time.ActorID, ) { - c.broadcastPubSub.UnsubscribeEvent(ctx, documentID, eventType, subID) + c.pubSub.UnsubscribeEvent(ctx, documentID, eventType, subscriber) } -// Publish publishes the given event. +// PublishBroadcastEvent publishes the given broadcast event. func (c *Coordinator) PublishBroadcastEvent( ctx context.Context, documentID types.ID, - eventType types.EventType, + eventType string, publisherID *time.ActorID, - event *sync.BroadcastEvent, + event types.BroadcastEvent, ) { - c.broadcastPubSub.Publish(ctx, documentID, eventType, publisherID, event) + c.pubSub.Publish(ctx, documentID, eventType, publisherID, event) } // Members returns the members of this cluster. diff --git a/server/backend/sync/memory/coordinator_test.go b/server/backend/sync/memory/coordinator_test.go index 3d487c911..841079573 100644 --- a/server/backend/sync/memory/coordinator_test.go +++ b/server/backend/sync/memory/coordinator_test.go @@ -37,7 +37,7 @@ func TestCoordinator(t *testing.T) { id, err := time.ActorIDFromBytes([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, byte(i)}) assert.NoError(t, err) - _, clientIDs, err := coordinator.SubscribeDocEvent(ctx, id, docID) + _, clientIDs, err := coordinator.SubscribeDoc(ctx, id, docID) assert.NoError(t, err) assert.Len(t, clientIDs, i+1) } diff --git a/server/backend/sync/memory/pubsub.go b/server/backend/sync/memory/pubsub.go index 3572dca66..e6f3789b0 100644 --- a/server/backend/sync/memory/pubsub.go +++ b/server/backend/sync/memory/pubsub.go @@ -30,83 +30,97 @@ import ( ) // subscriptionIDs is a set of subscriptionIDs. -type subscriptionIDs map[string]struct{} +type subscribers map[string]struct{} -func (s subscriptionIDs) Add(subID string) { - s[subID] = struct{}{} +func (s subscribers) Add(subscriber *time.ActorID) { + s[subscriber.String()] = struct{}{} } -func (s subscriptionIDs) Contains(subID string) bool { - _, exists := s[subID] +func (s subscribers) Contains(subscriber *time.ActorID) bool { + _, exists := s[subscriber.String()] return exists } -func (s subscriptionIDs) Remove(subID string) { - delete(s, subID) +func (s subscribers) Remove(subscriber *time.ActorID) { + delete(s, subscriber.String()) } -func (s subscriptionIDs) Len() int { +func (s subscribers) Len() int { return len(s) } -type DocSubs[E sync.Event] struct { - documentID types.ID - subMapBySubIDs map[string]*sync.Subscription[E] - subIDsMapByEvent map[types.EventType]subscriptionIDs +// DocSubs has the subscription data of the document. +type DocSubs struct { + documentID types.ID + subMapBySubscriber map[string]*sync.Subscription + subscribersMapByEvent map[string]subscribers } -func NewDocSubs[E sync.Event](docID types.ID) *DocSubs[E] { - return &DocSubs[E]{ - documentID: docID, - subMapBySubIDs: make(map[string]*sync.Subscription[E]), - subIDsMapByEvent: make(map[types.EventType]subscriptionIDs), +// NewDocSubs returns a new DocSubs of the given document id. +func NewDocSubs(docID types.ID) *DocSubs { + return &DocSubs{ + documentID: docID, + subMapBySubscriber: make(map[string]*sync.Subscription), + subscribersMapByEvent: make(map[string]subscribers), } } -func (s *DocSubs[E]) Len() int { - return len(s.subMapBySubIDs) +// Len returns the number of the subscribers in the DocSubs. +func (s *DocSubs) Len() int { + return len(s.subMapBySubscriber) } -func (s *DocSubs[E]) Add(sub *sync.Subscription[E]) { - s.subMapBySubIDs[sub.ID()] = sub +// Add adds the given subscription to the DocSubs. +func (s *DocSubs) Add(sub *sync.Subscription) { + s.subMapBySubscriber[sub.Subscriber().String()] = sub } -func (s *DocSubs[E]) Remove(subID string) { - if sub, ok := s.subMapBySubIDs[subID]; ok { - // Close the subscription +// Remove closes the given subscription and cleans up the +// subscription entries related to it. +func (s *DocSubs) Remove(subscriber *time.ActorID) { + if sub, ok := s.subMapBySubscriber[subscriber.String()]; ok { + // Close the subscription. sub.Close() - // Remove the subID from subIDsMapByEvent + // Remove the subscriber from the subscriber lists of subscribed events. for _, t := range sub.Types() { - if subIDs, ok := s.subIDsMapByEvent[t]; ok { - subIDs.Remove(subID) + if subscribers, ok := s.subscribersMapByEvent[t]; ok { + subscribers.Remove(subscriber) - if subIDs.Len() == 0 { - delete(s.subIDsMapByEvent, t) + if subscribers.Len() == 0 { + delete(s.subscribersMapByEvent, t) } } } + + delete(s.subMapBySubscriber, subscriber.String()) } - // Remove the subscription from subMapBySubIDs - delete(s.subMapBySubIDs, subID) + // Remove the subscription from subMapBySubscriber + delete(s.subMapBySubscriber, subscriber.String()) } -func (s *DocSubs[E]) SubscribeEvent(eventType types.EventType, subID string) { - if sub, ok := s.subMapBySubIDs[subID]; ok { - if _, ok := s.subIDsMapByEvent[eventType]; !ok { - s.subIDsMapByEvent[eventType] = make(subscriptionIDs) +// SubscribeEvent adds a new subscription entry for the given eventType to the DocSubs. +func (s *DocSubs) SubscribeEvent(eventType string, subscriber *time.ActorID) { + if sub, ok := s.subMapBySubscriber[subscriber.String()]; ok { + if _, ok := s.subscribersMapByEvent[eventType]; !ok { + s.subscribersMapByEvent[eventType] = make(subscribers) } - s.subIDsMapByEvent[eventType].Add(subID) + s.subscribersMapByEvent[eventType].Add(subscriber) sub.AddType(eventType) } } -func (s *DocSubs[E]) UnsubscribeEvent(eventType types.EventType, subID string) { - if sub, ok := s.subMapBySubIDs[subID]; ok { - if subIDs, ok := s.subIDsMapByEvent[eventType]; ok { - subIDs.Remove(subID) +// UnsubscribeEvent removes the subscription entry for the given eventType from the DocSubs. +func (s *DocSubs) UnsubscribeEvent(eventType string, subscriber *time.ActorID) { + if sub, ok := s.subMapBySubscriber[subscriber.String()]; ok { + if subscribers, ok := s.subscribersMapByEvent[eventType]; ok { + subscribers.Remove(subscriber) + + if subscribers.Len() == 0 { + delete(s.subscribersMapByEvent, eventType) + } } sub.RemoveType(eventType) @@ -114,25 +128,25 @@ func (s *DocSubs[E]) UnsubscribeEvent(eventType types.EventType, subID string) { } // PubSub is the memory implementation of PubSub, used for single server. -type PubSub[E sync.Event] struct { +type PubSub struct { docSubsMapMu *gosync.RWMutex - docSubsMapByDocID map[types.ID]*DocSubs[E] + docSubsMapByDocID map[types.ID]*DocSubs } // NewPubSub creates an instance of PubSub. -func NewPubSub[E sync.Event]() *PubSub[E] { - return &PubSub[E]{ +func NewPubSub() *PubSub { + return &PubSub{ docSubsMapMu: &gosync.RWMutex{}, - docSubsMapByDocID: make(map[types.ID]*DocSubs[E]), + docSubsMapByDocID: make(map[types.ID]*DocSubs), } } -// Watch subscribes to the given document keys. -func (m *PubSub[E]) SubscribeDoc( +// SubscribeDoc subscribes to the given document keys. +func (m *PubSub) SubscribeDoc( ctx context.Context, subscriber *time.ActorID, documentID types.ID, -) (*sync.Subscription[E], error) { +) (*sync.Subscription, error) { m.docSubsMapMu.Lock() defer m.docSubsMapMu.Unlock() @@ -144,9 +158,9 @@ func (m *PubSub[E]) SubscribeDoc( ) } - sub := sync.NewSubscription[E](documentID, subscriber) + sub := sync.NewSubscription(subscriber) if _, ok := m.docSubsMapByDocID[documentID]; !ok { - m.docSubsMapByDocID[documentID] = NewDocSubs[E](documentID) + m.docSubsMapByDocID[documentID] = NewDocSubs(documentID) } m.docSubsMapByDocID[documentID].Add(sub) @@ -161,11 +175,11 @@ func (m *PubSub[E]) SubscribeDoc( return sub, nil } -// Unwatch unsubscribes the given docKeys. -func (m *PubSub[E]) UnsubscribeDoc( +// UnsubscribeDoc unsubscribes the given docKeys. +func (m *PubSub) UnsubscribeDoc( ctx context.Context, documentID types.ID, - sub *sync.Subscription[E], + sub *sync.Subscription, ) { m.docSubsMapMu.Lock() defer m.docSubsMapMu.Unlock() @@ -183,7 +197,7 @@ func (m *PubSub[E]) UnsubscribeDoc( ) } - docSubs.Remove(sub.ID()) + docSubs.Remove(sub.Subscriber()) if docSubs.Len() == 0 { delete(m.docSubsMapByDocID, documentID) @@ -198,11 +212,12 @@ func (m *PubSub[E]) UnsubscribeDoc( } } -func (m *PubSub[E]) SubscribeEvent( +// SubscribeEvent subscribes to the given event that occurred in the specified document. +func (m *PubSub) SubscribeEvent( ctx context.Context, documentID types.ID, - eventType types.EventType, - subID string, + eventType string, + subscriber *time.ActorID, ) { m.docSubsMapMu.Lock() defer m.docSubsMapMu.Unlock() @@ -212,33 +227,32 @@ func (m *PubSub[E]) SubscribeEvent( return } - // TODO(sejongk): log subscriber info if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( `SubscribeEvent(%s,%s,%s) Start`, documentID, eventType, - subID, + subscriber, ) } - - docSubs.SubscribeEvent(eventType, subID) + docSubs.SubscribeEvent(eventType, subscriber) if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( `SubscribeEvent(%s,%s,%s) End`, documentID, eventType, - subID, + subscriber, ) } } -func (m *PubSub[E]) UnsubscribeEvent( +// UnsubscribeEvent unsubscribes to the given event that occurred in the specified document. +func (m *PubSub) UnsubscribeEvent( ctx context.Context, documentID types.ID, - eventType types.EventType, - subID string, + eventType string, + subscriber *time.ActorID, ) { m.docSubsMapMu.Lock() defer m.docSubsMapMu.Unlock() @@ -248,35 +262,34 @@ func (m *PubSub[E]) UnsubscribeEvent( return } - // TODO(sejongk): log subscriber info if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( `SubscribeEvent(%s,%s,%s) Start`, documentID, eventType, - subID, + subscriber, ) } - docSubs.UnsubscribeEvent(eventType, subID) + docSubs.UnsubscribeEvent(eventType, subscriber) if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( `SubscribeEvent(%s,%s,%s) End`, documentID, eventType, - subID, + subscriber, ) } } // Publish publishes the given event. -func (m *PubSub[E]) Publish( +func (m *PubSub) Publish( ctx context.Context, documentID types.ID, - eventType types.EventType, + eventType string, publisherID *time.ActorID, - event E, + event sync.Event, ) { m.docSubsMapMu.RLock() defer m.docSubsMapMu.RUnlock() @@ -290,13 +303,13 @@ func (m *PubSub[E]) Publish( return } - subIDs, ok := docSubs.subIDsMapByEvent[eventType] + subscribers, ok := docSubs.subscribersMapByEvent[eventType] if !ok { return } - for subID := range subIDs { - sub, ok := docSubs.subMapBySubIDs[subID] + for subscriber := range subscribers { + sub, ok := docSubs.subMapBySubscriber[subscriber] if !ok { continue } @@ -335,7 +348,7 @@ func (m *PubSub[E]) Publish( } // ClientIDs returns the clients of the given document. -func (m *PubSub[E]) ClientIDs(documentID types.ID) []*time.ActorID { +func (m *PubSub) ClientIDs(documentID types.ID) []*time.ActorID { m.docSubsMapMu.RLock() defer m.docSubsMapMu.RUnlock() @@ -345,7 +358,7 @@ func (m *PubSub[E]) ClientIDs(documentID types.ID) []*time.ActorID { } var ids []*time.ActorID - for _, sub := range docSubs.subMapBySubIDs { + for _, sub := range docSubs.subMapBySubscriber { ids = append(ids, sub.Subscriber()) } diff --git a/server/backend/sync/memory/pubsub_test.go b/server/backend/sync/memory/pubsub_test.go index fc6ad759a..34a71d82c 100644 --- a/server/backend/sync/memory/pubsub_test.go +++ b/server/backend/sync/memory/pubsub_test.go @@ -25,7 +25,6 @@ import ( "github.com/yorkie-team/yorkie/api/types" "github.com/yorkie-team/yorkie/pkg/document/time" - "github.com/yorkie-team/yorkie/server/backend/sync" "github.com/yorkie-team/yorkie/server/backend/sync/memory" ) @@ -36,9 +35,9 @@ func TestPubSub(t *testing.T) { assert.NoError(t, err) t.Run("publish subscribe test", func(t *testing.T) { - pubSub := memory.NewPubSub[sync.DocEvent]() + pubSub := memory.NewPubSub() id := types.ID(t.Name() + "id") - docEvent := sync.DocEvent{ + docEvent := types.DocEvent{ Type: types.DocumentWatchedEvent, Publisher: idB, DocumentID: id, @@ -50,7 +49,7 @@ func TestPubSub(t *testing.T) { assert.NoError(t, err) // subscribe "document" type events - pubSub.SubscribeEvent(ctx, id, "document", subA.ID()) + pubSub.SubscribeEvent(ctx, id, "document", idA) defer func() { pubSub.UnsubscribeDoc(ctx, id, subA) diff --git a/server/backend/sync/pubsub.go b/server/backend/sync/pubsub.go index b9966659b..30ae6c9ce 100644 --- a/server/backend/sync/pubsub.go +++ b/server/backend/sync/pubsub.go @@ -19,43 +19,45 @@ package sync import ( "github.com/rs/xid" - "github.com/yorkie-team/yorkie/api/types" "github.com/yorkie-team/yorkie/pkg/document/time" ) // Subscription represents a subscription of a subscriber to documents. -type Subscription[E Event] struct { +type Subscription struct { id string - types []types.EventType + types []string subscriber *time.ActorID closed bool - events chan E + events chan Event } // NewSubscription creates a new instance of Subscription. -func NewSubscription[E Event](docID types.ID, subscriber *time.ActorID) *Subscription[E] { - return &Subscription[E]{ +func NewSubscription(subscriber *time.ActorID) *Subscription { + return &Subscription{ id: xid.New().String(), - types: make([]types.EventType, 0), + types: make([]string, 0), subscriber: subscriber, - events: make(chan E, 1), + events: make(chan Event, 1), } } // ID returns the id of this subscription. -func (s *Subscription[E]) ID() string { +func (s *Subscription) ID() string { return s.id } -func (s *Subscription[E]) Types() []types.EventType { +// Types returns the subscribed event type list. +func (s *Subscription) Types() []string { return s.types } -func (s *Subscription[E]) AddType(t types.EventType) { +// AddType adds the event type to the subscribed event type list. +func (s *Subscription) AddType(t string) { s.types = append(s.types, t) } -func (s *Subscription[E]) RemoveType(t types.EventType) { +// RemoveType removes the event type from the subscribed event type list. +func (s *Subscription) RemoveType(t string) { found := -1 for i, v := range s.types { if v == t { @@ -67,18 +69,18 @@ func (s *Subscription[E]) RemoveType(t types.EventType) { } } -// Events returns the DocEvent channel of this subscription. -func (s *Subscription[E]) Events() chan E { +// Events returns the Event channel of this subscription. +func (s *Subscription) Events() chan Event { return s.events } // Subscriber returns the subscriber of this subscription. -func (s *Subscription[E]) Subscriber() *time.ActorID { +func (s *Subscription) Subscriber() *time.ActorID { return s.subscriber } // Close closes all resources of this Subscription. -func (s *Subscription[E]) Close() { +func (s *Subscription) Close() { if s.closed { return } @@ -87,45 +89,5 @@ func (s *Subscription[E]) Close() { close(s.events) } -type Event interface { - TypeString() string - PublisherString() string - PayloadString() string -} - -// DocEvent represents events that occur related to the document. -type DocEvent struct { - Type types.DocEventType - Publisher *time.ActorID - DocumentID types.ID -} - -func (e DocEvent) TypeString() string { - return string(e.Type) -} - -func (e DocEvent) PublisherString() string { - return e.Publisher.String() -} - -func (e DocEvent) PayloadString() string { - return string(e.DocumentID) -} - -type BroadcastEvent struct { - Type types.EventType - Publisher *time.ActorID - Payload []byte -} - -func (e BroadcastEvent) TypeString() string { - return string(e.Type) -} - -func (e BroadcastEvent) PublisherString() string { - return e.Publisher.String() -} - -func (e BroadcastEvent) PayloadString() string { - return string(e.Payload) -} +// Event represents a type for publishable events. +type Event interface{} From 669a7391edcb4d24c4142473e41db8ce26e85050 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 11:10:20 +0900 Subject: [PATCH 08/24] Apply new pubsub to server APIs --- api/types/broadcast.go | 26 ------ server/packs/packs.go | 2 +- server/rpc/admin_server.go | 3 +- server/rpc/yorkie_server.go | 170 +++++++++++++----------------------- 4 files changed, 65 insertions(+), 136 deletions(-) delete mode 100644 api/types/broadcast.go diff --git a/api/types/broadcast.go b/api/types/broadcast.go deleted file mode 100644 index b711be82d..000000000 --- a/api/types/broadcast.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2021 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. - */ - -// Package types provides the types used in the Yorkie API. This package is -// used by both the server and the client. -package types - -const ( - Document EventType = "Document" - Watch EventType = "Watch" -) - -type EventType string diff --git a/server/packs/packs.go b/server/packs/packs.go index 551ccd1d5..504a13862 100644 --- a/server/packs/packs.go +++ b/server/packs/packs.go @@ -131,7 +131,7 @@ func PushPull( be.Coordinator.PublishDocEvent( ctx, publisherID, - &sync.DocEvent{ + types.DocEvent{ Type: types.DocumentChangedEvent, Publisher: publisherID, DocumentID: docInfo.ID, diff --git a/server/rpc/admin_server.go b/server/rpc/admin_server.go index a8ae2ba38..b6d12cb33 100644 --- a/server/rpc/admin_server.go +++ b/server/rpc/admin_server.go @@ -26,7 +26,6 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/server/backend" - "github.com/yorkie-team/yorkie/server/backend/sync" "github.com/yorkie-team/yorkie/server/documents" "github.com/yorkie-team/yorkie/server/logging" "github.com/yorkie-team/yorkie/server/packs" @@ -374,7 +373,7 @@ func (s *adminServer) RemoveDocumentByAdmin( s.backend.Coordinator.PublishDocEvent( ctx, publisherID, - &sync.DocEvent{ + types.DocEvent{ Type: types.DocumentChangedEvent, Publisher: publisherID, DocumentID: docInfo.ID, diff --git a/server/rpc/yorkie_server.go b/server/rpc/yorkie_server.go index 46d450df7..e7300c794 100644 --- a/server/rpc/yorkie_server.go +++ b/server/rpc/yorkie_server.go @@ -18,6 +18,7 @@ package rpc import ( "context" + "errors" "fmt" "github.com/yorkie-team/yorkie/api/converter" @@ -35,6 +36,12 @@ import ( "github.com/yorkie-team/yorkie/server/rpc/auth" ) +var ( + // ErrUnsupportedEventType is returned when the given event type is not + // supported. + ErrUnsupportedEventType = errors.New("unsupported event type") +) + type yorkieServer struct { backend *backend.Backend serviceCtx context.Context @@ -412,19 +419,38 @@ func (s *yorkieServer) WatchDocument( case <-stream.Context().Done(): return nil case event := <-subscription.Events(): - eventType, err := converter.ToDocEventType(event.Type) - if err != nil { - return err + var pbResp *api.WatchDocumentResponse + + if docEvent, ok := event.(types.DocEvent); ok { + eventType, err := converter.ToDocEventType(docEvent.Type) + if err != nil { + return err + } + + pbResp = &api.WatchDocumentResponse{ + Body: &api.WatchDocumentResponse_DocEvent{ + DocEvent: &api.DocEvent{ + Type: eventType, + Publisher: docEvent.Publisher.String(), + }, + }, + } + + } else if broadcastEvent, ok := event.(types.BroadcastEvent); ok { + pbResp = &api.WatchDocumentResponse{ + Body: &api.WatchDocumentResponse_BroadcastEvent{ + BroadcastEvent: &api.BroadcastEvent{ + Type: broadcastEvent.Type, + Publisher: broadcastEvent.Publisher.String(), + Payload: broadcastEvent.Payload, + }, + }, + } + } else { + return ErrUnsupportedEventType } - if err := stream.Send(&api.WatchDocumentResponse{ - Body: &api.WatchDocumentResponse_Event{ - Event: &api.DocEvent{ - Type: eventType, - Publisher: event.Publisher.String(), - }, - }, - }); err != nil { + if err := stream.Send(pbResp); err != nil { return err } } @@ -506,8 +532,8 @@ func (s *yorkieServer) watchDoc( ctx context.Context, clientID *time.ActorID, documentID types.ID, -) (*sync.Subscription[*sync.DocEvent], []*time.ActorID, error) { - subscription, clientIDs, err := s.backend.Coordinator.SubscribeDocEvent(ctx, clientID, documentID) +) (*sync.Subscription, []*time.ActorID, error) { + subscription, clientIDs, err := s.backend.Coordinator.SubscribeDoc(ctx, clientID, documentID) if err != nil { logging.From(ctx).Error(err) return nil, nil, err @@ -516,7 +542,7 @@ func (s *yorkieServer) watchDoc( s.backend.Coordinator.PublishDocEvent( ctx, subscription.Subscriber(), - &sync.DocEvent{ + types.DocEvent{ Type: types.DocumentWatchedEvent, Publisher: subscription.Subscriber(), DocumentID: documentID, @@ -527,15 +553,15 @@ func (s *yorkieServer) watchDoc( } func (s *yorkieServer) unwatchDoc( - subscription *sync.Subscription[*sync.DocEvent], + subscription *sync.Subscription, documentID types.ID, ) { ctx := context.Background() - _ = s.backend.Coordinator.UnsubscribeDocEvent(ctx, documentID, subscription) + _ = s.backend.Coordinator.UnsubscribeDoc(ctx, documentID, subscription) s.backend.Coordinator.PublishDocEvent( ctx, subscription.Subscriber(), - &sync.DocEvent{ + types.DocEvent{ Type: types.DocumentUnwatchedEvent, Publisher: subscription.Subscriber(), DocumentID: documentID, @@ -552,8 +578,8 @@ func (s *yorkieServer) Broadcast( return nil, err } - docID := types.ID(req.DocumentId) - if err := docID.Validate(); err != nil { + docID, err := converter.FromDocumentID(req.DocumentId) + if err != nil { return nil, err } @@ -567,11 +593,7 @@ func (s *yorkieServer) Broadcast( return nil, err } - event, err := converter.FromBroadcastEvent(req.Event) - if err != nil { - return nil, err - } - + // TODO(sejongk): It seems better to use a separate auth attributes for broadcast if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ Method: types.Broadcast, Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), @@ -584,81 +606,19 @@ func (s *yorkieServer) Broadcast( return nil, err } - s.backend.Coordinator.PublishBroadcastEvent(ctx, docID, event.Type, event.Publisher, event) - - return &api.BroadcastResponse{}, nil -} - -func (s *yorkieServer) WatchBroadcasts( - req *api.WatchBroadcastsRequest, - stream api.YorkieService_WatchBroadcastsServer, -) error { - clientID, err := time.ActorIDFromHex(req.ClientId) - if err != nil { - return err - } - docID, err := converter.FromDocumentID(req.DocumentId) - if err != nil { - return err - } - - docInfo, err := documents.FindDocInfo( - stream.Context(), - s.backend, - projects.From(stream.Context()), - docID, - ) - if err != nil { - return nil - } - - if err := auth.VerifyAccess(stream.Context(), s.backend, &types.AccessInfo{ - Method: types.WatchBroadcasts, - Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), - }); err != nil { - return err - } - - project := projects.From(stream.Context()) - if _, err = clients.FindClientInfo(stream.Context(), s.backend.DB, project, clientID); err != nil { - return err - } - - subscription, err := s.backend.Coordinator.SubscribeBroadcasts(stream.Context(), clientID, docID) + event, err := converter.FromBroadcastEvent(req.Event) if err != nil { - logging.From(stream.Context()).Error(err) - return err + return nil, err } + s.backend.Coordinator.PublishBroadcastEvent(ctx, docID, event.Type, event.Publisher, event) - defer func() { - _ = s.backend.Coordinator.UnsubscribeBroadcasts(stream.Context(), docID, subscription) - }() - - for { - select { - case <-s.serviceCtx.Done(): - return nil - case <-stream.Context().Done(): - return nil - case event := <-subscription.Events(): - pbEvent := converter.ToBroadcastEvent(event) - if err != nil { - return err - } - - if err := stream.Send(&api.WatchBroadcastsResponse{ - Event: pbEvent, - }); err != nil { - return err - } - } - } + return &api.BroadcastResponse{}, nil } -func (s *yorkieServer) SubscribeBroadcast( +func (s *yorkieServer) SubscribeBroadcastEvent( ctx context.Context, - req *api.SubscribeBroadcastRequest, -) (*api.SubscribeBroadcastResponse, error) { + req *api.SubscribeBroadcastEventRequest, +) (*api.SubscribeBroadcastEventResponse, error) { clientID, err := time.ActorIDFromHex(req.ClientId) if err != nil { return nil, err @@ -678,10 +638,9 @@ func (s *yorkieServer) SubscribeBroadcast( return nil, nil } - eventType := types.EventType(req.Type) - + // TODO(sejongk): It seems better to use a separate auth attributes for broadcast if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ - Method: types.WatchBroadcasts, + Method: types.SubscribeBroadcastEvent, Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), }); err != nil { return nil, err @@ -691,16 +650,15 @@ func (s *yorkieServer) SubscribeBroadcast( if _, err = clients.FindClientInfo(ctx, s.backend.DB, project, clientID); err != nil { return nil, err } + s.backend.Coordinator.SubscribeBroadcastEvent(ctx, docID, req.Type, clientID) - s.backend.Coordinator.SubscribeBroadcastEvent(ctx, docID, eventType, req.SubID) - - return &api.SubscribeBroadcastResponse{}, nil + return &api.SubscribeBroadcastEventResponse{}, nil } -func (s *yorkieServer) UnsubscribeBroadcast( +func (s *yorkieServer) UnsubscribeBroadcastEvent( ctx context.Context, - req *api.UnsubscribeBroadcastRequest, -) (*api.UnsubscribeBroadcastResponse, error) { + req *api.UnsubscribeBroadcastEventRequest, +) (*api.UnsubscribeBroadcastEventResponse, error) { clientID, err := time.ActorIDFromHex(req.ClientId) if err != nil { return nil, err @@ -720,10 +678,8 @@ func (s *yorkieServer) UnsubscribeBroadcast( return nil, nil } - eventType := types.EventType(req.Type) - if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ - Method: types.WatchBroadcasts, + Method: types.UnsubscribeBroadcastEvent, Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), }); err != nil { return nil, err @@ -734,7 +690,7 @@ func (s *yorkieServer) UnsubscribeBroadcast( return nil, err } - s.backend.Coordinator.UnsubscribeBroadcastEvent(ctx, docID, eventType, req.SubID) + s.backend.Coordinator.UnsubscribeBroadcastEvent(ctx, docID, req.Type, clientID) - return &api.UnsubscribeBroadcastResponse{}, nil + return &api.UnsubscribeBroadcastEventResponse{}, nil } From 8b2a9a733bcbafd66b261957d8fa19ebd788f643 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 11:11:55 +0900 Subject: [PATCH 09/24] Implement broadcast-related methods for client --- client/client.go | 244 ++++++++++++++++++++++-------- pkg/document/document.go | 104 ++++++++++++- test/integration/document_test.go | 54 +++++++ 3 files changed, 332 insertions(+), 70 deletions(-) diff --git a/client/client.go b/client/client.go index 453fccbb6..6a03d4c4b 100644 --- a/client/client.go +++ b/client/client.go @@ -409,6 +409,8 @@ func (c *Client) Watch( } rch := make(chan WatchResponse) + bch := make(chan *api.BroadcastEvent) + stream, err := c.client.WatchDocument( withShardKey(ctx, c.options.APIKey, doc.Key().String()), &api.WatchDocumentRequest{ @@ -420,69 +422,11 @@ func (c *Client) Watch( return nil, err } - handleResponse := func(pbResp *api.WatchDocumentResponse) (*WatchResponse, error) { - switch resp := pbResp.Body.(type) { - case *api.WatchDocumentResponse_Initialization_: - var clientIDs []string - for _, clientID := range resp.Initialization.ClientIds { - id, err := time.ActorIDFromHex(clientID) - if err != nil { - return nil, err - } - clientIDs = append(clientIDs, id.String()) - } - - doc.SetOnlineClients(clientIDs...) - return nil, nil - case *api.WatchDocumentResponse_Event: - eventType, err := converter.FromEventType(resp.Event.Type) - if err != nil { - return nil, err - } - - cli, err := time.ActorIDFromHex(resp.Event.Publisher) - if err != nil { - return nil, err - } - - switch eventType { - case types.DocumentChangedEvent: - return &WatchResponse{Type: DocumentChanged}, nil - case types.DocumentWatchedEvent: - doc.AddOnlineClient(cli.String()) - if doc.Presence(cli.String()) == nil { - return nil, nil - } - - return &WatchResponse{ - Type: DocumentWatched, - Presences: map[string]innerpresence.Presence{ - cli.String(): doc.Presence(cli.String()), - }, - }, nil - case types.DocumentUnwatchedEvent: - p := doc.Presence(cli.String()) - doc.RemoveOnlineClient(cli.String()) - if p == nil { - return nil, nil - } - - return &WatchResponse{ - Type: DocumentUnwatched, - Presences: map[string]innerpresence.Presence{ - cli.String(): p, - }, - }, nil - } - } - return nil, ErrUnsupportedWatchResponseType - } - pbResp, err := stream.Recv() if err != nil { return nil, err } - if _, err := handleResponse(pbResp); err != nil { + if _, err := handleResponse(pbResp, doc, bch); err != nil { return nil, err } @@ -494,7 +438,7 @@ func (c *Client) Watch( close(rch) return } - resp, err := handleResponse(pbResp) + resp, err := handleResponse(pbResp, doc, bch) if err != nil { rch <- WatchResponse{Err: err} close(rch) @@ -520,7 +464,7 @@ func (c *Client) Watch( go func() { for { select { - case e := <-doc.Events(): + case e := <-doc.DocEvents(): t := PresenceChanged if e.Type == document.WatchedEvent { t = DocumentWatched @@ -534,10 +478,107 @@ func (c *Client) Watch( } }() + go func() { + for { + select { + case r := <-doc.BroadcastRequests(): + // TODO(sejongk): How to deal with errors in the goroutine? + switch r.RequestType { + case document.Broadcast: + _ = c.broadcast(ctx, doc, r.EventType, r.Payload) + case document.Subscribe: + _ = c.subscribeBroadcastEvent(ctx, doc, r.EventType) + case document.Unsubscribe: + _ = c.unsubscribeBroadcastEvent(ctx, doc, r.EventType) + } + case b := <-bch: + if handler, ok := doc.BroadcastEventHandlers()[b.Type]; ok && handler != nil { + err := handler(b.Type, b.Publisher, b.Payload) + if err != nil { + if c.logger.Core().Enabled(zap.DebugLevel) { + c.logger.Debug("broadcast event handling error", zap.Error(err)) + } + } + } + case <-ctx.Done(): + return + } + } + }() + return rch, nil } -func (c *Client) findDocKey(docID string) (key.Key, error) { +func handleResponse( + pbResp *api.WatchDocumentResponse, + doc *document.Document, + bch chan *api.BroadcastEvent, +) (*WatchResponse, error) { + switch resp := pbResp.Body.(type) { + case *api.WatchDocumentResponse_Initialization_: + var clientIDs []string + for _, clientID := range resp.Initialization.ClientIds { + id, err := time.ActorIDFromHex(clientID) + if err != nil { + return nil, err + } + clientIDs = append(clientIDs, id.String()) + } + + doc.SetOnlineClients(clientIDs...) + return nil, nil + case *api.WatchDocumentResponse_DocEvent: + // Handle a document event + eventType, err := converter.FromEventType(resp.DocEvent.Type) + if err != nil { + return nil, err + } + + cli, err := time.ActorIDFromHex(resp.DocEvent.Publisher) + if err != nil { + return nil, err + } + + switch eventType { + case types.DocumentChangedEvent: + return &WatchResponse{Type: DocumentChanged}, nil + case types.DocumentWatchedEvent: + doc.AddOnlineClient(cli.String()) + if doc.Presence(cli.String()) == nil { + return nil, nil + } + + return &WatchResponse{ + Type: DocumentWatched, + Presences: map[string]innerpresence.Presence{ + cli.String(): doc.Presence(cli.String()), + }, + }, nil + case types.DocumentUnwatchedEvent: + p := doc.Presence(cli.String()) + doc.RemoveOnlineClient(cli.String()) + if p == nil { + return nil, nil + } + + return &WatchResponse{ + Type: DocumentUnwatched, + Presences: map[string]innerpresence.Presence{ + cli.String(): p, + }, + }, nil + } + + case *api.WatchDocumentResponse_BroadcastEvent: + // Handle a broadcast event + bch <- resp.BroadcastEvent + return nil, nil + } + return nil, ErrUnsupportedWatchResponseType +} + +// FindDocKey returns the document key of the given document id. +func (c *Client) FindDocKey(docID string) (key.Key, error) { for _, attachment := range c.attachments { if attachment.docID.String() == docID { return attachment.doc.Key(), nil @@ -650,6 +691,85 @@ func (c *Client) Remove(ctx context.Context, doc *document.Document) error { return nil } +func (c *Client) broadcast(ctx context.Context, doc *document.Document, eventType string, payload []byte) error { + if c.status != activated { + return ErrClientNotActivated + } + + attachment, ok := c.attachments[doc.Key()] + if !ok { + return ErrDocumentNotAttached + } + + _, err := c.client.Broadcast( + withShardKey(ctx, c.options.APIKey, doc.Key().String()), + &api.BroadcastRequest{ + ClientId: c.id.String(), + DocumentId: attachment.docID.String(), + Event: &api.BroadcastEvent{ + Type: eventType, + Publisher: c.id.String(), + Payload: payload, + }, + }, + ) + if err != nil { + return err + } + + return nil +} + +func (c *Client) subscribeBroadcastEvent(ctx context.Context, doc *document.Document, eventType string) error { + if c.status != activated { + return ErrClientNotActivated + } + + attachment, ok := c.attachments[doc.Key()] + if !ok { + return ErrDocumentNotAttached + } + + _, err := c.client.SubscribeBroadcastEvent( + withShardKey(ctx, c.options.APIKey, doc.Key().String()), + &api.SubscribeBroadcastEventRequest{ + ClientId: c.id.String(), + DocumentId: attachment.docID.String(), + Type: eventType, + }, + ) + if err != nil { + return err + } + + return nil +} + +func (c *Client) unsubscribeBroadcastEvent(ctx context.Context, doc *document.Document, eventType string) error { + if c.status != activated { + return ErrClientNotActivated + } + + attachment, ok := c.attachments[doc.Key()] + if !ok { + return ErrDocumentNotAttached + } + + _, err := c.client.UnsubscribeBroadcastEvent( + withShardKey(ctx, c.options.APIKey, doc.Key().String()), + &api.UnsubscribeBroadcastEventRequest{ + ClientId: c.id.String(), + DocumentId: attachment.docID.String(), + Type: eventType, + }, + ) + if err != nil { + return err + } + + return nil +} + /** * withShardKey returns a context with the given shard key in metadata. */ diff --git a/pkg/document/document.go b/pkg/document/document.go index d9ca6b2dd..9e7b1fd36 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -18,6 +18,7 @@ package document import ( + gojson "encoding/json" "fmt" "github.com/yorkie-team/yorkie/pkg/document/change" @@ -52,6 +53,27 @@ const ( PresenceChangedEvent DocEventType = "presence-changed" ) +// BroadcastRequest represents a request related to "Broadcast" that will be sent +// through the client. +type BroadcastRequest struct { + RequestType BroadcastRequestType + EventType string + Payload []byte +} + +// BroadcastRequestType represents the type of the broadcast request that will be +// sent through the client. +type BroadcastRequestType string + +const ( + // Broadcast means that there is a new message that should be broadcasted. + Broadcast BroadcastRequestType = "broadcast" + // Subscribe means that the document subscribes a new broadcast event. + Subscribe BroadcastRequestType = "subscribe" + // Unsubscribe means that the document unsubscribes the broadcast event. + Unsubscribe BroadcastRequestType = "unsubscribe" +) + // Document represents a document accessible to the user. // // How document works: @@ -71,15 +93,28 @@ type Document struct { // is used to protect `doc.presences`. clonePresences *innerpresence.Map - // events is the channel to send events that occurred in the document. - events chan DocEvent + // docEvents is the channel to send events that occurred in the document. + docEvents chan DocEvent + + // broadcastRequests is the channel to send requests related to "Broadcast" + // that occurred in the document. + broadcastRequests chan BroadcastRequest + + // broadcastEventHandlers is a map of registered event handlers for events. + broadcastEventHandlers map[string]func( + eventType, publisher string, + payload []byte) error } // New creates a new instance of Document. func New(key key.Key) *Document { return &Document{ - doc: NewInternalDocument(key), - events: make(chan DocEvent, 1), + doc: NewInternalDocument(key), + docEvents: make(chan DocEvent, 1), + broadcastRequests: make(chan BroadcastRequest, 1), + broadcastEventHandlers: make(map[string]func( + eventType, publisher string, + payload []byte) error), } } @@ -151,7 +186,7 @@ func (d *Document) ApplyChangePack(pack *change.Pack) error { } for _, e := range events { - d.events <- e + d.docEvents <- e } } @@ -330,9 +365,62 @@ func (d *Document) RemoveOnlineClient(clientID string) { d.doc.RemoveOnlineClient(clientID) } -// Events returns the events of this document. -func (d *Document) Events() <-chan DocEvent { - return d.events +// DocEvents returns the document events of this document. +func (d *Document) DocEvents() <-chan DocEvent { + return d.docEvents +} + +// BroadcastRequests returns the broadcast requests of this document. +func (d *Document) BroadcastRequests() <-chan BroadcastRequest { + return d.broadcastRequests +} + +// Broadcast encodes the payload and makes a "Broadcast" type request. +func (d *Document) Broadcast(eventType string, payload any) error { + marshaled, err := gojson.Marshal(payload) + if err != nil { + return fmt.Errorf("marshal payload in broadcast event: %w", err) + } + + d.broadcastRequests <- BroadcastRequest{ + RequestType: Broadcast, + EventType: eventType, + Payload: marshaled, + } + return nil +} + +// SubscribeBroadcastEvent registers an event handler and makes +// a "Subscribe" type request. +func (d *Document) SubscribeBroadcastEvent( + eventType string, + handler func(eventType, publisher string, payload []byte) error, +) { + d.broadcastEventHandlers[eventType] = handler + + d.broadcastRequests <- BroadcastRequest{ + RequestType: Subscribe, + EventType: eventType, + } +} + +// UnsubscribeBroadcastEvent deregisters the event handler and makes +// a "Unsubscribe" type request. +func (d *Document) UnsubscribeBroadcastEvent( + eventType string, +) { + delete(d.broadcastEventHandlers, eventType) + + d.broadcastRequests <- BroadcastRequest{ + RequestType: Unsubscribe, + EventType: eventType, + } +} + +// BroadcastEventHandlers returns registered event handlers for events. +func (d *Document) BroadcastEventHandlers() map[string](func(eventType string, + publisher string, payload []byte) error) { + return d.broadcastEventHandlers } func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { diff --git a/test/integration/document_test.go b/test/integration/document_test.go index c190fe9ae..c424a4df9 100644 --- a/test/integration/document_test.go +++ b/test/integration/document_test.go @@ -20,9 +20,11 @@ package integration import ( "context" + gojson "encoding/json" "io" "sync" "testing" + "time" "github.com/stretchr/testify/assert" @@ -418,6 +420,58 @@ func TestDocument(t *testing.T) { _, err = c1.Watch(watchCtx, d1) assert.ErrorIs(t, err, client.ErrDocumentNotAttached) }) + + t.Run("broadcast to subscriber except publisher test", func(t *testing.T) { + bch := make(chan string) + ctx := context.Background() + handler := func(eventType, publisher string, payload []byte) error { + var mentionedBy string + assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) + bch <- mentionedBy + return nil + } + + d1 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c1.Attach(ctx, d1)) + rch1, err := c1.Watch(ctx, d1) + assert.NoError(t, err) + d1.SubscribeBroadcastEvent("mention", handler) + + d2 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c2.Attach(ctx, d2)) + rch2, err := c2.Watch(ctx, d2) + assert.NoError(t, err) + d2.SubscribeBroadcastEvent("mention", handler) + + err = d2.Broadcast("mention", "yorkie") + assert.NoError(t, err) + + wg := sync.WaitGroup{} + wg.Add(1) + go func() { + defer wg.Done() + rcv := 0 + for { + select { + case <-rch1: + case <-rch2: + case m := <-bch: + assert.Equal(t, "yorkie", m) + rcv++ + case <-time.After(3 * time.Second): + assert.Equal(t, 1, rcv) + return + case <-ctx.Done(): + return + } + } + }() + + wg.Wait() + }) + + // TODO(sejongk): broadcast to multiple subscribers + // TODO(sejongk): dont broadcast to unsubscribers } func TestDocumentWithProjects(t *testing.T) { From b59928df1e10e9d699fed9885497bfde3d6aed9d Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 11:44:46 +0900 Subject: [PATCH 10/24] Refuse to subscribe to document type for broadcasting --- api/types/event.go | 3 ++- pkg/document/document.go | 25 +++++++++++++++++++++++-- test/integration/document_test.go | 7 +++++-- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/api/types/event.go b/api/types/event.go index 394614781..e3507848f 100644 --- a/api/types/event.go +++ b/api/types/event.go @@ -9,7 +9,8 @@ type DocEvent struct { DocumentID ID } -// BroadcastEvent represents events that are delievered to subscribers. +// BroadcastEvent represents events that are delievered to broadcast +// event subscribers. type BroadcastEvent struct { Type string Publisher *time.ActorID diff --git a/pkg/document/document.go b/pkg/document/document.go index 9e7b1fd36..ad4f8164d 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -19,6 +19,7 @@ package document import ( gojson "encoding/json" + "errors" "fmt" "github.com/yorkie-team/yorkie/pkg/document/change" @@ -30,6 +31,12 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/time" ) +var ( + // ErrReservedEventType is returned when the event type is "document". + ErrReservedEventType = errors.New( + "the \"document\" event type is reserved for document events") +) + // DocEvent represents the event that occurred in the document. type DocEvent struct { Type DocEventType @@ -377,6 +384,10 @@ func (d *Document) BroadcastRequests() <-chan BroadcastRequest { // Broadcast encodes the payload and makes a "Broadcast" type request. func (d *Document) Broadcast(eventType string, payload any) error { + if eventType == "document" { + return ErrReservedEventType + } + marshaled, err := gojson.Marshal(payload) if err != nil { return fmt.Errorf("marshal payload in broadcast event: %w", err) @@ -395,26 +406,36 @@ func (d *Document) Broadcast(eventType string, payload any) error { func (d *Document) SubscribeBroadcastEvent( eventType string, handler func(eventType, publisher string, payload []byte) error, -) { +) error { + if eventType == "document" { + return ErrReservedEventType + } + d.broadcastEventHandlers[eventType] = handler d.broadcastRequests <- BroadcastRequest{ RequestType: Subscribe, EventType: eventType, } + return nil } // UnsubscribeBroadcastEvent deregisters the event handler and makes // a "Unsubscribe" type request. func (d *Document) UnsubscribeBroadcastEvent( eventType string, -) { +) error { + if eventType == "document" { + return ErrReservedEventType + } + delete(d.broadcastEventHandlers, eventType) d.broadcastRequests <- BroadcastRequest{ RequestType: Unsubscribe, EventType: eventType, } + return nil } // BroadcastEventHandlers returns registered event handlers for events. diff --git a/test/integration/document_test.go b/test/integration/document_test.go index c424a4df9..87bf0a7b3 100644 --- a/test/integration/document_test.go +++ b/test/integration/document_test.go @@ -435,13 +435,15 @@ func TestDocument(t *testing.T) { assert.NoError(t, c1.Attach(ctx, d1)) rch1, err := c1.Watch(ctx, d1) assert.NoError(t, err) - d1.SubscribeBroadcastEvent("mention", handler) + err = d1.SubscribeBroadcastEvent("mention", handler) + assert.NoError(t, err) d2 := document.New(helper.TestDocKey(t)) assert.NoError(t, c2.Attach(ctx, d2)) rch2, err := c2.Watch(ctx, d2) assert.NoError(t, err) - d2.SubscribeBroadcastEvent("mention", handler) + err = d2.SubscribeBroadcastEvent("mention", handler) + assert.NoError(t, err) err = d2.Broadcast("mention", "yorkie") assert.NoError(t, err) @@ -472,6 +474,7 @@ func TestDocument(t *testing.T) { // TODO(sejongk): broadcast to multiple subscribers // TODO(sejongk): dont broadcast to unsubscribers + // TODO(sejongk): reject subscribing document for broadcast } func TestDocumentWithProjects(t *testing.T) { From 0b1dd74f3358387da5658e557e293d579dfcc30a Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 11:53:18 +0900 Subject: [PATCH 11/24] Apply lint --- pkg/document/document.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/document/document.go b/pkg/document/document.go index ad4f8164d..2e92eced7 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -384,7 +384,7 @@ func (d *Document) BroadcastRequests() <-chan BroadcastRequest { // Broadcast encodes the payload and makes a "Broadcast" type request. func (d *Document) Broadcast(eventType string, payload any) error { - if eventType == "document" { + if isEventTypeReserved(eventType) { return ErrReservedEventType } @@ -407,7 +407,7 @@ func (d *Document) SubscribeBroadcastEvent( eventType string, handler func(eventType, publisher string, payload []byte) error, ) error { - if eventType == "document" { + if isEventTypeReserved(eventType) { return ErrReservedEventType } @@ -425,7 +425,7 @@ func (d *Document) SubscribeBroadcastEvent( func (d *Document) UnsubscribeBroadcastEvent( eventType string, ) error { - if eventType == "document" { + if isEventTypeReserved(eventType) { return ErrReservedEventType } @@ -460,3 +460,10 @@ func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { } return "" } + +func isEventTypeReserved(eventType string) bool { + if eventType == "document" { + return true + } + return false +} From 676d29e78df7097636c4e71769bd2ea89da8a54f Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 14:25:10 +0900 Subject: [PATCH 12/24] Remove duplicated data in broadcast request --- api/converter/from_pb.go | 13 -- api/yorkie/v1/yorkie.pb.go | 204 +++++++++++++--------- api/yorkie/v1/yorkie.proto | 3 +- client/client.go | 7 +- server/backend/sync/coordinator.go | 2 - server/backend/sync/memory/coordinator.go | 4 +- server/rpc/yorkie_server.go | 11 +- 7 files changed, 138 insertions(+), 106 deletions(-) diff --git a/api/converter/from_pb.go b/api/converter/from_pb.go index 9f0d9be9d..dcc119b6f 100644 --- a/api/converter/from_pb.go +++ b/api/converter/from_pb.go @@ -856,16 +856,3 @@ func FromUpdatableProjectFields(pbProjectFields *api.UpdatableProjectFields) (*t return updatableProjectFields, nil } - -// FromBroadcastEvent converts the given Protobuf event to types.BroadcastEvent. -func FromBroadcastEvent(event *api.BroadcastEvent) (types.BroadcastEvent, error) { - publisher, err := time.ActorIDFromHex(event.Publisher) - if err != nil { - return types.BroadcastEvent{}, err - } - return types.BroadcastEvent{ - Type: event.Type, - Publisher: publisher, - Payload: event.Payload, - }, nil -} diff --git a/api/yorkie/v1/yorkie.pb.go b/api/yorkie/v1/yorkie.pb.go index 8a330a9d2..636c4f960 100644 --- a/api/yorkie/v1/yorkie.pb.go +++ b/api/yorkie/v1/yorkie.pb.go @@ -1070,12 +1070,13 @@ func (m *UnsubscribeBroadcastEventResponse) XXX_DiscardUnknown() { var xxx_messageInfo_UnsubscribeBroadcastEventResponse proto.InternalMessageInfo type BroadcastRequest struct { - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - Event *BroadcastEvent `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *BroadcastRequest) Reset() { *m = BroadcastRequest{} } @@ -1125,9 +1126,16 @@ func (m *BroadcastRequest) GetDocumentId() string { return "" } -func (m *BroadcastRequest) GetEvent() *BroadcastEvent { +func (m *BroadcastRequest) GetType() string { if m != nil { - return m.Event + return m.Type + } + return "" +} + +func (m *BroadcastRequest) GetPayload() []byte { + if m != nil { + return m.Payload } return nil } @@ -1198,58 +1206,58 @@ func init() { func init() { proto.RegisterFile("yorkie/v1/yorkie.proto", fileDescriptor_40070c858814ab24) } var fileDescriptor_40070c858814ab24 = []byte{ - // 810 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x4f, 0xdb, 0x48, - 0x14, 0x8f, 0x21, 0xcb, 0x26, 0x2f, 0x22, 0xc0, 0xb0, 0x09, 0xc1, 0xec, 0x86, 0x30, 0x5c, 0xd8, - 0x65, 0x95, 0x6c, 0x82, 0x96, 0xcb, 0x9e, 0x80, 0xac, 0x44, 0x54, 0xa9, 0x4d, 0x4d, 0x5b, 0x04, - 0x52, 0x65, 0x39, 0xf6, 0xd0, 0x58, 0x09, 0x9e, 0x60, 0x4f, 0xac, 0xa6, 0xb7, 0x7e, 0x80, 0xde, - 0xfb, 0x05, 0x7a, 0xea, 0x77, 0xe8, 0xa1, 0xa7, 0x1e, 0xfb, 0x11, 0x2a, 0xfa, 0x45, 0xaa, 0xd8, - 0x13, 0xe3, 0x31, 0x4e, 0x48, 0x0b, 0x6a, 0x7b, 0x9b, 0xbc, 0x79, 0xbf, 0xdf, 0xfb, 0xf9, 0xe5, - 0xfd, 0x19, 0xc8, 0x0f, 0xa8, 0xdd, 0x31, 0x49, 0xc5, 0xad, 0x56, 0xfc, 0x53, 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, 0x4c, 0x02, 0x71, 0xec, 0x0c, 0x15, 0x88, 0xe3, 0xc7, 0x1a, 0x4e, 0xa0, 0x53, 0x58, - 0x88, 0xb4, 0x3c, 0x0a, 0xe3, 0xe2, 0x67, 0x97, 0x8c, 0x27, 0xb9, 0x04, 0xdc, 0x4f, 0x60, 0x5e, - 0xd8, 0x65, 0x68, 0x7d, 0xfc, 0x96, 0xf3, 0x79, 0x4b, 0x37, 0xad, 0x41, 0x9c, 0xf8, 0x47, 0x42, - 0x87, 0x90, 0x0e, 0xaa, 0x13, 0xad, 0xc5, 0x15, 0xf3, 0x88, 0xef, 0xf7, 0xf8, 0xcb, 0x40, 0xa1, - 0x0d, 0x2b, 0x63, 0x26, 0x05, 0xfa, 0x33, 0x04, 0x9d, 0x3c, 0xc1, 0xe4, 0xbf, 0xa6, 0x71, 0x0d, - 0x62, 0x3e, 0x87, 0xd5, 0xb1, 0x43, 0x00, 0x6d, 0x87, 0xa8, 0x6e, 0x1a, 0x50, 0xf2, 0xdf, 0xd3, - 0x39, 0x8f, 0x22, 0xef, 0x6f, 0x7f, 0xb8, 0x2c, 0x4a, 0x1f, 0x2f, 0x8b, 0xd2, 0xa7, 0xcb, 0xa2, - 0xf4, 0xfa, 0x73, 0x31, 0x01, 0x4b, 0x06, 0x71, 0x47, 0x24, 0x5a, 0xcf, 0x2c, 0xbb, 0xd5, 0xa6, - 0x74, 0x9a, 0x2c, 0xff, 0xe7, 0x56, 0x5b, 0x73, 0xde, 0xdb, 0x7e, 0xe7, 0x4b, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x2d, 0x96, 0xd2, 0x36, 0x1b, 0x0c, 0x00, 0x00, + // 813 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x53, 0xd3, 0x40, + 0x14, 0x6f, 0xa0, 0x03, 0xed, 0xab, 0x14, 0x58, 0x6c, 0x29, 0x41,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, 0x3a, 0x51, 0x7a, 0x27, 0x63, 0x22, 0xa2, 0x2d, 0xc8, 0x28, 0x6d, 0xd9, 0x78, 0x8d, 0xa5, + 0xae, 0xac, 0x74, 0x0a, 0x13, 0x25, 0x6e, 0x3d, 0x53, 0xcb, 0x95, 0x83, 0xa2, 0x95, 0x77, 0xdd, + 0xdd, 0xa6, 0xac, 0x74, 0x44, 0x50, 0x82, 0xb5, 0x70, 0x0a, 0xf9, 0x68, 0x36, 0xff, 0xe0, 0x2b, + 0x90, 0x51, 0x7d, 0xdb, 0x79, 0x42, 0x18, 0x98, 0xae, 0x90, 0xf2, 0x0b, 0x07, 0xb9, 0x3a, 0xfe, + 0xe5, 0x13, 0x46, 0xf8, 0x4c, 0x5c, 0xc6, 0x67, 0x72, 0x4c, 0x3e, 0x68, 0x13, 0xf2, 0x26, 0x3e, + 0x21, 0x36, 0x96, 0xb4, 0x63, 0xc9, 0x20, 0x54, 0x92, 0xdd, 0x82, 0x60, 0xb5, 0x90, 0x2c, 0x71, + 0xeb, 0x29, 0x71, 0xc1, 0xdb, 0x6d, 0x1c, 0x3f, 0x21, 0x74, 0xdb, 0xdf, 0x12, 0x9a, 0x90, 0x8f, + 0x9e, 0xc1, 0xaf, 0xdb, 0xef, 0x96, 0xe5, 0x39, 0xdc, 0x3c, 0x90, 0xe9, 0x35, 0x17, 0x45, 0xf8, + 0x38, 0x01, 0xb9, 0x08, 0xac, 0xcf, 0xf3, 0x10, 0xb2, 0x9a, 0xa1, 0x51, 0x4d, 0xd6, 0xb5, 0xb7, + 0x32, 0xd5, 0x88, 0xe1, 0x82, 0x67, 0x6a, 0x95, 0x10, 0xd5, 0xd8, 0xc8, 0x72, 0x83, 0x09, 0xdb, + 0x4b, 0x88, 0x11, 0x20, 0x54, 0x83, 0xb4, 0x4a, 0x14, 0x09, 0xdb, 0xd8, 0xa0, 0x7e, 0x01, 0x16, + 0x42, 0xa8, 0x75, 0xa2, 0x3c, 0xea, 0x6f, 0xed, 0x25, 0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 0xc8, 0xbc, 0xb3, 0xf1, 0xf5, 0xac, 0xc8, 0x7d, 0x3b, 0x2b, 0x72, + 0xdf, 0xcf, 0x8a, 0xdc, 0x87, 0x1f, 0xc5, 0x04, 0xcc, 0xab, 0xd8, 0x1e, 0x80, 0xc8, 0x5d, 0xad, + 0x6c, 0x57, 0x9b, 0xdc, 0x51, 0xb2, 0xfc, 0xd0, 0xae, 0xb6, 0xa6, 0xdc, 0x77, 0xfd, 0xe6, 0xcf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x95, 0x60, 0x5a, 0x17, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2551,15 +2559,17 @@ func (m *BroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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)) - } + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x22 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0x1a } @@ -3019,8 +3029,12 @@ func (m *BroadcastRequest) Size() (n int) { if l > 0 { n += 1 + l + sovYorkie(uint64(l)) } - if m.Event != nil { - l = m.Event.Size() + l = len(m.Type) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + l = len(m.Payload) + if l > 0 { n += 1 + l + sovYorkie(uint64(l)) } if m.XXX_unrecognized != nil { @@ -5184,9 +5198,9 @@ func (m *BroadcastRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYorkie @@ -5196,26 +5210,56 @@ func (m *BroadcastRequest) 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.Event == nil { - m.Event = &BroadcastEvent{} + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) } - if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + 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.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} } iNdEx = postIndex default: diff --git a/api/yorkie/v1/yorkie.proto b/api/yorkie/v1/yorkie.proto index 3b69d96af..e0f9f386e 100644 --- a/api/yorkie/v1/yorkie.proto +++ b/api/yorkie/v1/yorkie.proto @@ -136,7 +136,8 @@ message UnsubscribeBroadcastEventResponse { message BroadcastRequest { string client_id = 1; string document_id = 2; - BroadcastEvent event = 3; + string type = 3; + bytes payload = 4; } message BroadcastResponse { diff --git a/client/client.go b/client/client.go index 6a03d4c4b..3cdce1f8d 100644 --- a/client/client.go +++ b/client/client.go @@ -706,11 +706,8 @@ func (c *Client) broadcast(ctx context.Context, doc *document.Document, eventTyp &api.BroadcastRequest{ ClientId: c.id.String(), DocumentId: attachment.docID.String(), - Event: &api.BroadcastEvent{ - Type: eventType, - Publisher: c.id.String(), - Payload: payload, - }, + Type: eventType, + Payload: payload, }, ) if err != nil { diff --git a/server/backend/sync/coordinator.go b/server/backend/sync/coordinator.go index 96c721fbd..38628b629 100644 --- a/server/backend/sync/coordinator.go +++ b/server/backend/sync/coordinator.go @@ -75,8 +75,6 @@ type Coordinator interface { PublishBroadcastEvent( ctx context.Context, documentID types.ID, - eventType string, - publisherID *time.ActorID, event types.BroadcastEvent, ) diff --git a/server/backend/sync/memory/coordinator.go b/server/backend/sync/memory/coordinator.go index 69ddae3b4..b3f256cf9 100644 --- a/server/backend/sync/memory/coordinator.go +++ b/server/backend/sync/memory/coordinator.go @@ -114,11 +114,9 @@ func (c *Coordinator) UnsubscribeBroadcastEvent( func (c *Coordinator) PublishBroadcastEvent( ctx context.Context, documentID types.ID, - eventType string, - publisherID *time.ActorID, event types.BroadcastEvent, ) { - c.pubSub.Publish(ctx, documentID, eventType, publisherID, event) + c.pubSub.Publish(ctx, documentID, event.Type, event.Publisher, event) } // Members returns the members of this cluster. diff --git a/server/rpc/yorkie_server.go b/server/rpc/yorkie_server.go index e7300c794..e698989c7 100644 --- a/server/rpc/yorkie_server.go +++ b/server/rpc/yorkie_server.go @@ -606,11 +606,18 @@ func (s *yorkieServer) Broadcast( return nil, err } - event, err := converter.FromBroadcastEvent(req.Event) if err != nil { return nil, err } - s.backend.Coordinator.PublishBroadcastEvent(ctx, docID, event.Type, event.Publisher, event) + s.backend.Coordinator.PublishBroadcastEvent( + ctx, + docID, + types.BroadcastEvent{ + Type: req.Type, + Publisher: clientID, + Payload: req.Payload, + }, + ) return &api.BroadcastResponse{}, nil } From ead36d4ffc511c136116538535cb3efdf9b57142 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 17:41:57 +0900 Subject: [PATCH 13/24] Resolve data race for cachedString in ActorID --- pkg/document/time/actor_id.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pkg/document/time/actor_id.go b/pkg/document/time/actor_id.go index 98d1da177..6939369a6 100644 --- a/pkg/document/time/actor_id.go +++ b/pkg/document/time/actor_id.go @@ -23,6 +23,7 @@ import ( "errors" "fmt" "math" + "sync" ) const actorIDSize = 12 @@ -61,7 +62,8 @@ var ( type ActorID struct { bytes [actorIDSize]byte - cachedString string + cachedString string + cachedStringMu sync.RWMutex } // ActorIDFromHex returns the bytes represented by the hexadecimal string str. @@ -104,6 +106,23 @@ func ActorIDFromBytes(bytes []byte) (*ActorID, error) { // String returns the hexadecimal encoding of ActorID. // If the receiver is nil, it would return empty string. func (id *ActorID) String() string { + id.cachedStringMu.RLock() + readLocked := true + defer func() { + if readLocked { + id.cachedStringMu.RUnlock() + } + }() + + if id.cachedString != "" { + return id.cachedString + } + + id.cachedStringMu.RUnlock() + readLocked = false + id.cachedStringMu.Lock() + defer id.cachedStringMu.Unlock() + if id.cachedString == "" { id.cachedString = hex.EncodeToString(id.bytes[:]) } From 2d26653ef09e774fea9ee33278e2c8cebf784161 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 17:44:05 +0900 Subject: [PATCH 14/24] Clean up comments and logging --- pkg/document/document.go | 4 +-- server/backend/sync/coordinator.go | 11 ++++++-- server/backend/sync/memory/pubsub.go | 41 ++++++++++++++++++---------- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/pkg/document/document.go b/pkg/document/document.go index 2e92eced7..3c7cc7342 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -32,9 +32,9 @@ import ( ) var ( - // ErrReservedEventType is returned when the event type is "document". + // ErrReservedEventType is returned when the event type is reserved. ErrReservedEventType = errors.New( - "the \"document\" event type is reserved for document events") + "the event type is reserved for a different use case") ) // DocEvent represents the event that occurred in the document. diff --git a/server/backend/sync/coordinator.go b/server/backend/sync/coordinator.go index 38628b629..4853befdf 100644 --- a/server/backend/sync/coordinator.go +++ b/server/backend/sync/coordinator.go @@ -37,27 +37,29 @@ type Coordinator interface { // NewLocker creates a sync.Locker. NewLocker(ctx context.Context, key Key) (Locker, error) - // Subscribe subscribes to the given documents. + // SubscribeDoc subscribes to the given documents. SubscribeDoc( ctx context.Context, subscriber *time.ActorID, documentID types.ID, ) (*Subscription, []*time.ActorID, error) - // Unsubscribe unsubscribes from the given documents. + // UnsubscribeDoc unsubscribes from the given documents. UnsubscribeDoc( ctx context.Context, documentID types.ID, sub *Subscription, ) error - // Publish publishes the given event. + // PublishDocEvent publishes the given document event. PublishDocEvent( ctx context.Context, publisherID *time.ActorID, event types.DocEvent, ) + // SubscribeBroadcastEvent subscribes to the specified broadcast + // event type for the given document. SubscribeBroadcastEvent( ctx context.Context, documentID types.ID, @@ -65,6 +67,8 @@ type Coordinator interface { subscriber *time.ActorID, ) + // UnsubscribeBroadcastEvent unsubscribes to the specified broadcast + // event type for the given document. UnsubscribeBroadcastEvent( ctx context.Context, documentID types.ID, @@ -72,6 +76,7 @@ type Coordinator interface { subscriber *time.ActorID, ) + // PublishBroadcastEvent publishes the given broadcast event. PublishBroadcastEvent( ctx context.Context, documentID types.ID, diff --git a/server/backend/sync/memory/pubsub.go b/server/backend/sync/memory/pubsub.go index e6f3789b0..fea238d5f 100644 --- a/server/backend/sync/memory/pubsub.go +++ b/server/backend/sync/memory/pubsub.go @@ -32,20 +32,20 @@ import ( // subscriptionIDs is a set of subscriptionIDs. type subscribers map[string]struct{} -func (s subscribers) Add(subscriber *time.ActorID) { +func (s subscribers) add(subscriber *time.ActorID) { s[subscriber.String()] = struct{}{} } -func (s subscribers) Contains(subscriber *time.ActorID) bool { +func (s subscribers) contains(subscriber *time.ActorID) bool { _, exists := s[subscriber.String()] return exists } -func (s subscribers) Remove(subscriber *time.ActorID) { +func (s subscribers) remove(subscriber *time.ActorID) { delete(s, subscriber.String()) } -func (s subscribers) Len() int { +func (s subscribers) len() int { return len(s) } @@ -83,11 +83,11 @@ func (s *DocSubs) Remove(subscriber *time.ActorID) { sub.Close() // Remove the subscriber from the subscriber lists of subscribed events. - for _, t := range sub.Types() { + for t := range sub.Types() { if subscribers, ok := s.subscribersMapByEvent[t]; ok { - subscribers.Remove(subscriber) + subscribers.remove(subscriber) - if subscribers.Len() == 0 { + if subscribers.len() == 0 { delete(s.subscribersMapByEvent, t) } } @@ -106,7 +106,7 @@ func (s *DocSubs) SubscribeEvent(eventType string, subscriber *time.ActorID) { if _, ok := s.subscribersMapByEvent[eventType]; !ok { s.subscribersMapByEvent[eventType] = make(subscribers) } - s.subscribersMapByEvent[eventType].Add(subscriber) + s.subscribersMapByEvent[eventType].add(subscriber) sub.AddType(eventType) } @@ -116,9 +116,9 @@ func (s *DocSubs) SubscribeEvent(eventType string, subscriber *time.ActorID) { func (s *DocSubs) UnsubscribeEvent(eventType string, subscriber *time.ActorID) { if sub, ok := s.subMapBySubscriber[subscriber.String()]; ok { if subscribers, ok := s.subscribersMapByEvent[eventType]; ok { - subscribers.Remove(subscriber) + subscribers.remove(subscriber) - if subscribers.Len() == 0 { + if subscribers.len() == 0 { delete(s.subscribersMapByEvent, eventType) } } @@ -264,7 +264,7 @@ func (m *PubSub) UnsubscribeEvent( if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `SubscribeEvent(%s,%s,%s) Start`, + `UnsubscribeEvent(%s,%s,%s) Start`, documentID, eventType, subscriber, @@ -275,7 +275,7 @@ func (m *PubSub) UnsubscribeEvent( if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `SubscribeEvent(%s,%s,%s) End`, + `UnsubscribeEvent(%s,%s,%s) End`, documentID, eventType, subscriber, @@ -295,7 +295,12 @@ func (m *PubSub) Publish( defer m.docSubsMapMu.RUnlock() if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf(`Publish(%s,%s) Start`, documentID.String(), publisherID.String()) + logging.From(ctx).Debugf( + `Publish(%s,%s,%s) Start`, + documentID, + eventType, + publisherID, + ) } docSubs, ok := m.docSubsMapByDocID[documentID] @@ -334,7 +339,8 @@ func (m *PubSub) Publish( case sub.Events() <- event: case <-gotime.After(100 * gotime.Millisecond): logging.From(ctx).Warnf( - `Publish(%s,%s) to %s timeout`, + `Publish %s(%s,%s) to %s timeout`, + eventType, documentID.String(), publisherID.String(), sub.Subscriber().String(), @@ -343,7 +349,12 @@ func (m *PubSub) Publish( } if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf(`Publish(%s,%s) End`, documentID.String(), publisherID.String()) + logging.From(ctx).Debugf( + `Publish(%s,%s,%s) End`, + documentID, + eventType, + publisherID, + ) } } From f96729ff5fedada93cca4c0528a6ceb99a77eb9f Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 17:45:14 +0900 Subject: [PATCH 15/24] Replace list to set --- server/backend/sync/pubsub.go | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/server/backend/sync/pubsub.go b/server/backend/sync/pubsub.go index 30ae6c9ce..23d3c6b6a 100644 --- a/server/backend/sync/pubsub.go +++ b/server/backend/sync/pubsub.go @@ -22,10 +22,20 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/time" ) +type eventTypes map[string]struct{} + +func (s eventTypes) add(t string) { + s[t] = struct{}{} +} + +func (s eventTypes) remove(t string) { + delete(s, t) +} + // Subscription represents a subscription of a subscriber to documents. type Subscription struct { id string - types []string + types eventTypes subscriber *time.ActorID closed bool events chan Event @@ -35,7 +45,7 @@ type Subscription struct { func NewSubscription(subscriber *time.ActorID) *Subscription { return &Subscription{ id: xid.New().String(), - types: make([]string, 0), + types: make(eventTypes), subscriber: subscriber, events: make(chan Event, 1), } @@ -47,26 +57,18 @@ func (s *Subscription) ID() string { } // Types returns the subscribed event type list. -func (s *Subscription) Types() []string { +func (s *Subscription) Types() eventTypes { return s.types } // AddType adds the event type to the subscribed event type list. func (s *Subscription) AddType(t string) { - s.types = append(s.types, t) + s.types.add(t) } // RemoveType removes the event type from the subscribed event type list. func (s *Subscription) RemoveType(t string) { - found := -1 - for i, v := range s.types { - if v == t { - found = i - } - } - if found != -1 { - s.types = append(s.types[:found], s.types[found+1:]...) - } + s.types.remove(t) } // Events returns the Event channel of this subscription. From 9be6fe1bfc89782b62e5f680a7e5cd9e4b202859 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 17:45:30 +0900 Subject: [PATCH 16/24] Add test cases --- test/integration/document_test.go | 160 ++++++++++++++++++++++++++++-- 1 file changed, 153 insertions(+), 7 deletions(-) diff --git a/test/integration/document_test.go b/test/integration/document_test.go index 87bf0a7b3..2cdd4f73c 100644 --- a/test/integration/document_test.go +++ b/test/integration/document_test.go @@ -37,8 +37,8 @@ import ( ) func TestDocument(t *testing.T) { - clients := activeClients(t, 2) - c1, c2 := clients[0], clients[1] + clients := activeClients(t, 3) + c1, c2, c3 := clients[0], clients[1], clients[2] defer deactivateAndCloseClients(t, clients) t.Run("attach/detach test", func(t *testing.T) { @@ -421,12 +421,14 @@ func TestDocument(t *testing.T) { assert.ErrorIs(t, err, client.ErrDocumentNotAttached) }) - t.Run("broadcast to subscriber except publisher test", func(t *testing.T) { + t.Run("broadcast to subscribers except publisher test", func(t *testing.T) { bch := make(chan string) ctx := context.Background() handler := func(eventType, publisher string, payload []byte) error { var mentionedBy string assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) + // Send the unmarshaled payload to the channel to notify that this + // subscriber receives the event. bch <- mentionedBy return nil } @@ -445,6 +447,150 @@ func TestDocument(t *testing.T) { err = d2.SubscribeBroadcastEvent("mention", handler) assert.NoError(t, err) + d3 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c3.Attach(ctx, d3)) + rch3, err := c3.Watch(ctx, d3) + assert.NoError(t, err) + err = d3.SubscribeBroadcastEvent("mention", handler) + assert.NoError(t, err) + + err = d3.Broadcast("mention", "yorkie") + assert.NoError(t, err) + + wg := sync.WaitGroup{} + wg.Add(1) + go func() { + defer wg.Done() + rcv := 0 + for { + select { + case <-rch1: + case <-rch2: + case <-rch3: + case m := <-bch: + assert.Equal(t, "yorkie", m) + rcv++ + case <-time.After(1 * time.Second): + // Assuming that all subscribers can receive the broadcast + // event within this timeout period, check if the subscribers, + // except the publisher, successfully receive the event. + assert.Equal(t, 2, rcv) + return + case <-ctx.Done(): + return + } + } + }() + + wg.Wait() + }) + + t.Run("refuse to subscribe document type for broadcasting", func(t *testing.T) { + ctx := context.Background() + + d1 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c1.Attach(ctx, d1)) + _, err := c1.Watch(ctx, d1) + assert.NoError(t, err) + err = d1.SubscribeBroadcastEvent("document", nil) + assert.ErrorIs(t, err, document.ErrReservedEventType) + }) + + t.Run("no broadcasts to unsubscribers", func(t *testing.T) { + bch := make(chan string) + ctx := context.Background() + handler := func(eventType, publisher string, payload []byte) error { + var mentionedBy string + assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) + // Send the unmarshaled payload to the channel to notify that this + // subscriber receives the event. + bch <- mentionedBy + return nil + } + + d1 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c1.Attach(ctx, d1)) + rch1, err := c1.Watch(ctx, d1) + assert.NoError(t, err) + err = d1.SubscribeBroadcastEvent("mention", handler) + assert.NoError(t, err) + + d2 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c2.Attach(ctx, d2)) + rch2, err := c2.Watch(ctx, d2) + assert.NoError(t, err) + err = d2.SubscribeBroadcastEvent("mention", handler) + assert.NoError(t, err) + + // d1 unsubscribes to the broadcast event. + err = d1.UnsubscribeBroadcastEvent("mention") + assert.NoError(t, err) + + err = d2.Broadcast("mention", "yorkie") + assert.NoError(t, err) + + wg := sync.WaitGroup{} + wg.Add(1) + go func() { + defer wg.Done() + rcv := 0 + for { + select { + case <-rch1: + case <-rch2: + case m := <-bch: + assert.Equal(t, "yorkie", m) + rcv++ + case <-time.After(1 * time.Second): + // Assuming that all subscribers can receive the broadcast + // event within this timeout period, check if the unsubscriber + // doesn't receive the event. + assert.Equal(t, 0, rcv) + return + case <-ctx.Done(): + return + } + } + }() + + wg.Wait() + }) + + t.Run("no duplicate broadcasts for duplicate subscriptions", func(t *testing.T) { + // t.Skip() + bch := make(chan string) + ctx := context.Background() + handler := func(eventType, publisher string, payload []byte) error { + var mentionedBy string + assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) + // Send the unmarshaled payload to the channel to notify that this + // subscriber receives the event. + bch <- mentionedBy + return nil + } + + d1 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c1.Attach(ctx, d1)) + rch1, err := c1.Watch(ctx, d1) + assert.NoError(t, err) + err = d1.SubscribeBroadcastEvent("mention", handler) + assert.NoError(t, err) + + println("second sub start") + + // d1 subscribes to the broadcast event twice. + err = d1.SubscribeBroadcastEvent("mention", handler) + assert.NoError(t, err) + + println("second sub end") + + d2 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c2.Attach(ctx, d2)) + rch2, err := c2.Watch(ctx, d2) + assert.NoError(t, err) + err = d2.SubscribeBroadcastEvent("mention", handler) + assert.NoError(t, err) + err = d2.Broadcast("mention", "yorkie") assert.NoError(t, err) @@ -460,7 +606,10 @@ func TestDocument(t *testing.T) { case m := <-bch: assert.Equal(t, "yorkie", m) rcv++ - case <-time.After(3 * time.Second): + case <-time.After(1 * time.Second): + // Assuming that all subscribers can receive the broadcast + // event within this timeout period, check if the unsubscriber + // doesn't receive the event. assert.Equal(t, 1, rcv) return case <-ctx.Done(): @@ -472,9 +621,6 @@ func TestDocument(t *testing.T) { wg.Wait() }) - // TODO(sejongk): broadcast to multiple subscribers - // TODO(sejongk): dont broadcast to unsubscribers - // TODO(sejongk): reject subscribing document for broadcast } func TestDocumentWithProjects(t *testing.T) { From 6dc5b7b9640073a2d5dcf29e89d79b29e85def82 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 6 Sep 2023 17:58:54 +0900 Subject: [PATCH 17/24] Add test cases and apply lint --- server/backend/sync/pubsub.go | 19 +++++++++++-------- test/integration/document_test.go | 5 ----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/server/backend/sync/pubsub.go b/server/backend/sync/pubsub.go index 23d3c6b6a..7f6b24402 100644 --- a/server/backend/sync/pubsub.go +++ b/server/backend/sync/pubsub.go @@ -22,20 +22,23 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/time" ) -type eventTypes map[string]struct{} +// EventTypes stores the subscribed event types. +type EventTypes map[string]struct{} -func (s eventTypes) add(t string) { +// Add adds the given type to EventTypes. +func (s EventTypes) Add(t string) { s[t] = struct{}{} } -func (s eventTypes) remove(t string) { +// Remove removes the given type from EventTypes. +func (s EventTypes) Remove(t string) { delete(s, t) } // Subscription represents a subscription of a subscriber to documents. type Subscription struct { id string - types eventTypes + types EventTypes subscriber *time.ActorID closed bool events chan Event @@ -45,7 +48,7 @@ type Subscription struct { func NewSubscription(subscriber *time.ActorID) *Subscription { return &Subscription{ id: xid.New().String(), - types: make(eventTypes), + types: make(EventTypes), subscriber: subscriber, events: make(chan Event, 1), } @@ -57,18 +60,18 @@ func (s *Subscription) ID() string { } // Types returns the subscribed event type list. -func (s *Subscription) Types() eventTypes { +func (s *Subscription) Types() EventTypes { return s.types } // AddType adds the event type to the subscribed event type list. func (s *Subscription) AddType(t string) { - s.types.add(t) + s.types.Add(t) } // RemoveType removes the event type from the subscribed event type list. func (s *Subscription) RemoveType(t string) { - s.types.remove(t) + s.types.Remove(t) } // Events returns the Event channel of this subscription. diff --git a/test/integration/document_test.go b/test/integration/document_test.go index 2cdd4f73c..4c1691f65 100644 --- a/test/integration/document_test.go +++ b/test/integration/document_test.go @@ -557,7 +557,6 @@ func TestDocument(t *testing.T) { }) t.Run("no duplicate broadcasts for duplicate subscriptions", func(t *testing.T) { - // t.Skip() bch := make(chan string) ctx := context.Background() handler := func(eventType, publisher string, payload []byte) error { @@ -576,14 +575,10 @@ func TestDocument(t *testing.T) { err = d1.SubscribeBroadcastEvent("mention", handler) assert.NoError(t, err) - println("second sub start") - // d1 subscribes to the broadcast event twice. err = d1.SubscribeBroadcastEvent("mention", handler) assert.NoError(t, err) - println("second sub end") - d2 := document.New(helper.TestDocKey(t)) assert.NoError(t, c2.Attach(ctx, d2)) rch2, err := c2.Watch(ctx, d2) From de2ee7d5bd20542da1793343d1017f566b06df1f Mon Sep 17 00:00:00 2001 From: sejongk Date: Thu, 7 Sep 2023 18:01:09 +0900 Subject: [PATCH 18/24] Add test cases --- pkg/document/document.go | 11 ++--- test/integration/document_test.go | 72 +++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 5 deletions(-) diff --git a/pkg/document/document.go b/pkg/document/document.go index 3c7cc7342..bda65b1a2 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -35,6 +35,10 @@ var ( // ErrReservedEventType is returned when the event type is reserved. ErrReservedEventType = errors.New( "the event type is reserved for a different use case") + + // ErrUnsupportedPayloadType is returned when the payload is unserializable to JSON. + ErrUnsupportedPayloadType = errors.New( + "the payload is an unsupported JSON type") ) // DocEvent represents the event that occurred in the document. @@ -390,7 +394,7 @@ func (d *Document) Broadcast(eventType string, payload any) error { marshaled, err := gojson.Marshal(payload) if err != nil { - return fmt.Errorf("marshal payload in broadcast event: %w", err) + return ErrUnsupportedPayloadType } d.broadcastRequests <- BroadcastRequest{ @@ -462,8 +466,5 @@ func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { } func isEventTypeReserved(eventType string) bool { - if eventType == "document" { - return true - } - return false + return eventType == "document" } diff --git a/test/integration/document_test.go b/test/integration/document_test.go index 4c1691f65..d685b0424 100644 --- a/test/integration/document_test.go +++ b/test/integration/document_test.go @@ -616,6 +616,78 @@ func TestDocument(t *testing.T) { wg.Wait() }) + t.Run("unsubscriber can broadcast", func(t *testing.T) { + bch := make(chan string) + ctx := context.Background() + handler := func(eventType, publisher string, payload []byte) error { + var mentionedBy string + assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) + // Send the unmarshaled payload to the channel to notify that this + // subscriber receives the event. + bch <- mentionedBy + return nil + } + + d1 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c1.Attach(ctx, d1)) + rch1, err := c1.Watch(ctx, d1) + assert.NoError(t, err) + err = d1.SubscribeBroadcastEvent("mention", handler) + assert.NoError(t, err) + + // c2 doesn't subscribe to the "mention" broadcast event. + d2 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c2.Attach(ctx, d2)) + rch2, err := c2.Watch(ctx, d2) + assert.NoError(t, err) + + // The unsubscriber c2 broadcasts the "mention" event. + err = d2.Broadcast("mention", "yorkie") + assert.NoError(t, err) + + wg := sync.WaitGroup{} + wg.Add(1) + go func() { + defer wg.Done() + rcv := 0 + for { + select { + case <-rch1: + case <-rch2: + case m := <-bch: + assert.Equal(t, "yorkie", m) + rcv++ + case <-time.After(1 * time.Second): + // Assuming that all subscribers can receive the broadcast + // event within this timeout period, check if the subscriber + // receives the unsubscriber's event. + assert.Equal(t, 1, rcv) + return + case <-ctx.Done(): + return + } + } + }() + + wg.Wait() + }) + + t.Run("reject to broadcast unserializable payload", func(t *testing.T) { + ctx := context.Background() + + d1 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c1.Attach(ctx, d1)) + _, err := c1.Watch(ctx, d1) + assert.NoError(t, err) + err = d1.SubscribeBroadcastEvent("mention", nil) + assert.NoError(t, err) + + // Try to broadcast an unserializable payload. + ch := make(chan string) + err = d1.Broadcast("mention", ch) + assert.ErrorIs(t, document.ErrUnsupportedPayloadType, err) + }) + } func TestDocumentWithProjects(t *testing.T) { From 5bf5466a97a8852f51b293835a3ac1911a1bc49d Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 13 Sep 2023 12:43:33 +0900 Subject: [PATCH 19/24] Integrate BroadcastEvent into DocEvent and filter event at client side --- api/converter/from_pb.go | 2 + api/converter/to_pb.go | 2 + api/types/event.go | 27 +- api/yorkie/v1/resources.pb.go | 593 ++++---- api/yorkie/v1/resources.proto | 13 +- api/yorkie/v1/yorkie.pb.go | 1197 ++--------------- api/yorkie/v1/yorkie.proto | 25 +- client/client.go | 102 +- pkg/document/document.go | 102 +- server/backend/sync/coordinator.go | 42 +- server/backend/sync/memory/coordinator.go | 52 +- .../backend/sync/memory/coordinator_test.go | 2 +- server/backend/sync/memory/pubsub.go | 333 ++--- server/backend/sync/memory/pubsub_test.go | 13 +- server/backend/sync/pubsub.go | 46 +- server/packs/packs.go | 4 +- server/rpc/admin_server.go | 5 +- server/rpc/yorkie_server.go | 162 +-- test/integration/document_test.go | 138 +- 19 files changed, 694 insertions(+), 2166 deletions(-) diff --git a/api/converter/from_pb.go b/api/converter/from_pb.go index dcc119b6f..1aef86d37 100644 --- a/api/converter/from_pb.go +++ b/api/converter/from_pb.go @@ -210,6 +210,8 @@ func FromEventType(pbDocEventType api.DocEventType) (types.DocEventType, error) return types.DocumentWatchedEvent, nil case api.DocEventType_DOC_EVENT_TYPE_DOCUMENT_UNWATCHED: return types.DocumentUnwatchedEvent, nil + case api.DocEventType_DOC_EVENT_TYPE_DOCUMENT_BROADCAST: + return types.DocumentBroadcastEvent, nil } return "", fmt.Errorf("%v: %w", pbDocEventType, ErrUnsupportedEventType) } diff --git a/api/converter/to_pb.go b/api/converter/to_pb.go index 1b1206203..beec819a5 100644 --- a/api/converter/to_pb.go +++ b/api/converter/to_pb.go @@ -207,6 +207,8 @@ func ToDocEventType(eventType types.DocEventType) (api.DocEventType, error) { return api.DocEventType_DOC_EVENT_TYPE_DOCUMENT_WATCHED, nil case types.DocumentUnwatchedEvent: return api.DocEventType_DOC_EVENT_TYPE_DOCUMENT_UNWATCHED, nil + case types.DocumentBroadcastEvent: + return api.DocEventType_DOC_EVENT_TYPE_DOCUMENT_BROADCAST, nil default: return 0, fmt.Errorf("%s: %w", eventType, ErrUnsupportedEventType) } diff --git a/api/types/event.go b/api/types/event.go index e3507848f..f0d2b160b 100644 --- a/api/types/event.go +++ b/api/types/event.go @@ -1,22 +1,5 @@ package types -import "github.com/yorkie-team/yorkie/pkg/document/time" - -// DocEvent represents events that occur related to the document. -type DocEvent struct { - Type DocEventType - Publisher *time.ActorID - DocumentID ID -} - -// BroadcastEvent represents events that are delievered to broadcast -// event subscribers. -type BroadcastEvent struct { - Type string - Publisher *time.ActorID - Payload []byte -} - // DocEventType represents the event that the Server delivers to the client. type DocEventType string @@ -32,4 +15,14 @@ const ( // DocumentUnwatchedEvent is an event that occurs when document is // unwatched by other clients. DocumentUnwatchedEvent DocEventType = "document-unwatched" + + // DocumentBroadcastEvent is an event that occurs when a payload is broadcasted + // on a specific topic. + DocumentBroadcastEvent DocEventType = "document-broadcast" ) + +// DocEventBody includes additional data specific to the DocEvent. +type DocEventBody struct { + Topic string + Payload []byte +} diff --git a/api/yorkie/v1/resources.pb.go b/api/yorkie/v1/resources.pb.go index 483c78f8e..f1c711a9e 100644 --- a/api/yorkie/v1/resources.pb.go +++ b/api/yorkie/v1/resources.pb.go @@ -90,18 +90,21 @@ const ( DocEventType_DOC_EVENT_TYPE_DOCUMENT_CHANGED DocEventType = 0 DocEventType_DOC_EVENT_TYPE_DOCUMENT_WATCHED DocEventType = 1 DocEventType_DOC_EVENT_TYPE_DOCUMENT_UNWATCHED DocEventType = 2 + DocEventType_DOC_EVENT_TYPE_DOCUMENT_BROADCAST DocEventType = 3 ) var DocEventType_name = map[int32]string{ 0: "DOC_EVENT_TYPE_DOCUMENT_CHANGED", 1: "DOC_EVENT_TYPE_DOCUMENT_WATCHED", 2: "DOC_EVENT_TYPE_DOCUMENT_UNWATCHED", + 3: "DOC_EVENT_TYPE_DOCUMENT_BROADCAST", } var DocEventType_value = map[string]int32{ "DOC_EVENT_TYPE_DOCUMENT_CHANGED": 0, "DOC_EVENT_TYPE_DOCUMENT_WATCHED": 1, "DOC_EVENT_TYPE_DOCUMENT_UNWATCHED": 2, + "DOC_EVENT_TYPE_DOCUMENT_BROADCAST": 3, } func (x DocEventType) String() string { @@ -3266,26 +3269,26 @@ func (m *TimeTicket) GetActorId() []byte { return nil } -type DocEvent struct { - Type DocEventType `protobuf:"varint,1,opt,name=type,proto3,enum=yorkie.v1.DocEventType" json:"type,omitempty"` - Publisher string `protobuf:"bytes,2,opt,name=publisher,proto3" json:"publisher,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type DocEventBody struct { + Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,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) { +func (m *DocEventBody) Reset() { *m = DocEventBody{} } +func (m *DocEventBody) String() string { return proto.CompactTextString(m) } +func (*DocEventBody) ProtoMessage() {} +func (*DocEventBody) Descriptor() ([]byte, []int) { return fileDescriptor_36361b2f5d0f0896, []int{25} } -func (m *DocEvent) XXX_Unmarshal(b []byte) error { +func (m *DocEventBody) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DocEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DocEventBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DocEvent.Marshal(b, m, deterministic) + return xxx_messageInfo_DocEventBody.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3295,53 +3298,53 @@ func (m *DocEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *DocEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_DocEvent.Merge(m, src) +func (m *DocEventBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_DocEventBody.Merge(m, src) } -func (m *DocEvent) XXX_Size() int { +func (m *DocEventBody) XXX_Size() int { return m.Size() } -func (m *DocEvent) XXX_DiscardUnknown() { - xxx_messageInfo_DocEvent.DiscardUnknown(m) +func (m *DocEventBody) XXX_DiscardUnknown() { + xxx_messageInfo_DocEventBody.DiscardUnknown(m) } -var xxx_messageInfo_DocEvent proto.InternalMessageInfo +var xxx_messageInfo_DocEventBody proto.InternalMessageInfo -func (m *DocEvent) GetType() DocEventType { +func (m *DocEventBody) GetTopic() string { if m != nil { - return m.Type + return m.Topic } - return DocEventType_DOC_EVENT_TYPE_DOCUMENT_CHANGED + return "" } -func (m *DocEvent) GetPublisher() string { +func (m *DocEventBody) GetPayload() []byte { if m != nil { - return m.Publisher + return m.Payload } - return "" + return nil } -type BroadcastEvent struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Publisher string `protobuf:"bytes,2,opt,name=publisher,proto3" json:"publisher,omitempty"` - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type DocEvent struct { + Type DocEventType `protobuf:"varint,1,opt,name=type,proto3,enum=yorkie.v1.DocEventType" json:"type,omitempty"` + Publisher string `protobuf:"bytes,2,opt,name=publisher,proto3" json:"publisher,omitempty"` + Body *DocEventBody `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *BroadcastEvent) Reset() { *m = BroadcastEvent{} } -func (m *BroadcastEvent) String() string { return proto.CompactTextString(m) } -func (*BroadcastEvent) ProtoMessage() {} -func (*BroadcastEvent) Descriptor() ([]byte, []int) { +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_36361b2f5d0f0896, []int{26} } -func (m *BroadcastEvent) XXX_Unmarshal(b []byte) error { +func (m *DocEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *BroadcastEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DocEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_BroadcastEvent.Marshal(b, m, deterministic) + return xxx_messageInfo_DocEvent.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3351,35 +3354,35 @@ func (m *BroadcastEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *BroadcastEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_BroadcastEvent.Merge(m, src) +func (m *DocEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_DocEvent.Merge(m, src) } -func (m *BroadcastEvent) XXX_Size() int { +func (m *DocEvent) XXX_Size() int { return m.Size() } -func (m *BroadcastEvent) XXX_DiscardUnknown() { - xxx_messageInfo_BroadcastEvent.DiscardUnknown(m) +func (m *DocEvent) XXX_DiscardUnknown() { + xxx_messageInfo_DocEvent.DiscardUnknown(m) } -var xxx_messageInfo_BroadcastEvent proto.InternalMessageInfo +var xxx_messageInfo_DocEvent proto.InternalMessageInfo -func (m *BroadcastEvent) GetType() string { +func (m *DocEvent) GetType() DocEventType { if m != nil { return m.Type } - return "" + return DocEventType_DOC_EVENT_TYPE_DOCUMENT_CHANGED } -func (m *BroadcastEvent) GetPublisher() string { +func (m *DocEvent) GetPublisher() string { if m != nil { return m.Publisher } return "" } -func (m *BroadcastEvent) GetPayload() []byte { +func (m *DocEvent) GetBody() *DocEventBody { if m != nil { - return m.Payload + return m.Body } return nil } @@ -3439,179 +3442,180 @@ func init() { proto.RegisterType((*Checkpoint)(nil), "yorkie.v1.Checkpoint") proto.RegisterType((*TextNodePos)(nil), "yorkie.v1.TextNodePos") proto.RegisterType((*TimeTicket)(nil), "yorkie.v1.TimeTicket") + proto.RegisterType((*DocEventBody)(nil), "yorkie.v1.DocEventBody") proto.RegisterType((*DocEvent)(nil), "yorkie.v1.DocEvent") - proto.RegisterType((*BroadcastEvent)(nil), "yorkie.v1.BroadcastEvent") } func init() { proto.RegisterFile("yorkie/v1/resources.proto", fileDescriptor_36361b2f5d0f0896) } var fileDescriptor_36361b2f5d0f0896 = []byte{ - // 2630 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xcf, 0x8f, 0x23, 0x47, - 0xf5, 0x9f, 0x6e, 0xb7, 0x7f, 0xf4, 0x9b, 0xdd, 0x19, 0x6f, 0xcd, 0xfe, 0xf0, 0x7a, 0x77, 0x27, - 0xb3, 0xce, 0x37, 0xf9, 0x4e, 0x76, 0xc1, 0xf3, 0x83, 0x24, 0x84, 0x84, 0x00, 0x1e, 0xbb, 0xb3, - 0xe3, 0x64, 0xd6, 0x33, 0xb4, 0x3d, 0x1b, 0x12, 0x05, 0xb5, 0x7a, 0xba, 0x6b, 0x66, 0x3a, 0x63, - 0xbb, 0x9d, 0xee, 0xb6, 0xb3, 0x96, 0x90, 0x90, 0x10, 0x48, 0x5c, 0xb9, 0xc1, 0x9f, 0xc0, 0x85, - 0x7b, 0x8e, 0x70, 0x40, 0x48, 0x08, 0x11, 0x89, 0x48, 0x5c, 0x49, 0x38, 0x20, 0xb8, 0x21, 0x24, - 0x6e, 0x48, 0xa8, 0x7e, 0x74, 0xbb, 0x6c, 0xb7, 0x3d, 0x5e, 0x33, 0x44, 0x1b, 0x71, 0xeb, 0xaa, - 0xfa, 0xbc, 0xaa, 0xf7, 0xea, 0x7d, 0xea, 0xd5, 0xab, 0xae, 0x82, 0x9b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, 0xab, 0x62, - 0xaf, 0xaa, 0x28, 0xfe, 0x47, 0x09, 0x52, 0x6c, 0xf7, 0x7a, 0x5a, 0x69, 0x34, 0xef, 0xd2, 0xfe, - 0x54, 0x86, 0x24, 0xdd, 0x9c, 0x9e, 0x56, 0xc3, 0xde, 0x1c, 0xe2, 0x18, 0x5b, 0x12, 0xf7, 0x26, - 0x27, 0x0a, 0xd3, 0x48, 0x36, 0x3a, 0x49, 0xc9, 0x59, 0x27, 0xe9, 0x3f, 0x64, 0xcf, 0x47, 0x12, - 0x64, 0xc2, 0x74, 0xe4, 0x22, 0xa6, 0x79, 0x7b, 0x98, 0xfd, 0xf3, 0xec, 0x79, 0x33, 0x87, 0xcf, - 0x8f, 0x13, 0x90, 0x09, 0x93, 0xa1, 0x8b, 0xd0, 0xfd, 0xf9, 0x21, 0x8a, 0x20, 0x51, 0xca, 0xc3, - 0x02, 0x3d, 0x0a, 0x02, 0x3d, 0xe2, 0x50, 0x84, 0x1a, 0xcd, 0xf3, 0x42, 0xe7, 0xcb, 0x53, 0x73, - 0xbb, 0x27, 0x0c, 0x9f, 0x9b, 0x90, 0xe1, 0xf1, 0xd2, 0xcf, 0x25, 0xc7, 0x8e, 0x39, 0xa4, 0x53, - 0x42, 0x5b, 0x5f, 0x8f, 0x50, 0xf3, 0x86, 0xd5, 0xff, 0x76, 0x2c, 0xfc, 0x54, 0x06, 0x35, 0x4a, - 0x50, 0x9f, 0x36, 0x9f, 0xd6, 0x62, 0x96, 0x7b, 0x71, 0x7a, 0x8e, 0xfd, 0x14, 0x2e, 0xf9, 0x9d, - 0x14, 0x28, 0x47, 0xae, 0xdd, 0x2f, 0xfc, 0x5d, 0x82, 0x2b, 0x63, 0x6b, 0x72, 0x24, 0x03, 0x92, - 0x66, 0xcc, 0x80, 0x36, 0x21, 0x43, 0x0f, 0xef, 0xe7, 0x66, 0x4d, 0x69, 0x0a, 0x63, 0x99, 0x16, - 0xff, 0x03, 0x70, 0x7e, 0x96, 0xc8, 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64, 0x94, 0x6b, 0x8d, 0xec, 0x22, 0xba, 0x01, 0x2b, 0x23, - 0x56, 0xd1, 0x86, 0x4b, 0xa3, 0x3d, 0xe9, 0x9a, 0x96, 0xbd, 0x7c, 0xef, 0xfb, 0x70, 0x49, 0x74, - 0x34, 0x7a, 0x16, 0x9e, 0xa9, 0xec, 0x97, 0x0d, 0xed, 0x91, 0x56, 0x6b, 0x84, 0x53, 0x50, 0x3e, - 0x7c, 0x48, 0x4a, 0x6c, 0xf9, 0x93, 0xc0, 0x31, 0x05, 0xf4, 0x76, 0xa9, 0x51, 0xde, 0xd5, 0x2a, - 0x59, 0x09, 0x3d, 0x07, 0x77, 0x27, 0x81, 0x0e, 0x6b, 0x21, 0x4c, 0xde, 0xb9, 0xff, 0x9b, 0xcf, - 0x56, 0xa5, 0x8f, 0x3f, 0x5b, 0x95, 0xfe, 0xf4, 0xd9, 0xaa, 0xf4, 0xd3, 0x3f, 0xaf, 0x2e, 0xc0, - 0x15, 0x1b, 0xf7, 0x42, 0x1e, 0x9a, 0x1d, 0xa7, 0xd8, 0xdb, 0x3a, 0x90, 0xde, 0x55, 0x8a, 0xaf, - 0xf5, 0xb6, 0x8e, 0x52, 0x34, 0xf2, 0x7e, 0xe5, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcf, 0xf4, - 0xeb, 0x2c, 0xb2, 0x28, 0x00, 0x00, + // 2655 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xcb, 0x8f, 0x23, 0x47, + 0x19, 0x9f, 0x6e, 0xb7, 0x1f, 0xfd, 0xcd, 0xee, 0x8e, 0xb7, 0x66, 0x1f, 0x5e, 0xef, 0xee, 0x64, + 0xd6, 0x21, 0x61, 0xb2, 0x0b, 0x9e, 0x07, 0x49, 0x08, 0x09, 0x09, 0x78, 0xec, 0xce, 0x8e, 0x93, + 0x59, 0xcf, 0xd0, 0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2, 0x27, 0x9f, 0xaf, 0x48, 0x7f, + 0xfe, 0x7c, 0x45, 0xfa, 0xe9, 0x5f, 0x56, 0x16, 0xe0, 0xb2, 0x8d, 0x7b, 0x82, 0x33, 0x66, 0xc7, + 0x29, 0xf6, 0x36, 0xf7, 0xa5, 0xf7, 0x94, 0xe2, 0x6b, 0xbd, 0xcd, 0xc3, 0x14, 0xcd, 0xd8, 0x5f, + 0xfb, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x6f, 0xe6, 0x3b, 0xea, 0x28, 0x00, 0x00, } func (m *Snapshot) Marshal() (dAtA []byte, err error) { @@ -6790,7 +6794,7 @@ func (m *TimeTicket) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DocEvent) Marshal() (dAtA []byte, err error) { +func (m *DocEventBody) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -6800,12 +6804,12 @@ func (m *DocEvent) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DocEvent) MarshalTo(dAtA []byte) (int, error) { +func (m *DocEventBody) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DocEventBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -6814,22 +6818,24 @@ func (m *DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Publisher) > 0 { - i -= len(m.Publisher) - copy(dAtA[i:], m.Publisher) - i = encodeVarintResources(dAtA, i, uint64(len(m.Publisher))) + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintResources(dAtA, i, uint64(len(m.Payload))) i-- dAtA[i] = 0x12 } - if m.Type != 0 { - i = encodeVarintResources(dAtA, i, uint64(m.Type)) + if len(m.Topic) > 0 { + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintResources(dAtA, i, uint64(len(m.Topic))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *BroadcastEvent) Marshal() (dAtA []byte, err error) { +func (m *DocEvent) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -6839,12 +6845,12 @@ func (m *BroadcastEvent) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BroadcastEvent) MarshalTo(dAtA []byte) (int, error) { +func (m *DocEvent) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BroadcastEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -6853,10 +6859,15 @@ func (m *BroadcastEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Payload) > 0 { - i -= len(m.Payload) - copy(dAtA[i:], m.Payload) - i = encodeVarintResources(dAtA, i, uint64(len(m.Payload))) + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x1a } @@ -6867,12 +6878,10 @@ func (m *BroadcastEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintResources(dAtA, i, uint64(len(m.Type))) + if m.Type != 0 { + i = encodeVarintResources(dAtA, i, uint64(m.Type)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -8262,16 +8271,17 @@ func (m *TimeTicket) Size() (n int) { return n } -func (m *DocEvent) Size() (n int) { +func (m *DocEventBody) 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.Topic) + if l > 0 { + n += 1 + l + sovResources(uint64(l)) } - l = len(m.Publisher) + l = len(m.Payload) if l > 0 { n += 1 + l + sovResources(uint64(l)) } @@ -8281,22 +8291,21 @@ func (m *DocEvent) Size() (n int) { return n } -func (m *BroadcastEvent) Size() (n int) { +func (m *DocEvent) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovResources(uint64(l)) + if m.Type != 0 { + n += 1 + sovResources(uint64(m.Type)) } l = len(m.Publisher) if l > 0 { n += 1 + l + sovResources(uint64(l)) } - l = len(m.Payload) - if l > 0 { + if m.Body != nil { + l = m.Body.Size() n += 1 + l + sovResources(uint64(l)) } if m.XXX_unrecognized != nil { @@ -16910,7 +16919,7 @@ func (m *TimeTicket) Unmarshal(dAtA []byte) error { } return nil } -func (m *DocEvent) Unmarshal(dAtA []byte) error { +func (m *DocEventBody) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16933,17 +16942,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: DocEventBody: 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: DocEventBody: 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 Topic", wireType) } - m.Type = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowResources @@ -16953,16 +16962,29 @@ func (m *DocEvent) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Type |= DocEventType(b&0x7F) << shift + 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.Topic = string(dAtA[iNdEx:postIndex]) + 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 Payload", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowResources @@ -16972,23 +16994,25 @@ func (m *DocEvent) 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 ErrInvalidLengthResources } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthResources } if postIndex > l { return io.ErrUnexpectedEOF } - m.Publisher = string(dAtA[iNdEx:postIndex]) + m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex @@ -17012,7 +17036,7 @@ func (m *DocEvent) Unmarshal(dAtA []byte) error { } return nil } -func (m *BroadcastEvent) Unmarshal(dAtA []byte) error { +func (m *DocEvent) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17035,17 +17059,17 @@ func (m *BroadcastEvent) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BroadcastEvent: wiretype end group for non-group") + return fmt.Errorf("proto: DocEvent: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BroadcastEvent: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DocEvent: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - var stringLen uint64 + m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowResources @@ -17055,24 +17079,11 @@ func (m *BroadcastEvent) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Type |= DocEventType(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.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) @@ -17107,9 +17118,9 @@ func (m *BroadcastEvent) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowResources @@ -17119,24 +17130,26 @@ func (m *BroadcastEvent) 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 ErrInvalidLengthResources } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthResources } if postIndex > l { return io.ErrUnexpectedEOF } - m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) - if m.Payload == nil { - m.Payload = []byte{} + if m.Body == nil { + m.Body = &DocEventBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: diff --git a/api/yorkie/v1/resources.proto b/api/yorkie/v1/resources.proto index ac3e261d4..231e45508 100644 --- a/api/yorkie/v1/resources.proto +++ b/api/yorkie/v1/resources.proto @@ -357,15 +357,16 @@ enum DocEventType { DOC_EVENT_TYPE_DOCUMENT_CHANGED = 0; DOC_EVENT_TYPE_DOCUMENT_WATCHED = 1; DOC_EVENT_TYPE_DOCUMENT_UNWATCHED = 2; + DOC_EVENT_TYPE_DOCUMENT_BROADCAST = 3; } -message DocEvent { - DocEventType type = 1; - string publisher = 2; +message DocEventBody { + string topic = 1; + bytes payload = 2; } -message BroadcastEvent { - string type = 1; +message DocEvent { + DocEventType type = 1; string publisher = 2; - bytes payload = 3; + DocEventBody body = 3; } \ No newline at end of file diff --git a/api/yorkie/v1/yorkie.pb.go b/api/yorkie/v1/yorkie.pb.go index 636c4f960..5e71c30ca 100644 --- a/api/yorkie/v1/yorkie.pb.go +++ b/api/yorkie/v1/yorkie.pb.go @@ -492,8 +492,7 @@ func (m *WatchDocumentRequest) GetDocumentId() string { type WatchDocumentResponse struct { // Types that are valid to be assigned to Body: // *WatchDocumentResponse_Initialization_ - // *WatchDocumentResponse_DocEvent - // *WatchDocumentResponse_BroadcastEvent + // *WatchDocumentResponse_Event Body isWatchDocumentResponse_Body `protobuf_oneof:"body"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -542,16 +541,12 @@ type isWatchDocumentResponse_Body interface { type WatchDocumentResponse_Initialization_ struct { Initialization *WatchDocumentResponse_Initialization `protobuf:"bytes,1,opt,name=initialization,proto3,oneof" json:"initialization,omitempty"` } -type WatchDocumentResponse_DocEvent struct { - DocEvent *DocEvent `protobuf:"bytes,2,opt,name=doc_event,json=docEvent,proto3,oneof" json:"doc_event,omitempty"` -} -type WatchDocumentResponse_BroadcastEvent struct { - BroadcastEvent *BroadcastEvent `protobuf:"bytes,3,opt,name=broadcast_event,json=broadcastEvent,proto3,oneof" json:"broadcast_event,omitempty"` +type WatchDocumentResponse_Event struct { + Event *DocEvent `protobuf:"bytes,2,opt,name=event,proto3,oneof" json:"event,omitempty"` } func (*WatchDocumentResponse_Initialization_) isWatchDocumentResponse_Body() {} -func (*WatchDocumentResponse_DocEvent) isWatchDocumentResponse_Body() {} -func (*WatchDocumentResponse_BroadcastEvent) isWatchDocumentResponse_Body() {} +func (*WatchDocumentResponse_Event) isWatchDocumentResponse_Body() {} func (m *WatchDocumentResponse) GetBody() isWatchDocumentResponse_Body { if m != nil { @@ -567,16 +562,9 @@ func (m *WatchDocumentResponse) GetInitialization() *WatchDocumentResponse_Initi return nil } -func (m *WatchDocumentResponse) GetDocEvent() *DocEvent { - if x, ok := m.GetBody().(*WatchDocumentResponse_DocEvent); ok { - return x.DocEvent - } - return nil -} - -func (m *WatchDocumentResponse) GetBroadcastEvent() *BroadcastEvent { - if x, ok := m.GetBody().(*WatchDocumentResponse_BroadcastEvent); ok { - return x.BroadcastEvent +func (m *WatchDocumentResponse) GetEvent() *DocEvent { + if x, ok := m.GetBody().(*WatchDocumentResponse_Event); ok { + return x.Event } return nil } @@ -585,8 +573,7 @@ func (m *WatchDocumentResponse) GetBroadcastEvent() *BroadcastEvent { func (*WatchDocumentResponse) XXX_OneofWrappers() []interface{} { return []interface{}{ (*WatchDocumentResponse_Initialization_)(nil), - (*WatchDocumentResponse_DocEvent)(nil), - (*WatchDocumentResponse_BroadcastEvent)(nil), + (*WatchDocumentResponse_Event)(nil), } } @@ -865,214 +852,10 @@ func (m *PushPullChangesResponse) GetChangePack() *ChangePack { return nil } -type SubscribeBroadcastEventRequest struct { - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubscribeBroadcastEventRequest) Reset() { *m = SubscribeBroadcastEventRequest{} } -func (m *SubscribeBroadcastEventRequest) String() string { return proto.CompactTextString(m) } -func (*SubscribeBroadcastEventRequest) ProtoMessage() {} -func (*SubscribeBroadcastEventRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{14} -} -func (m *SubscribeBroadcastEventRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SubscribeBroadcastEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SubscribeBroadcastEventRequest.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 *SubscribeBroadcastEventRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscribeBroadcastEventRequest.Merge(m, src) -} -func (m *SubscribeBroadcastEventRequest) XXX_Size() int { - return m.Size() -} -func (m *SubscribeBroadcastEventRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SubscribeBroadcastEventRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscribeBroadcastEventRequest proto.InternalMessageInfo - -func (m *SubscribeBroadcastEventRequest) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" -} - -func (m *SubscribeBroadcastEventRequest) GetDocumentId() string { - if m != nil { - return m.DocumentId - } - return "" -} - -func (m *SubscribeBroadcastEventRequest) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -type SubscribeBroadcastEventResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubscribeBroadcastEventResponse) Reset() { *m = SubscribeBroadcastEventResponse{} } -func (m *SubscribeBroadcastEventResponse) String() string { return proto.CompactTextString(m) } -func (*SubscribeBroadcastEventResponse) ProtoMessage() {} -func (*SubscribeBroadcastEventResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{15} -} -func (m *SubscribeBroadcastEventResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SubscribeBroadcastEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SubscribeBroadcastEventResponse.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 *SubscribeBroadcastEventResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscribeBroadcastEventResponse.Merge(m, src) -} -func (m *SubscribeBroadcastEventResponse) XXX_Size() int { - return m.Size() -} -func (m *SubscribeBroadcastEventResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SubscribeBroadcastEventResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscribeBroadcastEventResponse proto.InternalMessageInfo - -type UnsubscribeBroadcastEventRequest struct { - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UnsubscribeBroadcastEventRequest) Reset() { *m = UnsubscribeBroadcastEventRequest{} } -func (m *UnsubscribeBroadcastEventRequest) String() string { return proto.CompactTextString(m) } -func (*UnsubscribeBroadcastEventRequest) ProtoMessage() {} -func (*UnsubscribeBroadcastEventRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{16} -} -func (m *UnsubscribeBroadcastEventRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UnsubscribeBroadcastEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UnsubscribeBroadcastEventRequest.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 *UnsubscribeBroadcastEventRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnsubscribeBroadcastEventRequest.Merge(m, src) -} -func (m *UnsubscribeBroadcastEventRequest) XXX_Size() int { - return m.Size() -} -func (m *UnsubscribeBroadcastEventRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UnsubscribeBroadcastEventRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UnsubscribeBroadcastEventRequest proto.InternalMessageInfo - -func (m *UnsubscribeBroadcastEventRequest) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" -} - -func (m *UnsubscribeBroadcastEventRequest) GetDocumentId() string { - if m != nil { - return m.DocumentId - } - return "" -} - -func (m *UnsubscribeBroadcastEventRequest) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -type UnsubscribeBroadcastEventResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UnsubscribeBroadcastEventResponse) Reset() { *m = UnsubscribeBroadcastEventResponse{} } -func (m *UnsubscribeBroadcastEventResponse) String() string { return proto.CompactTextString(m) } -func (*UnsubscribeBroadcastEventResponse) ProtoMessage() {} -func (*UnsubscribeBroadcastEventResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{17} -} -func (m *UnsubscribeBroadcastEventResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UnsubscribeBroadcastEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UnsubscribeBroadcastEventResponse.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 *UnsubscribeBroadcastEventResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnsubscribeBroadcastEventResponse.Merge(m, src) -} -func (m *UnsubscribeBroadcastEventResponse) XXX_Size() int { - return m.Size() -} -func (m *UnsubscribeBroadcastEventResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UnsubscribeBroadcastEventResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UnsubscribeBroadcastEventResponse proto.InternalMessageInfo - type BroadcastRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1083,7 +866,7 @@ func (m *BroadcastRequest) Reset() { *m = BroadcastRequest{} } func (m *BroadcastRequest) String() string { return proto.CompactTextString(m) } func (*BroadcastRequest) ProtoMessage() {} func (*BroadcastRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{18} + return fileDescriptor_40070c858814ab24, []int{14} } func (m *BroadcastRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1126,9 +909,9 @@ func (m *BroadcastRequest) GetDocumentId() string { return "" } -func (m *BroadcastRequest) GetType() string { +func (m *BroadcastRequest) GetTopic() string { if m != nil { - return m.Type + return m.Topic } return "" } @@ -1150,7 +933,7 @@ func (m *BroadcastResponse) Reset() { *m = BroadcastResponse{} } func (m *BroadcastResponse) String() string { return proto.CompactTextString(m) } func (*BroadcastResponse) ProtoMessage() {} func (*BroadcastResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40070c858814ab24, []int{19} + return fileDescriptor_40070c858814ab24, []int{15} } func (m *BroadcastResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1195,10 +978,6 @@ func init() { proto.RegisterType((*RemoveDocumentResponse)(nil), "yorkie.v1.RemoveDocumentResponse") proto.RegisterType((*PushPullChangesRequest)(nil), "yorkie.v1.PushPullChangesRequest") proto.RegisterType((*PushPullChangesResponse)(nil), "yorkie.v1.PushPullChangesResponse") - proto.RegisterType((*SubscribeBroadcastEventRequest)(nil), "yorkie.v1.SubscribeBroadcastEventRequest") - proto.RegisterType((*SubscribeBroadcastEventResponse)(nil), "yorkie.v1.SubscribeBroadcastEventResponse") - proto.RegisterType((*UnsubscribeBroadcastEventRequest)(nil), "yorkie.v1.UnsubscribeBroadcastEventRequest") - proto.RegisterType((*UnsubscribeBroadcastEventResponse)(nil), "yorkie.v1.UnsubscribeBroadcastEventResponse") proto.RegisterType((*BroadcastRequest)(nil), "yorkie.v1.BroadcastRequest") proto.RegisterType((*BroadcastResponse)(nil), "yorkie.v1.BroadcastResponse") } @@ -1206,58 +985,52 @@ func init() { func init() { proto.RegisterFile("yorkie/v1/yorkie.proto", fileDescriptor_40070c858814ab24) } var fileDescriptor_40070c858814ab24 = []byte{ - // 813 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x53, 0xd3, 0x40, - 0x14, 0x6f, 0xa0, 0x03, 0xed, 0xab, 0x14, 0x58, 0x6c, 0x29, 0x41, 0x4b, 0x09, 0x17, 0x14, 0xa7, - 0xb5, 0x65, 0xe4, 0xe2, 0x09, 0xa8, 0x33, 0x74, 0x9c, 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 0xa5, - 0xae, 0xac, 0x74, 0x0a, 0x13, 0x25, 0x6e, 0x3d, 0x53, 0xcb, 0x95, 0x83, 0xa2, 0x95, 0x77, 0xdd, - 0xdd, 0xa6, 0xac, 0x74, 0x44, 0x50, 0x82, 0xb5, 0x70, 0x0a, 0xf9, 0x68, 0x36, 0xff, 0xe0, 0x2b, - 0x90, 0x51, 0x7d, 0xdb, 0x79, 0x42, 0x18, 0x98, 0xae, 0x90, 0xf2, 0x0b, 0x07, 0xb9, 0x3a, 0xfe, - 0xe5, 0x13, 0x46, 0xf8, 0x4c, 0x5c, 0xc6, 0x67, 0x72, 0x4c, 0x3e, 0x68, 0x13, 0xf2, 0x26, 0x3e, - 0x21, 0x36, 0x96, 0xb4, 0x63, 0xc9, 0x20, 0x54, 0x92, 0xdd, 0x82, 0x60, 0xb5, 0x90, 0x2c, 0x71, - 0xeb, 0x29, 0x71, 0xc1, 0xdb, 0x6d, 0x1c, 0x3f, 0x21, 0x74, 0xdb, 0xdf, 0x12, 0x9a, 0x90, 0x8f, - 0x9e, 0xc1, 0xaf, 0xdb, 0xef, 0x96, 0xe5, 0x39, 0xdc, 0x3c, 0x90, 0xe9, 0x35, 0x17, 0x45, 0xf8, - 0x38, 0x01, 0xb9, 0x08, 0xac, 0xcf, 0xf3, 0x10, 0xb2, 0x9a, 0xa1, 0x51, 0x4d, 0xd6, 0xb5, 0xb7, - 0x32, 0xd5, 0x88, 0xe1, 0x82, 0x67, 0x6a, 0x95, 0x10, 0xd5, 0xd8, 0xc8, 0x72, 0x83, 0x09, 0xdb, - 0x4b, 0x88, 0x11, 0x20, 0x54, 0x83, 0xb4, 0x4a, 0x14, 0x09, 0xdb, 0xd8, 0xa0, 0x7e, 0x01, 0x16, - 0x42, 0xa8, 0x75, 0xa2, 0x3c, 0xea, 0x6f, 0xed, 0x25, 0xc4, 0x94, 0xea, 0xaf, 0x51, 0x1d, 0x66, - 0x5b, 0x26, 0x91, 0x55, 0x45, 0xb6, 0xa8, 0x1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x8a, 0xdc, 0x87, 0x1f, 0xc5, 0x04, 0xcc, 0xab, 0xd8, 0x1e, 0x80, 0xc8, 0x5d, 0xad, - 0x6c, 0x57, 0x9b, 0xdc, 0x51, 0xb2, 0xfc, 0xd0, 0xae, 0xb6, 0xa6, 0xdc, 0x77, 0xfd, 0xe6, 0xcf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x95, 0x60, 0x5a, 0x17, 0x0c, 0x00, 0x00, + // 715 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x4f, 0xdb, 0x4a, + 0x10, 0xcf, 0xf2, 0xef, 0x91, 0xc9, 0x83, 0x07, 0x0b, 0x09, 0x79, 0xe1, 0xbd, 0x90, 0x6e, 0x2f, + 0x48, 0x48, 0x49, 0x03, 0x2a, 0x97, 0x9e, 0x80, 0x54, 0x22, 0xaa, 0xd4, 0xa6, 0x6e, 0x55, 0x04, + 0x52, 0x65, 0x2d, 0xf6, 0xd2, 0xac, 0x62, 0xbc, 0xc6, 0xde, 0x58, 0x72, 0x4f, 0xfd, 0x02, 0xbd, + 0xf7, 0x3b, 0xf4, 0x5b, 0xf4, 0xd4, 0x23, 0xc7, 0x1e, 0x2b, 0xfa, 0x45, 0xaa, 0x78, 0x9d, 0x60, + 0x1b, 0x37, 0xd0, 0x82, 0xd4, 0xde, 0xb2, 0xb3, 0x33, 0xbf, 0xfd, 0xcd, 0x78, 0x7e, 0x33, 0x81, + 0x52, 0x20, 0xdc, 0x1e, 0x67, 0x0d, 0xbf, 0xd9, 0x50, 0xbf, 0xea, 0x8e, 0x2b, 0xa4, 0xc0, 0xf9, + 0xe8, 0xe4, 0x37, 0x2b, 0xff, 0x5e, 0xba, 0xb8, 0xcc, 0x13, 0x7d, 0xd7, 0x60, 0x9e, 0xf2, 0x22, + 0xdb, 0x50, 0xdc, 0x31, 0x24, 0xf7, 0xa9, 0x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, 0x26, 0xf3, 0x87, 0x41, 0xd4, 0xe1, 0x75, 0xbf, + 0xd9, 0x41, 0x47, 0x53, 0xf5, 0x47, 0x7e, 0xf3, 0x78, 0x26, 0xfc, 0xb7, 0xb5, 0xf5, 0x3d, 0x00, + 0x00, 0xff, 0xff, 0x99, 0x77, 0x1a, 0xa9, 0xad, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1280,8 +1053,6 @@ type YorkieServiceClient interface { PushPullChanges(ctx context.Context, in *PushPullChangesRequest, opts ...grpc.CallOption) (*PushPullChangesResponse, error) WatchDocument(ctx context.Context, in *WatchDocumentRequest, opts ...grpc.CallOption) (YorkieService_WatchDocumentClient, error) Broadcast(ctx context.Context, in *BroadcastRequest, opts ...grpc.CallOption) (*BroadcastResponse, error) - SubscribeBroadcastEvent(ctx context.Context, in *SubscribeBroadcastEventRequest, opts ...grpc.CallOption) (*SubscribeBroadcastEventResponse, error) - UnsubscribeBroadcastEvent(ctx context.Context, in *UnsubscribeBroadcastEventRequest, opts ...grpc.CallOption) (*UnsubscribeBroadcastEventResponse, error) } type yorkieServiceClient struct { @@ -1387,24 +1158,6 @@ func (c *yorkieServiceClient) Broadcast(ctx context.Context, in *BroadcastReques return out, nil } -func (c *yorkieServiceClient) SubscribeBroadcastEvent(ctx context.Context, in *SubscribeBroadcastEventRequest, opts ...grpc.CallOption) (*SubscribeBroadcastEventResponse, error) { - out := new(SubscribeBroadcastEventResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/SubscribeBroadcastEvent", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *yorkieServiceClient) UnsubscribeBroadcastEvent(ctx context.Context, in *UnsubscribeBroadcastEventRequest, opts ...grpc.CallOption) (*UnsubscribeBroadcastEventResponse, error) { - out := new(UnsubscribeBroadcastEventResponse) - err := c.cc.Invoke(ctx, "/yorkie.v1.YorkieService/UnsubscribeBroadcastEvent", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // YorkieServiceServer is the server API for YorkieService service. type YorkieServiceServer interface { ActivateClient(context.Context, *ActivateClientRequest) (*ActivateClientResponse, error) @@ -1415,8 +1168,6 @@ type YorkieServiceServer interface { PushPullChanges(context.Context, *PushPullChangesRequest) (*PushPullChangesResponse, error) WatchDocument(*WatchDocumentRequest, YorkieService_WatchDocumentServer) error Broadcast(context.Context, *BroadcastRequest) (*BroadcastResponse, error) - SubscribeBroadcastEvent(context.Context, *SubscribeBroadcastEventRequest) (*SubscribeBroadcastEventResponse, error) - UnsubscribeBroadcastEvent(context.Context, *UnsubscribeBroadcastEventRequest) (*UnsubscribeBroadcastEventResponse, error) } // UnimplementedYorkieServiceServer can be embedded to have forward compatible implementations. @@ -1447,12 +1198,6 @@ func (*UnimplementedYorkieServiceServer) WatchDocument(req *WatchDocumentRequest func (*UnimplementedYorkieServiceServer) Broadcast(ctx context.Context, req *BroadcastRequest) (*BroadcastResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented") } -func (*UnimplementedYorkieServiceServer) SubscribeBroadcastEvent(ctx context.Context, req *SubscribeBroadcastEventRequest) (*SubscribeBroadcastEventResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubscribeBroadcastEvent not implemented") -} -func (*UnimplementedYorkieServiceServer) UnsubscribeBroadcastEvent(ctx context.Context, req *UnsubscribeBroadcastEventRequest) (*UnsubscribeBroadcastEventResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnsubscribeBroadcastEvent not implemented") -} func RegisterYorkieServiceServer(s *grpc.Server, srv YorkieServiceServer) { s.RegisterService(&_YorkieService_serviceDesc, srv) @@ -1605,42 +1350,6 @@ func _YorkieService_Broadcast_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _YorkieService_SubscribeBroadcastEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SubscribeBroadcastEventRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServiceServer).SubscribeBroadcastEvent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/yorkie.v1.YorkieService/SubscribeBroadcastEvent", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).SubscribeBroadcastEvent(ctx, req.(*SubscribeBroadcastEventRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _YorkieService_UnsubscribeBroadcastEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnsubscribeBroadcastEventRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(YorkieServiceServer).UnsubscribeBroadcastEvent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/yorkie.v1.YorkieService/UnsubscribeBroadcastEvent", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(YorkieServiceServer).UnsubscribeBroadcastEvent(ctx, req.(*UnsubscribeBroadcastEventRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _YorkieService_serviceDesc = grpc.ServiceDesc{ ServiceName: "yorkie.v1.YorkieService", HandlerType: (*YorkieServiceServer)(nil), @@ -1673,14 +1382,6 @@ var _YorkieService_serviceDesc = grpc.ServiceDesc{ MethodName: "Broadcast", Handler: _YorkieService_Broadcast_Handler, }, - { - MethodName: "SubscribeBroadcastEvent", - Handler: _YorkieService_SubscribeBroadcastEvent_Handler, - }, - { - MethodName: "UnsubscribeBroadcastEvent", - Handler: _YorkieService_UnsubscribeBroadcastEvent_Handler, - }, }, Streams: []grpc.StreamDesc{ { @@ -2113,16 +1814,16 @@ func (m *WatchDocumentResponse_Initialization_) MarshalToSizedBuffer(dAtA []byte } return len(dAtA) - i, nil } -func (m *WatchDocumentResponse_DocEvent) MarshalTo(dAtA []byte) (int, error) { +func (m *WatchDocumentResponse_Event) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WatchDocumentResponse_DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WatchDocumentResponse_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.DocEvent != nil { + if m.Event != nil { { - size, err := m.DocEvent.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Event.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2134,27 +1835,6 @@ func (m *WatchDocumentResponse_DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, } return len(dAtA) - i, nil } -func (m *WatchDocumentResponse_BroadcastEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchDocumentResponse_BroadcastEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BroadcastEvent != nil { - { - size, err := m.BroadcastEvent.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 *WatchDocumentResponse_Initialization) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2385,7 +2065,7 @@ func (m *PushPullChangesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *SubscribeBroadcastEventRequest) Marshal() (dAtA []byte, err error) { +func (m *BroadcastRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2395,12 +2075,12 @@ func (m *SubscribeBroadcastEventRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SubscribeBroadcastEventRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *BroadcastRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SubscribeBroadcastEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *BroadcastRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2409,10 +2089,17 @@ func (m *SubscribeBroadcastEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Type))) + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x22 + } + if len(m.Topic) > 0 { + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.Topic))) i-- dAtA[i] = 0x1a } @@ -2433,7 +2120,7 @@ func (m *SubscribeBroadcastEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *SubscribeBroadcastEventResponse) Marshal() (dAtA []byte, err error) { +func (m *BroadcastResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2443,12 +2130,12 @@ func (m *SubscribeBroadcastEventResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SubscribeBroadcastEventResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *BroadcastResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SubscribeBroadcastEventResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *BroadcastResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2460,186 +2147,29 @@ func (m *SubscribeBroadcastEventResponse) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } -func (m *UnsubscribeBroadcastEventRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +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 dAtA[:n], nil -} - -func (m *UnsubscribeBroadcastEventRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *UnsubscribeBroadcastEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *ActivateClientRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) + l = len(m.ClientKey) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x1a - } - if len(m.DocumentId) > 0 { - i -= len(m.DocumentId) - copy(dAtA[i:], m.DocumentId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) - 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 *UnsubscribeBroadcastEventResponse) 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 *UnsubscribeBroadcastEventResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UnsubscribeBroadcastEventResponse) 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 *BroadcastRequest) 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 *BroadcastRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BroadcastRequest) 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.Payload) > 0 { - i -= len(m.Payload) - copy(dAtA[i:], m.Payload) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Payload))) - i-- - dAtA[i] = 0x22 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x1a - } - if len(m.DocumentId) > 0 { - i -= len(m.DocumentId) - copy(dAtA[i:], m.DocumentId) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.DocumentId))) - 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 *BroadcastResponse) 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 *BroadcastResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BroadcastResponse) 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 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 *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) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } return n } @@ -2818,26 +2348,14 @@ func (m *WatchDocumentResponse_Initialization_) Size() (n int) { } return n } -func (m *WatchDocumentResponse_DocEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DocEvent != nil { - l = m.DocEvent.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - return n -} -func (m *WatchDocumentResponse_BroadcastEvent) Size() (n int) { +func (m *WatchDocumentResponse_Event) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.BroadcastEvent != nil { - l = m.BroadcastEvent.Size() + if m.Event != nil { + l = m.Event.Size() n += 1 + l + sovYorkie(uint64(l)) } return n @@ -2943,78 +2461,6 @@ func (m *PushPullChangesResponse) Size() (n int) { return n } -func (m *SubscribeBroadcastEventRequest) 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)) - } - l = len(m.DocumentId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SubscribeBroadcastEventResponse) 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 *UnsubscribeBroadcastEventRequest) 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)) - } - l = len(m.DocumentId) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovYorkie(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UnsubscribeBroadcastEventResponse) 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 *BroadcastRequest) Size() (n int) { if m == nil { return 0 @@ -3029,7 +2475,7 @@ func (m *BroadcastRequest) Size() (n int) { if l > 0 { n += 1 + l + sovYorkie(uint64(l)) } - l = len(m.Type) + l = len(m.Topic) if l > 0 { n += 1 + l + sovYorkie(uint64(l)) } @@ -4038,7 +3484,7 @@ func (m *WatchDocumentResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocEvent", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4069,42 +3515,7 @@ func (m *WatchDocumentResponse) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Body = &WatchDocumentResponse_DocEvent{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BroadcastEvent", 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 := &BroadcastEvent{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Body = &WatchDocumentResponse_BroadcastEvent{v} + m.Body = &WatchDocumentResponse_Event{v} iNdEx = postIndex default: iNdEx = preIndex @@ -4707,402 +4118,6 @@ func (m *PushPullChangesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *SubscribeBroadcastEventRequest) 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: SubscribeBroadcastEventRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SubscribeBroadcastEventRequest: 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 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.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", 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.DocumentId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = 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 *SubscribeBroadcastEventResponse) 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: SubscribeBroadcastEventResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SubscribeBroadcastEventResponse: 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 *UnsubscribeBroadcastEventRequest) 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: UnsubscribeBroadcastEventRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UnsubscribeBroadcastEventRequest: 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 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.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", 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.DocumentId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = 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 *UnsubscribeBroadcastEventResponse) 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: UnsubscribeBroadcastEventResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UnsubscribeBroadcastEventResponse: 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 *BroadcastRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5198,7 +4213,7 @@ func (m *BroadcastRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5226,7 +4241,7 @@ func (m *BroadcastRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.Topic = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { diff --git a/api/yorkie/v1/yorkie.proto b/api/yorkie/v1/yorkie.proto index e0f9f386e..bc23485b5 100644 --- a/api/yorkie/v1/yorkie.proto +++ b/api/yorkie/v1/yorkie.proto @@ -37,8 +37,6 @@ service YorkieService { rpc WatchDocument (WatchDocumentRequest) returns (stream WatchDocumentResponse) {} rpc Broadcast (BroadcastRequest) returns (BroadcastResponse) {} - rpc SubscribeBroadcastEvent (SubscribeBroadcastEventRequest) returns (SubscribeBroadcastEventResponse) {} - rpc UnsubscribeBroadcastEvent (UnsubscribeBroadcastEventRequest) returns (UnsubscribeBroadcastEventResponse) {} } message ActivateClientRequest { @@ -89,8 +87,7 @@ message WatchDocumentResponse { oneof body { Initialization initialization = 1; - DocEvent doc_event = 2; - BroadcastEvent broadcast_event = 3; + DocEvent event = 2; } } @@ -115,28 +112,10 @@ message PushPullChangesResponse { ChangePack change_pack = 1; } -message SubscribeBroadcastEventRequest { - string client_id = 1; - string document_id = 2; - string type = 3; -} - -message SubscribeBroadcastEventResponse { -} - -message UnsubscribeBroadcastEventRequest { - string client_id = 1; - string document_id = 2; - string type = 3; -} - -message UnsubscribeBroadcastEventResponse { -} - message BroadcastRequest { string client_id = 1; string document_id = 2; - string type = 3; + string topic = 3; bytes payload = 4; } diff --git a/client/client.go b/client/client.go index 3cdce1f8d..b03346fc5 100644 --- a/client/client.go +++ b/client/client.go @@ -98,6 +98,7 @@ const ( DocumentWatched WatchResponseType = "document-watched" DocumentUnwatched WatchResponseType = "document-unwatched" PresenceChanged WatchResponseType = "presence-changed" + DocumentBroadcast WatchResponseType = "document-broadcast" ) // WatchResponse is a structure representing response of Watch. @@ -409,7 +410,6 @@ func (c *Client) Watch( } rch := make(chan WatchResponse) - bch := make(chan *api.BroadcastEvent) stream, err := c.client.WatchDocument( withShardKey(ctx, c.options.APIKey, doc.Key().String()), @@ -426,7 +426,7 @@ func (c *Client) Watch( if err != nil { return nil, err } - if _, err := handleResponse(pbResp, doc, bch); err != nil { + if _, err := handleResponse(pbResp, doc); err != nil { return nil, err } @@ -438,7 +438,7 @@ func (c *Client) Watch( close(rch) return } - resp, err := handleResponse(pbResp, doc, bch) + resp, err := handleResponse(pbResp, doc) if err != nil { rch <- WatchResponse{Err: err} close(rch) @@ -482,24 +482,7 @@ func (c *Client) Watch( for { select { case r := <-doc.BroadcastRequests(): - // TODO(sejongk): How to deal with errors in the goroutine? - switch r.RequestType { - case document.Broadcast: - _ = c.broadcast(ctx, doc, r.EventType, r.Payload) - case document.Subscribe: - _ = c.subscribeBroadcastEvent(ctx, doc, r.EventType) - case document.Unsubscribe: - _ = c.unsubscribeBroadcastEvent(ctx, doc, r.EventType) - } - case b := <-bch: - if handler, ok := doc.BroadcastEventHandlers()[b.Type]; ok && handler != nil { - err := handler(b.Type, b.Publisher, b.Payload) - if err != nil { - if c.logger.Core().Enabled(zap.DebugLevel) { - c.logger.Debug("broadcast event handling error", zap.Error(err)) - } - } - } + doc.BroadcastResponses() <- c.broadcast(ctx, doc, r.Topic, r.Payload) case <-ctx.Done(): return } @@ -512,7 +495,6 @@ func (c *Client) Watch( func handleResponse( pbResp *api.WatchDocumentResponse, doc *document.Document, - bch chan *api.BroadcastEvent, ) (*WatchResponse, error) { switch resp := pbResp.Body.(type) { case *api.WatchDocumentResponse_Initialization_: @@ -527,14 +509,13 @@ func handleResponse( doc.SetOnlineClients(clientIDs...) return nil, nil - case *api.WatchDocumentResponse_DocEvent: - // Handle a document event - eventType, err := converter.FromEventType(resp.DocEvent.Type) + case *api.WatchDocumentResponse_Event: + eventType, err := converter.FromEventType(resp.Event.Type) if err != nil { return nil, err } - cli, err := time.ActorIDFromHex(resp.DocEvent.Publisher) + cli, err := time.ActorIDFromHex(resp.Event.Publisher) if err != nil { return nil, err } @@ -567,12 +548,17 @@ func handleResponse( cli.String(): p, }, }, nil + case types.DocumentBroadcastEvent: + eventBody := resp.Event.Body + // If the handler exists, it means that the broadcast topic has been subscribed to. + if handler, ok := doc.BroadcastEventHandlers()[eventBody.Topic]; ok && handler != nil { + err := handler(eventBody.Topic, resp.Event.Publisher, eventBody.Payload) + if err != nil { + return nil, err + } + } + return nil, nil } - - case *api.WatchDocumentResponse_BroadcastEvent: - // Handle a broadcast event - bch <- resp.BroadcastEvent - return nil, nil } return nil, ErrUnsupportedWatchResponseType } @@ -691,7 +677,7 @@ func (c *Client) Remove(ctx context.Context, doc *document.Document) error { return nil } -func (c *Client) broadcast(ctx context.Context, doc *document.Document, eventType string, payload []byte) error { +func (c *Client) broadcast(ctx context.Context, doc *document.Document, topic string, payload []byte) error { if c.status != activated { return ErrClientNotActivated } @@ -706,7 +692,7 @@ func (c *Client) broadcast(ctx context.Context, doc *document.Document, eventTyp &api.BroadcastRequest{ ClientId: c.id.String(), DocumentId: attachment.docID.String(), - Type: eventType, + Topic: topic, Payload: payload, }, ) @@ -717,56 +703,6 @@ func (c *Client) broadcast(ctx context.Context, doc *document.Document, eventTyp return nil } -func (c *Client) subscribeBroadcastEvent(ctx context.Context, doc *document.Document, eventType string) error { - if c.status != activated { - return ErrClientNotActivated - } - - attachment, ok := c.attachments[doc.Key()] - if !ok { - return ErrDocumentNotAttached - } - - _, err := c.client.SubscribeBroadcastEvent( - withShardKey(ctx, c.options.APIKey, doc.Key().String()), - &api.SubscribeBroadcastEventRequest{ - ClientId: c.id.String(), - DocumentId: attachment.docID.String(), - Type: eventType, - }, - ) - if err != nil { - return err - } - - return nil -} - -func (c *Client) unsubscribeBroadcastEvent(ctx context.Context, doc *document.Document, eventType string) error { - if c.status != activated { - return ErrClientNotActivated - } - - attachment, ok := c.attachments[doc.Key()] - if !ok { - return ErrDocumentNotAttached - } - - _, err := c.client.UnsubscribeBroadcastEvent( - withShardKey(ctx, c.options.APIKey, doc.Key().String()), - &api.UnsubscribeBroadcastEventRequest{ - ClientId: c.id.String(), - DocumentId: attachment.docID.String(), - Type: eventType, - }, - ) - if err != nil { - return err - } - - return nil -} - /** * withShardKey returns a context with the given shard key in metadata. */ diff --git a/pkg/document/document.go b/pkg/document/document.go index bda65b1a2..a68954610 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -32,10 +32,6 @@ import ( ) var ( - // ErrReservedEventType is returned when the event type is reserved. - ErrReservedEventType = errors.New( - "the event type is reserved for a different use case") - // ErrUnsupportedPayloadType is returned when the payload is unserializable to JSON. ErrUnsupportedPayloadType = errors.New( "the payload is an unsupported JSON type") @@ -64,27 +60,12 @@ const ( PresenceChangedEvent DocEventType = "presence-changed" ) -// BroadcastRequest represents a request related to "Broadcast" that will be sent -// through the client. +// BroadcastRequest represents a broadcast request that will be delivered to the client. type BroadcastRequest struct { - RequestType BroadcastRequestType - EventType string - Payload []byte + Topic string + Payload []byte } -// BroadcastRequestType represents the type of the broadcast request that will be -// sent through the client. -type BroadcastRequestType string - -const ( - // Broadcast means that there is a new message that should be broadcasted. - Broadcast BroadcastRequestType = "broadcast" - // Subscribe means that the document subscribes a new broadcast event. - Subscribe BroadcastRequestType = "subscribe" - // Unsubscribe means that the document unsubscribes the broadcast event. - Unsubscribe BroadcastRequestType = "unsubscribe" -) - // Document represents a document accessible to the user. // // How document works: @@ -107,24 +88,27 @@ type Document struct { // docEvents is the channel to send events that occurred in the document. docEvents chan DocEvent - // broadcastRequests is the channel to send requests related to "Broadcast" - // that occurred in the document. + // broadcastRequests is the send-only channel to send broadcast requests. broadcastRequests chan BroadcastRequest + // broadcastResponses is the receive-only channel to receive broadcast responses. + broadcastResponses chan error + // broadcastEventHandlers is a map of registered event handlers for events. broadcastEventHandlers map[string]func( - eventType, publisher string, + topic, publisher string, payload []byte) error } // New creates a new instance of Document. func New(key key.Key) *Document { return &Document{ - doc: NewInternalDocument(key), - docEvents: make(chan DocEvent, 1), - broadcastRequests: make(chan BroadcastRequest, 1), + doc: NewInternalDocument(key), + docEvents: make(chan DocEvent, 1), + broadcastRequests: make(chan BroadcastRequest, 1), + broadcastResponses: make(chan error, 1), broadcastEventHandlers: make(map[string]func( - eventType, publisher string, + topic, publisher string, payload []byte) error), } } @@ -386,64 +370,44 @@ func (d *Document) BroadcastRequests() <-chan BroadcastRequest { return d.broadcastRequests } -// Broadcast encodes the payload and makes a "Broadcast" type request. -func (d *Document) Broadcast(eventType string, payload any) error { - if isEventTypeReserved(eventType) { - return ErrReservedEventType - } +// BroadcastResponses returns the broadcast responses of this document. +func (d *Document) BroadcastResponses() chan error { + return d.broadcastResponses +} +// Broadcast encodes the payload and makes a "Broadcast" type request. +func (d *Document) Broadcast(topic string, payload any) error { marshaled, err := gojson.Marshal(payload) if err != nil { return ErrUnsupportedPayloadType } d.broadcastRequests <- BroadcastRequest{ - RequestType: Broadcast, - EventType: eventType, - Payload: marshaled, + Topic: topic, + Payload: marshaled, } - return nil + return <-d.broadcastResponses } -// SubscribeBroadcastEvent registers an event handler and makes +// SubscribeBroadcastEvent subscribes to the registers an event handler and makes // a "Subscribe" type request. func (d *Document) SubscribeBroadcastEvent( - eventType string, - handler func(eventType, publisher string, payload []byte) error, -) error { - if isEventTypeReserved(eventType) { - return ErrReservedEventType - } - - d.broadcastEventHandlers[eventType] = handler - - d.broadcastRequests <- BroadcastRequest{ - RequestType: Subscribe, - EventType: eventType, - } - return nil + topic string, + handler func(topic, publisher string, payload []byte) error, +) { + d.broadcastEventHandlers[topic] = handler } // UnsubscribeBroadcastEvent deregisters the event handler and makes // a "Unsubscribe" type request. func (d *Document) UnsubscribeBroadcastEvent( - eventType string, -) error { - if isEventTypeReserved(eventType) { - return ErrReservedEventType - } - - delete(d.broadcastEventHandlers, eventType) - - d.broadcastRequests <- BroadcastRequest{ - RequestType: Unsubscribe, - EventType: eventType, - } - return nil + topic string, +) { + delete(d.broadcastEventHandlers, topic) } // BroadcastEventHandlers returns registered event handlers for events. -func (d *Document) BroadcastEventHandlers() map[string](func(eventType string, +func (d *Document) BroadcastEventHandlers() map[string](func(topic string, publisher string, payload []byte) error) { return d.broadcastEventHandlers } @@ -464,7 +428,3 @@ func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { } return "" } - -func isEventTypeReserved(eventType string) bool { - return eventType == "document" -} diff --git a/server/backend/sync/coordinator.go b/server/backend/sync/coordinator.go index 4853befdf..deab2105c 100644 --- a/server/backend/sync/coordinator.go +++ b/server/backend/sync/coordinator.go @@ -37,51 +37,25 @@ type Coordinator interface { // NewLocker creates a sync.Locker. NewLocker(ctx context.Context, key Key) (Locker, error) - // SubscribeDoc subscribes to the given documents. - SubscribeDoc( + // Subscribe subscribes to the given documents. + Subscribe( ctx context.Context, subscriber *time.ActorID, documentID types.ID, ) (*Subscription, []*time.ActorID, error) - // UnsubscribeDoc unsubscribes from the given documents. - UnsubscribeDoc( + // Unsubscribe unsubscribes from the given documents. + Unsubscribe( ctx context.Context, documentID types.ID, sub *Subscription, ) error - // PublishDocEvent publishes the given document event. - PublishDocEvent( - ctx context.Context, - publisherID *time.ActorID, - event types.DocEvent, - ) - - // SubscribeBroadcastEvent subscribes to the specified broadcast - // event type for the given document. - SubscribeBroadcastEvent( - ctx context.Context, - documentID types.ID, - eventType string, - subscriber *time.ActorID, - ) + // Publish publishes the given event. + Publish(ctx context.Context, publisherID *time.ActorID, event DocEvent) - // UnsubscribeBroadcastEvent unsubscribes to the specified broadcast - // event type for the given document. - UnsubscribeBroadcastEvent( - ctx context.Context, - documentID types.ID, - eventType string, - subscriber *time.ActorID, - ) - - // PublishBroadcastEvent publishes the given broadcast event. - PublishBroadcastEvent( - ctx context.Context, - documentID types.ID, - event types.BroadcastEvent, - ) + // PublishToLocal publishes the given event. + PublishToLocal(ctx context.Context, publisherID *time.ActorID, event DocEvent) // Members returns the members of this cluster. Members() map[string]*ServerInfo diff --git a/server/backend/sync/memory/coordinator.go b/server/backend/sync/memory/coordinator.go index b3f256cf9..57b6ca909 100644 --- a/server/backend/sync/memory/coordinator.go +++ b/server/backend/sync/memory/coordinator.go @@ -54,69 +54,47 @@ func (c *Coordinator) NewLocker( }, nil } -// SubscribeDoc subscribes to the given documents. -func (c *Coordinator) SubscribeDoc( +// Subscribe subscribes to the given documents. +func (c *Coordinator) Subscribe( ctx context.Context, subscriber *time.ActorID, documentID types.ID, ) (*sync.Subscription, []*time.ActorID, error) { - sub, err := c.pubSub.SubscribeDoc(ctx, subscriber, documentID) + sub, err := c.pubSub.Subscribe(ctx, subscriber, documentID) if err != nil { return nil, nil, err } - c.pubSub.SubscribeEvent(ctx, documentID, "document", subscriber) - ids := c.pubSub.ClientIDs(documentID) return sub, ids, nil } -// UnsubscribeDoc unsubscribes the given documents. -func (c *Coordinator) UnsubscribeDoc( +// Unsubscribe unsubscribes the given documents. +func (c *Coordinator) Unsubscribe( ctx context.Context, documentID types.ID, sub *sync.Subscription, ) error { - c.pubSub.UnsubscribeDoc(ctx, documentID, sub) + c.pubSub.Unsubscribe(ctx, documentID, sub) return nil } -// PublishDocEvent publishes the given document event. -func (c *Coordinator) PublishDocEvent( +// Publish publishes the given event. +func (c *Coordinator) Publish( ctx context.Context, publisherID *time.ActorID, - event types.DocEvent, -) { - c.pubSub.Publish(ctx, event.DocumentID, "document", publisherID, event) -} - -// SubscribeBroadcastEvent subscribes the given broadcast event type. -func (c *Coordinator) SubscribeBroadcastEvent( - ctx context.Context, - documentID types.ID, - eventType string, - subscriber *time.ActorID, + event sync.DocEvent, ) { - c.pubSub.SubscribeEvent(ctx, documentID, eventType, subscriber) + c.pubSub.Publish(ctx, publisherID, event) } -// UnsubscribeBroadcastEvent unsubscribes the given broadcast event type. -func (c *Coordinator) UnsubscribeBroadcastEvent( +// PublishToLocal publishes the given event. +func (c *Coordinator) PublishToLocal( ctx context.Context, - documentID types.ID, - eventType string, - subscriber *time.ActorID, -) { - c.pubSub.UnsubscribeEvent(ctx, documentID, eventType, subscriber) -} - -// PublishBroadcastEvent publishes the given broadcast event. -func (c *Coordinator) PublishBroadcastEvent( - ctx context.Context, - documentID types.ID, - event types.BroadcastEvent, + publisherID *time.ActorID, + event sync.DocEvent, ) { - c.pubSub.Publish(ctx, documentID, event.Type, event.Publisher, event) + c.pubSub.Publish(ctx, publisherID, event) } // Members returns the members of this cluster. diff --git a/server/backend/sync/memory/coordinator_test.go b/server/backend/sync/memory/coordinator_test.go index 841079573..02e2e5ce4 100644 --- a/server/backend/sync/memory/coordinator_test.go +++ b/server/backend/sync/memory/coordinator_test.go @@ -37,7 +37,7 @@ func TestCoordinator(t *testing.T) { id, err := time.ActorIDFromBytes([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, byte(i)}) assert.NoError(t, err) - _, clientIDs, err := coordinator.SubscribeDoc(ctx, id, docID) + _, clientIDs, err := coordinator.Subscribe(ctx, id, docID) assert.NoError(t, err) assert.Len(t, clientIDs, i+1) } diff --git a/server/backend/sync/memory/pubsub.go b/server/backend/sync/memory/pubsub.go index fea238d5f..a01703784 100644 --- a/server/backend/sync/memory/pubsub.go +++ b/server/backend/sync/memory/pubsub.go @@ -29,145 +29,80 @@ import ( "github.com/yorkie-team/yorkie/server/logging" ) -// subscriptionIDs is a set of subscriptionIDs. -type subscribers map[string]struct{} - -func (s subscribers) add(subscriber *time.ActorID) { - s[subscriber.String()] = struct{}{} -} - -func (s subscribers) contains(subscriber *time.ActorID) bool { - _, exists := s[subscriber.String()] - return exists -} - -func (s subscribers) remove(subscriber *time.ActorID) { - delete(s, subscriber.String()) -} - -func (s subscribers) len() int { - return len(s) -} - -// DocSubs has the subscription data of the document. -type DocSubs struct { - documentID types.ID - subMapBySubscriber map[string]*sync.Subscription - subscribersMapByEvent map[string]subscribers +// subscriptions is a map of subscriptions. +type subscriptions struct { + internalMap map[string]*sync.Subscription } -// NewDocSubs returns a new DocSubs of the given document id. -func NewDocSubs(docID types.ID) *DocSubs { - return &DocSubs{ - documentID: docID, - subMapBySubscriber: make(map[string]*sync.Subscription), - subscribersMapByEvent: make(map[string]subscribers), +func newSubscriptions() *subscriptions { + return &subscriptions{ + internalMap: make(map[string]*sync.Subscription), } } -// Len returns the number of the subscribers in the DocSubs. -func (s *DocSubs) Len() int { - return len(s.subMapBySubscriber) +// Add adds the given subscription. +func (s *subscriptions) Add(sub *sync.Subscription) { + s.internalMap[sub.ID()] = sub } -// Add adds the given subscription to the DocSubs. -func (s *DocSubs) Add(sub *sync.Subscription) { - s.subMapBySubscriber[sub.Subscriber().String()] = sub -} - -// Remove closes the given subscription and cleans up the -// subscription entries related to it. -func (s *DocSubs) Remove(subscriber *time.ActorID) { - if sub, ok := s.subMapBySubscriber[subscriber.String()]; ok { - // Close the subscription. - sub.Close() - - // Remove the subscriber from the subscriber lists of subscribed events. - for t := range sub.Types() { - if subscribers, ok := s.subscribersMapByEvent[t]; ok { - subscribers.remove(subscriber) - - if subscribers.len() == 0 { - delete(s.subscribersMapByEvent, t) - } - } - } - - delete(s.subMapBySubscriber, subscriber.String()) - } - - // Remove the subscription from subMapBySubscriber - delete(s.subMapBySubscriber, subscriber.String()) +// Map returns the internal map of these subscriptions. +func (s *subscriptions) Map() map[string]*sync.Subscription { + return s.internalMap } -// SubscribeEvent adds a new subscription entry for the given eventType to the DocSubs. -func (s *DocSubs) SubscribeEvent(eventType string, subscriber *time.ActorID) { - if sub, ok := s.subMapBySubscriber[subscriber.String()]; ok { - if _, ok := s.subscribersMapByEvent[eventType]; !ok { - s.subscribersMapByEvent[eventType] = make(subscribers) - } - s.subscribersMapByEvent[eventType].add(subscriber) - - sub.AddType(eventType) +// Delete deletes the subscription of the given id. +func (s *subscriptions) Delete(id string) { + if subscription, ok := s.internalMap[id]; ok { + subscription.Close() } + delete(s.internalMap, id) } -// UnsubscribeEvent removes the subscription entry for the given eventType from the DocSubs. -func (s *DocSubs) UnsubscribeEvent(eventType string, subscriber *time.ActorID) { - if sub, ok := s.subMapBySubscriber[subscriber.String()]; ok { - if subscribers, ok := s.subscribersMapByEvent[eventType]; ok { - subscribers.remove(subscriber) - - if subscribers.len() == 0 { - delete(s.subscribersMapByEvent, eventType) - } - } - - sub.RemoveType(eventType) - } +// Len returns the length of these subscriptions. +func (s *subscriptions) Len() int { + return len(s.internalMap) } // PubSub is the memory implementation of PubSub, used for single server. type PubSub struct { - docSubsMapMu *gosync.RWMutex - docSubsMapByDocID map[types.ID]*DocSubs + subscriptionsMapMu *gosync.RWMutex + subscriptionsMapByDocID map[types.ID]*subscriptions } // NewPubSub creates an instance of PubSub. func NewPubSub() *PubSub { return &PubSub{ - docSubsMapMu: &gosync.RWMutex{}, - docSubsMapByDocID: make(map[types.ID]*DocSubs), + subscriptionsMapMu: &gosync.RWMutex{}, + subscriptionsMapByDocID: make(map[types.ID]*subscriptions), } } -// SubscribeDoc subscribes to the given document keys. -func (m *PubSub) SubscribeDoc( +// Subscribe subscribes to the given document keys. +func (m *PubSub) Subscribe( ctx context.Context, subscriber *time.ActorID, documentID types.ID, ) (*sync.Subscription, error) { - m.docSubsMapMu.Lock() - defer m.docSubsMapMu.Unlock() - if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `SubscribeDoc(%s,%s) Start`, + `Subscribe(%s,%s) Start`, documentID.String(), subscriber.String(), ) } + m.subscriptionsMapMu.Lock() + defer m.subscriptionsMapMu.Unlock() + sub := sync.NewSubscription(subscriber) - if _, ok := m.docSubsMapByDocID[documentID]; !ok { - m.docSubsMapByDocID[documentID] = NewDocSubs(documentID) + if _, ok := m.subscriptionsMapByDocID[documentID]; !ok { + m.subscriptionsMapByDocID[documentID] = newSubscriptions() } - - m.docSubsMapByDocID[documentID].Add(sub) + m.subscriptionsMapByDocID[documentID].Add(sub) if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `SubscribeDoc(%s,%s) End`, + `Subscribe(%s,%s) End`, documentID.String(), subscriber.String(), ) @@ -175,110 +110,38 @@ func (m *PubSub) SubscribeDoc( return sub, nil } -// UnsubscribeDoc unsubscribes the given docKeys. -func (m *PubSub) UnsubscribeDoc( +// Unsubscribe unsubscribes the given docKeys. +func (m *PubSub) Unsubscribe( ctx context.Context, documentID types.ID, sub *sync.Subscription, ) { - m.docSubsMapMu.Lock() - defer m.docSubsMapMu.Unlock() - - docSubs, ok := m.docSubsMapByDocID[documentID] - if !ok { - return - } - - if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf( - `UnsubscribeDoc(%s,%s) Start`, - documentID, - sub.Subscriber().String(), - ) - } - - docSubs.Remove(sub.Subscriber()) - - if docSubs.Len() == 0 { - delete(m.docSubsMapByDocID, documentID) - } + m.subscriptionsMapMu.Lock() + defer m.subscriptionsMapMu.Unlock() if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `UnsubscribeDoc(%s,%s) End`, + `Unsubscribe(%s,%s) Start`, documentID, sub.Subscriber().String(), ) } -} -// SubscribeEvent subscribes to the given event that occurred in the specified document. -func (m *PubSub) SubscribeEvent( - ctx context.Context, - documentID types.ID, - eventType string, - subscriber *time.ActorID, -) { - m.docSubsMapMu.Lock() - defer m.docSubsMapMu.Unlock() + sub.Close() - docSubs, ok := m.docSubsMapByDocID[documentID] - if !ok { - return - } + if subs, ok := m.subscriptionsMapByDocID[documentID]; ok { + subs.Delete(sub.ID()) - if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf( - `SubscribeEvent(%s,%s,%s) Start`, - documentID, - eventType, - subscriber, - ) - } - docSubs.SubscribeEvent(eventType, subscriber) - - if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf( - `SubscribeEvent(%s,%s,%s) End`, - documentID, - eventType, - subscriber, - ) - } -} - -// UnsubscribeEvent unsubscribes to the given event that occurred in the specified document. -func (m *PubSub) UnsubscribeEvent( - ctx context.Context, - documentID types.ID, - eventType string, - subscriber *time.ActorID, -) { - m.docSubsMapMu.Lock() - defer m.docSubsMapMu.Unlock() - - docSubs, ok := m.docSubsMapByDocID[documentID] - if !ok { - return - } - - if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf( - `UnsubscribeEvent(%s,%s,%s) Start`, - documentID, - eventType, - subscriber, - ) + if subs.Len() == 0 { + delete(m.subscriptionsMapByDocID, documentID) + } } - docSubs.UnsubscribeEvent(eventType, subscriber) - if logging.Enabled(zap.DebugLevel) { logging.From(ctx).Debugf( - `UnsubscribeEvent(%s,%s,%s) End`, + `Unsubscribe(%s,%s) End`, documentID, - eventType, - subscriber, + sub.Subscriber().String(), ) } } @@ -286,92 +149,60 @@ func (m *PubSub) UnsubscribeEvent( // Publish publishes the given event. func (m *PubSub) Publish( ctx context.Context, - documentID types.ID, - eventType string, publisherID *time.ActorID, - event sync.Event, + event sync.DocEvent, ) { - m.docSubsMapMu.RLock() - defer m.docSubsMapMu.RUnlock() + m.subscriptionsMapMu.RLock() + defer m.subscriptionsMapMu.RUnlock() + documentID := event.DocumentID if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf( - `Publish(%s,%s,%s) Start`, - documentID, - eventType, - publisherID, - ) - } - - docSubs, ok := m.docSubsMapByDocID[documentID] - if !ok { - return - } - - subscribers, ok := docSubs.subscribersMapByEvent[eventType] - if !ok { - return + logging.From(ctx).Debugf(`Publish(%s,%s) Start`, documentID.String(), publisherID.String()) } - for subscriber := range subscribers { - sub, ok := docSubs.subMapBySubscriber[subscriber] - if !ok { - continue - } - - if sub.Subscriber().Compare(publisherID) == 0 { - continue - } + if subs, ok := m.subscriptionsMapByDocID[documentID]; ok { + for _, sub := range subs.Map() { + if sub.Subscriber().Compare(publisherID) == 0 { + continue + } - if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf( - `Publish %s(%s,%s) to %s`, - eventType, - documentID.String(), - publisherID.String(), - sub.Subscriber().String(), - ) - } + if logging.Enabled(zap.DebugLevel) { + logging.From(ctx).Debugf( + `Publish %s(%s,%s) to %s`, + event.Type, + documentID.String(), + publisherID.String(), + sub.Subscriber().String(), + ) + } - // NOTE: When a subscription is being closed by a subscriber, - // the subscriber may not receive messages. - select { - case sub.Events() <- event: - case <-gotime.After(100 * gotime.Millisecond): - logging.From(ctx).Warnf( - `Publish %s(%s,%s) to %s timeout`, - eventType, - documentID.String(), - publisherID.String(), - sub.Subscriber().String(), - ) + // NOTE: When a subscription is being closed by a subscriber, + // the subscriber may not receive messages. + select { + case sub.Events() <- event: + case <-gotime.After(100 * gotime.Millisecond): + logging.From(ctx).Warnf( + `Publish(%s,%s) to %s timeout`, + documentID.String(), + publisherID.String(), + sub.Subscriber().String(), + ) + } } - } if logging.Enabled(zap.DebugLevel) { - logging.From(ctx).Debugf( - `Publish(%s,%s,%s) End`, - documentID, - eventType, - publisherID, - ) + logging.From(ctx).Debugf(`Publish(%s,%s) End`, documentID.String(), publisherID.String()) } } // ClientIDs returns the clients of the given document. func (m *PubSub) ClientIDs(documentID types.ID) []*time.ActorID { - m.docSubsMapMu.RLock() - defer m.docSubsMapMu.RUnlock() - - docSubs, ok := m.docSubsMapByDocID[documentID] - if !ok { - return nil - } + m.subscriptionsMapMu.RLock() + defer m.subscriptionsMapMu.RUnlock() var ids []*time.ActorID - for _, sub := range docSubs.subMapBySubscriber { + for _, sub := range m.subscriptionsMapByDocID[documentID].Map() { ids = append(ids, sub.Subscriber()) } - return ids } diff --git a/server/backend/sync/memory/pubsub_test.go b/server/backend/sync/memory/pubsub_test.go index 34a71d82c..f1152bfcc 100644 --- a/server/backend/sync/memory/pubsub_test.go +++ b/server/backend/sync/memory/pubsub_test.go @@ -25,6 +25,7 @@ import ( "github.com/yorkie-team/yorkie/api/types" "github.com/yorkie-team/yorkie/pkg/document/time" + "github.com/yorkie-team/yorkie/server/backend/sync" "github.com/yorkie-team/yorkie/server/backend/sync/memory" ) @@ -37,7 +38,7 @@ func TestPubSub(t *testing.T) { t.Run("publish subscribe test", func(t *testing.T) { pubSub := memory.NewPubSub() id := types.ID(t.Name() + "id") - docEvent := types.DocEvent{ + docEvent := sync.DocEvent{ Type: types.DocumentWatchedEvent, Publisher: idB, DocumentID: id, @@ -45,14 +46,10 @@ func TestPubSub(t *testing.T) { ctx := context.Background() // subscribe the documents by actorA - subA, err := pubSub.SubscribeDoc(ctx, idA, id) + subA, err := pubSub.Subscribe(ctx, idA, id) assert.NoError(t, err) - - // subscribe "document" type events - pubSub.SubscribeEvent(ctx, id, "document", idA) - defer func() { - pubSub.UnsubscribeDoc(ctx, id, subA) + pubSub.Unsubscribe(ctx, id, subA) }() var wg gosync.WaitGroup @@ -64,7 +61,7 @@ func TestPubSub(t *testing.T) { }() // publish the event to the documents by actorB - pubSub.Publish(ctx, id, "document", idB, docEvent) + pubSub.Publish(ctx, idB, docEvent) wg.Wait() }) } diff --git a/server/backend/sync/pubsub.go b/server/backend/sync/pubsub.go index 7f6b24402..c4551b176 100644 --- a/server/backend/sync/pubsub.go +++ b/server/backend/sync/pubsub.go @@ -19,38 +19,24 @@ package sync import ( "github.com/rs/xid" + "github.com/yorkie-team/yorkie/api/types" "github.com/yorkie-team/yorkie/pkg/document/time" ) -// EventTypes stores the subscribed event types. -type EventTypes map[string]struct{} - -// Add adds the given type to EventTypes. -func (s EventTypes) Add(t string) { - s[t] = struct{}{} -} - -// Remove removes the given type from EventTypes. -func (s EventTypes) Remove(t string) { - delete(s, t) -} - // Subscription represents a subscription of a subscriber to documents. type Subscription struct { id string - types EventTypes subscriber *time.ActorID closed bool - events chan Event + events chan DocEvent } // NewSubscription creates a new instance of Subscription. func NewSubscription(subscriber *time.ActorID) *Subscription { return &Subscription{ id: xid.New().String(), - types: make(EventTypes), subscriber: subscriber, - events: make(chan Event, 1), + events: make(chan DocEvent, 1), } } @@ -59,23 +45,16 @@ func (s *Subscription) ID() string { return s.id } -// Types returns the subscribed event type list. -func (s *Subscription) Types() EventTypes { - return s.types +// DocEvent represents events that occur related to the document. +type DocEvent struct { + Type types.DocEventType + Publisher *time.ActorID + DocumentID types.ID + Body types.DocEventBody } -// AddType adds the event type to the subscribed event type list. -func (s *Subscription) AddType(t string) { - s.types.Add(t) -} - -// RemoveType removes the event type from the subscribed event type list. -func (s *Subscription) RemoveType(t string) { - s.types.Remove(t) -} - -// Events returns the Event channel of this subscription. -func (s *Subscription) Events() chan Event { +// Events returns the DocEvent channel of this subscription. +func (s *Subscription) Events() chan DocEvent { return s.events } @@ -93,6 +72,3 @@ func (s *Subscription) Close() { s.closed = true close(s.events) } - -// Event represents a type for publishable events. -type Event interface{} diff --git a/server/packs/packs.go b/server/packs/packs.go index 504a13862..180644891 100644 --- a/server/packs/packs.go +++ b/server/packs/packs.go @@ -128,10 +128,10 @@ func PushPull( return } - be.Coordinator.PublishDocEvent( + be.Coordinator.Publish( ctx, publisherID, - types.DocEvent{ + sync.DocEvent{ Type: types.DocumentChangedEvent, Publisher: publisherID, DocumentID: docInfo.ID, diff --git a/server/rpc/admin_server.go b/server/rpc/admin_server.go index b6d12cb33..2e754ff25 100644 --- a/server/rpc/admin_server.go +++ b/server/rpc/admin_server.go @@ -26,6 +26,7 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/server/backend" + "github.com/yorkie-team/yorkie/server/backend/sync" "github.com/yorkie-team/yorkie/server/documents" "github.com/yorkie-team/yorkie/server/logging" "github.com/yorkie-team/yorkie/server/packs" @@ -370,10 +371,10 @@ func (s *adminServer) RemoveDocumentByAdmin( // TODO(emplam27): Change the publisherID to the actual user ID. This is a temporary solution. publisherID := time.InitialActorID - s.backend.Coordinator.PublishDocEvent( + s.backend.Coordinator.Publish( ctx, publisherID, - types.DocEvent{ + sync.DocEvent{ Type: types.DocumentChangedEvent, Publisher: publisherID, DocumentID: docInfo.ID, diff --git a/server/rpc/yorkie_server.go b/server/rpc/yorkie_server.go index e698989c7..d41faac7f 100644 --- a/server/rpc/yorkie_server.go +++ b/server/rpc/yorkie_server.go @@ -18,7 +18,6 @@ package rpc import ( "context" - "errors" "fmt" "github.com/yorkie-team/yorkie/api/converter" @@ -36,12 +35,6 @@ import ( "github.com/yorkie-team/yorkie/server/rpc/auth" ) -var ( - // ErrUnsupportedEventType is returned when the given event type is not - // supported. - ErrUnsupportedEventType = errors.New("unsupported event type") -) - type yorkieServer struct { backend *backend.Backend serviceCtx context.Context @@ -419,38 +412,23 @@ func (s *yorkieServer) WatchDocument( case <-stream.Context().Done(): return nil case event := <-subscription.Events(): - var pbResp *api.WatchDocumentResponse - - if docEvent, ok := event.(types.DocEvent); ok { - eventType, err := converter.ToDocEventType(docEvent.Type) - if err != nil { - return err - } - - pbResp = &api.WatchDocumentResponse{ - Body: &api.WatchDocumentResponse_DocEvent{ - DocEvent: &api.DocEvent{ - Type: eventType, - Publisher: docEvent.Publisher.String(), - }, - }, - } - - } else if broadcastEvent, ok := event.(types.BroadcastEvent); ok { - pbResp = &api.WatchDocumentResponse{ - Body: &api.WatchDocumentResponse_BroadcastEvent{ - BroadcastEvent: &api.BroadcastEvent{ - Type: broadcastEvent.Type, - Publisher: broadcastEvent.Publisher.String(), - Payload: broadcastEvent.Payload, - }, - }, - } - } else { - return ErrUnsupportedEventType + eventType, err := converter.ToDocEventType(event.Type) + if err != nil { + return err } - if err := stream.Send(pbResp); err != nil { + if err := stream.Send(&api.WatchDocumentResponse{ + Body: &api.WatchDocumentResponse_Event{ + Event: &api.DocEvent{ + Type: eventType, + Publisher: event.Publisher.String(), + Body: &api.DocEventBody{ + Topic: event.Body.Topic, + Payload: event.Body.Payload, + }, + }, + }, + }); err != nil { return err } } @@ -533,16 +511,16 @@ func (s *yorkieServer) watchDoc( clientID *time.ActorID, documentID types.ID, ) (*sync.Subscription, []*time.ActorID, error) { - subscription, clientIDs, err := s.backend.Coordinator.SubscribeDoc(ctx, clientID, documentID) + subscription, clientIDs, err := s.backend.Coordinator.Subscribe(ctx, clientID, documentID) if err != nil { logging.From(ctx).Error(err) return nil, nil, err } - s.backend.Coordinator.PublishDocEvent( + s.backend.Coordinator.Publish( ctx, subscription.Subscriber(), - types.DocEvent{ + sync.DocEvent{ Type: types.DocumentWatchedEvent, Publisher: subscription.Subscriber(), DocumentID: documentID, @@ -557,11 +535,11 @@ func (s *yorkieServer) unwatchDoc( documentID types.ID, ) { ctx := context.Background() - _ = s.backend.Coordinator.UnsubscribeDoc(ctx, documentID, subscription) - s.backend.Coordinator.PublishDocEvent( + _ = s.backend.Coordinator.Unsubscribe(ctx, documentID, subscription) + s.backend.Coordinator.Publish( ctx, subscription.Subscriber(), - types.DocEvent{ + sync.DocEvent{ Type: types.DocumentUnwatchedEvent, Publisher: subscription.Subscriber(), DocumentID: documentID, @@ -593,7 +571,7 @@ func (s *yorkieServer) Broadcast( return nil, err } - // TODO(sejongk): It seems better to use a separate auth attributes for broadcast + // TODO(sejongk): It seems better to use a separate auth attributes for broadcast later if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ Method: types.Broadcast, Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), @@ -609,95 +587,19 @@ func (s *yorkieServer) Broadcast( if err != nil { return nil, err } - s.backend.Coordinator.PublishBroadcastEvent( + s.backend.Coordinator.Publish( ctx, - docID, - types.BroadcastEvent{ - Type: req.Type, - Publisher: clientID, - Payload: req.Payload, + clientID, + sync.DocEvent{ + Type: types.DocumentBroadcastEvent, + Publisher: clientID, + DocumentID: docID, + Body: types.DocEventBody{ + Topic: req.Topic, + Payload: req.Payload, + }, }, ) return &api.BroadcastResponse{}, nil } - -func (s *yorkieServer) SubscribeBroadcastEvent( - ctx context.Context, - req *api.SubscribeBroadcastEventRequest, -) (*api.SubscribeBroadcastEventResponse, error) { - clientID, err := time.ActorIDFromHex(req.ClientId) - if err != nil { - return nil, err - } - docID, err := converter.FromDocumentID(req.DocumentId) - if err != nil { - return nil, err - } - - docInfo, err := documents.FindDocInfo( - ctx, - s.backend, - projects.From(ctx), - docID, - ) - if err != nil { - return nil, nil - } - - // TODO(sejongk): It seems better to use a separate auth attributes for broadcast - if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ - Method: types.SubscribeBroadcastEvent, - Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), - }); err != nil { - return nil, err - } - - project := projects.From(ctx) - if _, err = clients.FindClientInfo(ctx, s.backend.DB, project, clientID); err != nil { - return nil, err - } - s.backend.Coordinator.SubscribeBroadcastEvent(ctx, docID, req.Type, clientID) - - return &api.SubscribeBroadcastEventResponse{}, nil -} - -func (s *yorkieServer) UnsubscribeBroadcastEvent( - ctx context.Context, - req *api.UnsubscribeBroadcastEventRequest, -) (*api.UnsubscribeBroadcastEventResponse, error) { - clientID, err := time.ActorIDFromHex(req.ClientId) - if err != nil { - return nil, err - } - docID, err := converter.FromDocumentID(req.DocumentId) - if err != nil { - return nil, err - } - - docInfo, err := documents.FindDocInfo( - ctx, - s.backend, - projects.From(ctx), - docID, - ) - if err != nil { - return nil, nil - } - - if err := auth.VerifyAccess(ctx, s.backend, &types.AccessInfo{ - Method: types.UnsubscribeBroadcastEvent, - Attributes: types.NewAccessAttributes([]key.Key{docInfo.Key}, types.Read), - }); err != nil { - return nil, err - } - - project := projects.From(ctx) - if _, err = clients.FindClientInfo(ctx, s.backend.DB, project, clientID); err != nil { - return nil, err - } - - s.backend.Coordinator.UnsubscribeBroadcastEvent(ctx, docID, req.Type, clientID) - - return &api.UnsubscribeBroadcastEventResponse{}, nil -} diff --git a/test/integration/document_test.go b/test/integration/document_test.go index d685b0424..af08222ae 100644 --- a/test/integration/document_test.go +++ b/test/integration/document_test.go @@ -21,6 +21,7 @@ package integration import ( "context" gojson "encoding/json" + "errors" "io" "sync" "testing" @@ -424,8 +425,9 @@ func TestDocument(t *testing.T) { t.Run("broadcast to subscribers except publisher test", func(t *testing.T) { bch := make(chan string) ctx := context.Background() - handler := func(eventType, publisher string, payload []byte) error { + handler := func(topic, publisher string, payload []byte) error { var mentionedBy string + assert.Equal(t, topic, "mention") assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) // Send the unmarshaled payload to the channel to notify that this // subscriber receives the event. @@ -437,22 +439,19 @@ func TestDocument(t *testing.T) { assert.NoError(t, c1.Attach(ctx, d1)) rch1, err := c1.Watch(ctx, d1) assert.NoError(t, err) - err = d1.SubscribeBroadcastEvent("mention", handler) - assert.NoError(t, err) + d1.SubscribeBroadcastEvent("mention", handler) d2 := document.New(helper.TestDocKey(t)) assert.NoError(t, c2.Attach(ctx, d2)) rch2, err := c2.Watch(ctx, d2) assert.NoError(t, err) - err = d2.SubscribeBroadcastEvent("mention", handler) - assert.NoError(t, err) + d2.SubscribeBroadcastEvent("mention", handler) d3 := document.New(helper.TestDocKey(t)) assert.NoError(t, c3.Attach(ctx, d3)) rch3, err := c3.Watch(ctx, d3) assert.NoError(t, err) - err = d3.SubscribeBroadcastEvent("mention", handler) - assert.NoError(t, err) + d3.SubscribeBroadcastEvent("mention", handler) err = d3.Broadcast("mention", "yorkie") assert.NoError(t, err) @@ -471,9 +470,9 @@ func TestDocument(t *testing.T) { assert.Equal(t, "yorkie", m) rcv++ case <-time.After(1 * time.Second): - // Assuming that all subscribers can receive the broadcast - // event within this timeout period, check if the subscribers, - // except the publisher, successfully receive the event. + // Assuming that every subscriber can receive the broadcast + // event within this timeout period, check if every subscriber, + // except the publisher, successfully receives the event. assert.Equal(t, 2, rcv) return case <-ctx.Done(): @@ -485,22 +484,12 @@ func TestDocument(t *testing.T) { wg.Wait() }) - t.Run("refuse to subscribe document type for broadcasting", func(t *testing.T) { - ctx := context.Background() - - d1 := document.New(helper.TestDocKey(t)) - assert.NoError(t, c1.Attach(ctx, d1)) - _, err := c1.Watch(ctx, d1) - assert.NoError(t, err) - err = d1.SubscribeBroadcastEvent("document", nil) - assert.ErrorIs(t, err, document.ErrReservedEventType) - }) - t.Run("no broadcasts to unsubscribers", func(t *testing.T) { bch := make(chan string) ctx := context.Background() - handler := func(eventType, publisher string, payload []byte) error { + handler := func(topic, publisher string, payload []byte) error { var mentionedBy string + assert.Equal(t, topic, "mention") assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) // Send the unmarshaled payload to the channel to notify that this // subscriber receives the event. @@ -512,19 +501,16 @@ func TestDocument(t *testing.T) { assert.NoError(t, c1.Attach(ctx, d1)) rch1, err := c1.Watch(ctx, d1) assert.NoError(t, err) - err = d1.SubscribeBroadcastEvent("mention", handler) - assert.NoError(t, err) + d1.SubscribeBroadcastEvent("mention", handler) d2 := document.New(helper.TestDocKey(t)) assert.NoError(t, c2.Attach(ctx, d2)) rch2, err := c2.Watch(ctx, d2) assert.NoError(t, err) - err = d2.SubscribeBroadcastEvent("mention", handler) - assert.NoError(t, err) + d2.SubscribeBroadcastEvent("mention", handler) // d1 unsubscribes to the broadcast event. - err = d1.UnsubscribeBroadcastEvent("mention") - assert.NoError(t, err) + d1.UnsubscribeBroadcastEvent("mention") err = d2.Broadcast("mention", "yorkie") assert.NoError(t, err) @@ -542,9 +528,9 @@ func TestDocument(t *testing.T) { assert.Equal(t, "yorkie", m) rcv++ case <-time.After(1 * time.Second): - // Assuming that all subscribers can receive the broadcast - // event within this timeout period, check if the unsubscriber - // doesn't receive the event. + // Assuming that every subscriber can receive the broadcast + // event within this timeout period, check if both the unsubscriber + // and the publisher don't receive the event. assert.Equal(t, 0, rcv) return case <-ctx.Done(): @@ -556,11 +542,12 @@ func TestDocument(t *testing.T) { wg.Wait() }) - t.Run("no duplicate broadcasts for duplicate subscriptions", func(t *testing.T) { + t.Run("unsubscriber can broadcast", func(t *testing.T) { bch := make(chan string) ctx := context.Background() - handler := func(eventType, publisher string, payload []byte) error { + handler := func(topic, publisher string, payload []byte) error { var mentionedBy string + assert.Equal(t, topic, "mention") assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) // Send the unmarshaled payload to the channel to notify that this // subscriber receives the event. @@ -572,20 +559,15 @@ func TestDocument(t *testing.T) { assert.NoError(t, c1.Attach(ctx, d1)) rch1, err := c1.Watch(ctx, d1) assert.NoError(t, err) - err = d1.SubscribeBroadcastEvent("mention", handler) - assert.NoError(t, err) - - // d1 subscribes to the broadcast event twice. - err = d1.SubscribeBroadcastEvent("mention", handler) - assert.NoError(t, err) + d1.SubscribeBroadcastEvent("mention", handler) + // c2 doesn't subscribe to the "mention" broadcast event. d2 := document.New(helper.TestDocKey(t)) assert.NoError(t, c2.Attach(ctx, d2)) rch2, err := c2.Watch(ctx, d2) assert.NoError(t, err) - err = d2.SubscribeBroadcastEvent("mention", handler) - assert.NoError(t, err) + // The unsubscriber c2 broadcasts the "mention" event. err = d2.Broadcast("mention", "yorkie") assert.NoError(t, err) @@ -602,9 +584,9 @@ func TestDocument(t *testing.T) { assert.Equal(t, "yorkie", m) rcv++ case <-time.After(1 * time.Second): - // Assuming that all subscribers can receive the broadcast - // event within this timeout period, check if the unsubscriber - // doesn't receive the event. + // Assuming that every subscriber can receive the broadcast + // event within this timeout period, check if every subscriber + // receives the unsubscriber's event. assert.Equal(t, 1, rcv) return case <-ctx.Done(): @@ -616,32 +598,41 @@ func TestDocument(t *testing.T) { wg.Wait() }) - t.Run("unsubscriber can broadcast", func(t *testing.T) { - bch := make(chan string) + t.Run("reject to broadcast unserializable payload", func(t *testing.T) { ctx := context.Background() - handler := func(eventType, publisher string, payload []byte) error { - var mentionedBy string - assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) - // Send the unmarshaled payload to the channel to notify that this - // subscriber receives the event. - bch <- mentionedBy - return nil + + d1 := document.New(helper.TestDocKey(t)) + assert.NoError(t, c1.Attach(ctx, d1)) + _, err := c1.Watch(ctx, d1) + assert.NoError(t, err) + d1.SubscribeBroadcastEvent("mention", nil) + + // Try to broadcast an unserializable payload. + ch := make(chan string) + err = d1.Broadcast("mention", ch) + assert.ErrorIs(t, document.ErrUnsupportedPayloadType, err) + }) + + t.Run("error occurs while handling broadcast event", func(t *testing.T) { + var ErrBroadcastEventHandlingError = errors.New("") + + ctx := context.Background() + handler := func(topic, publisher string, payload []byte) error { + return ErrBroadcastEventHandlingError } d1 := document.New(helper.TestDocKey(t)) assert.NoError(t, c1.Attach(ctx, d1)) rch1, err := c1.Watch(ctx, d1) assert.NoError(t, err) - err = d1.SubscribeBroadcastEvent("mention", handler) - assert.NoError(t, err) + d1.SubscribeBroadcastEvent("mention", handler) - // c2 doesn't subscribe to the "mention" broadcast event. d2 := document.New(helper.TestDocKey(t)) assert.NoError(t, c2.Attach(ctx, d2)) rch2, err := c2.Watch(ctx, d2) assert.NoError(t, err) + d1.SubscribeBroadcastEvent("mention", handler) - // The unsubscriber c2 broadcasts the "mention" event. err = d2.Broadcast("mention", "yorkie") assert.NoError(t, err) @@ -649,20 +640,14 @@ func TestDocument(t *testing.T) { wg.Add(1) go func() { defer wg.Done() - rcv := 0 for { select { - case <-rch1: + case resp := <-rch1: + if resp.Err != nil { + assert.ErrorIs(t, resp.Err, ErrBroadcastEventHandlingError) + return + } case <-rch2: - case m := <-bch: - assert.Equal(t, "yorkie", m) - rcv++ - case <-time.After(1 * time.Second): - // Assuming that all subscribers can receive the broadcast - // event within this timeout period, check if the subscriber - // receives the unsubscriber's event. - assert.Equal(t, 1, rcv) - return case <-ctx.Done(): return } @@ -671,23 +656,6 @@ func TestDocument(t *testing.T) { wg.Wait() }) - - t.Run("reject to broadcast unserializable payload", func(t *testing.T) { - ctx := context.Background() - - d1 := document.New(helper.TestDocKey(t)) - assert.NoError(t, c1.Attach(ctx, d1)) - _, err := c1.Watch(ctx, d1) - assert.NoError(t, err) - err = d1.SubscribeBroadcastEvent("mention", nil) - assert.NoError(t, err) - - // Try to broadcast an unserializable payload. - ch := make(chan string) - err = d1.Broadcast("mention", ch) - assert.ErrorIs(t, document.ErrUnsupportedPayloadType, err) - }) - } func TestDocumentWithProjects(t *testing.T) { From 22232894280f468be6ac3c62fe1fa94caad02e34 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 13 Sep 2023 13:59:28 +0900 Subject: [PATCH 20/24] Remove unnecessary codes --- api/types/auth_webhook.go | 20 ++++++++------------ client/client.go | 2 +- pkg/document/document.go | 14 +++++++------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/api/types/auth_webhook.go b/api/types/auth_webhook.go index deb643c42..841e672f4 100644 --- a/api/types/auth_webhook.go +++ b/api/types/auth_webhook.go @@ -50,16 +50,14 @@ type Method string // Belows are the names of RPCs. const ( - ActivateClient Method = "ActivateClient" - DeactivateClient Method = "DeactivateClient" - AttachDocument Method = "AttachDocument" - DetachDocument Method = "DetachDocument" - RemoveDocument Method = "RemoveDocument" - PushPull Method = "PushPull" - WatchDocuments Method = "WatchDocuments" - Broadcast Method = "Broadcast" - SubscribeBroadcastEvent Method = "SubscribeBroadcastEvent" - UnsubscribeBroadcastEvent Method = "UnsubscribeBroadcastEvent" + ActivateClient Method = "ActivateClient" + DeactivateClient Method = "DeactivateClient" + AttachDocument Method = "AttachDocument" + DetachDocument Method = "DetachDocument" + RemoveDocument Method = "RemoveDocument" + PushPull Method = "PushPull" + WatchDocuments Method = "WatchDocuments" + Broadcast Method = "Broadcast" ) // IsAuthMethod returns whether the given method can be used for authorization. @@ -83,8 +81,6 @@ func AuthMethods() []Method { PushPull, WatchDocuments, Broadcast, - SubscribeBroadcastEvent, - UnsubscribeBroadcastEvent, } } diff --git a/client/client.go b/client/client.go index b03346fc5..02fc37238 100644 --- a/client/client.go +++ b/client/client.go @@ -464,7 +464,7 @@ func (c *Client) Watch( go func() { for { select { - case e := <-doc.DocEvents(): + case e := <-doc.Events(): t := PresenceChanged if e.Type == document.WatchedEvent { t = DocumentWatched diff --git a/pkg/document/document.go b/pkg/document/document.go index a68954610..f368aa7c6 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -85,8 +85,8 @@ type Document struct { // is used to protect `doc.presences`. clonePresences *innerpresence.Map - // docEvents is the channel to send events that occurred in the document. - docEvents chan DocEvent + // events is the channel to send events that occurred in the document. + events chan DocEvent // broadcastRequests is the send-only channel to send broadcast requests. broadcastRequests chan BroadcastRequest @@ -104,7 +104,7 @@ type Document struct { func New(key key.Key) *Document { return &Document{ doc: NewInternalDocument(key), - docEvents: make(chan DocEvent, 1), + events: make(chan DocEvent, 1), broadcastRequests: make(chan BroadcastRequest, 1), broadcastResponses: make(chan error, 1), broadcastEventHandlers: make(map[string]func( @@ -181,7 +181,7 @@ func (d *Document) ApplyChangePack(pack *change.Pack) error { } for _, e := range events { - d.docEvents <- e + d.events <- e } } @@ -360,9 +360,9 @@ func (d *Document) RemoveOnlineClient(clientID string) { d.doc.RemoveOnlineClient(clientID) } -// DocEvents returns the document events of this document. -func (d *Document) DocEvents() <-chan DocEvent { - return d.docEvents +// Events returns the document events of this document. +func (d *Document) Events() <-chan DocEvent { + return d.events } // BroadcastRequests returns the broadcast requests of this document. From 7d70752447e9c9e419f7dc18f0f461c9583853e0 Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 13 Sep 2023 14:03:00 +0900 Subject: [PATCH 21/24] Resolve conflict --- api/yorkie/v1/resources.pb.go | 529 +++++++++++++++++++++++----------- api/yorkie/v1/resources.proto | 1 + 2 files changed, 355 insertions(+), 175 deletions(-) diff --git a/api/yorkie/v1/resources.pb.go b/api/yorkie/v1/resources.pb.go index f1c711a9e..01b1ba359 100644 --- a/api/yorkie/v1/resources.pb.go +++ b/api/yorkie/v1/resources.pb.go @@ -1075,14 +1075,15 @@ func (m *Operation_Select) GetExecutedAt() *TimeTicket { } 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:"-"` + 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"` + CreatedAtMapByActor map[string]*TimeTicket `protobuf:"bytes,6,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"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Operation_Style) Reset() { *m = Operation_Style{} } @@ -1153,6 +1154,13 @@ func (m *Operation_Style) GetExecutedAt() *TimeTicket { return nil } +func (m *Operation_Style) GetCreatedAtMapByActor() map[string]*TimeTicket { + if m != nil { + return m.CreatedAtMapByActor + } + 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"` @@ -3407,6 +3415,7 @@ func init() { proto.RegisterType((*Operation_Select)(nil), "yorkie.v1.Operation.Select") proto.RegisterType((*Operation_Style)(nil), "yorkie.v1.Operation.Style") proto.RegisterMapType((map[string]string)(nil), "yorkie.v1.Operation.Style.AttributesEntry") + proto.RegisterMapType((map[string]*TimeTicket)(nil), "yorkie.v1.Operation.Style.CreatedAtMapByActorEntry") proto.RegisterType((*Operation_Increase)(nil), "yorkie.v1.Operation.Increase") proto.RegisterType((*Operation_TreeEdit)(nil), "yorkie.v1.Operation.TreeEdit") proto.RegisterMapType((map[string]*TimeTicket)(nil), "yorkie.v1.Operation.TreeEdit.CreatedAtMapByActorEntry") @@ -3449,173 +3458,175 @@ func init() { func init() { proto.RegisterFile("yorkie/v1/resources.proto", fileDescriptor_36361b2f5d0f0896) } var fileDescriptor_36361b2f5d0f0896 = []byte{ - // 2655 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xcb, 0x8f, 0x23, 0x47, - 0x19, 0x9f, 0x6e, 0xb7, 0x1f, 0xfd, 0xcd, 0xee, 0x8e, 0xb7, 0x66, 0x1f, 0x5e, 0xef, 0xee, 0x64, - 0xd6, 0x21, 0x61, 0xb2, 0x0b, 0x9e, 0x07, 0x49, 0x08, 0x09, 0x09, 0x78, 0xec, 0xce, 0x8e, 0x93, - 0x59, 0xcf, 0xd0, 0xf6, 0x6c, 0x48, 0x04, 0x6a, 0xf5, 0x74, 0xd7, 0xcc, 0x74, 0xc6, 0x76, 0x3b, - 0xdd, 0x6d, 0x67, 0x2d, 0x71, 0x8a, 0x40, 0xe2, 0xca, 0x0d, 0xfe, 0x01, 0x24, 0x2e, 0xdc, 0x73, - 0x84, 0x03, 0x42, 0x42, 0x88, 0x48, 0x44, 0xe2, 0x4a, 0xc2, 0x01, 0xc1, 0x0d, 0x21, 0x71, 0x43, - 0x42, 0xf5, 0x6a, 0xb7, 0xed, 0xb6, 0xc7, 0x6b, 0x86, 0x68, 0x57, 0xdc, 0x5c, 0x55, 0xbf, 0xaf, - 0xea, 0x7b, 0xfc, 0xea, 0xab, 0xaf, 0xdc, 0x05, 0x37, 0xfa, 0xae, 0x77, 0xea, 0xe0, 0xf5, 0xde, - 0xe6, 0xba, 0x87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e, 0x71, 0x6d, 0xd5, 0x69, 0xfb, 0xfb, 0x1e, 0xee, 0x55, 0x6d, 0x54, - 0x1e, 0xaa, 0x18, 0x59, 0x65, 0xfe, 0x6c, 0x8c, 0xd4, 0xd4, 0xbf, 0x1f, 0xf4, 0x59, 0xca, 0xbd, - 0x29, 0xdf, 0x9d, 0x44, 0x40, 0xa2, 0xdf, 0x9d, 0xde, 0x03, 0x18, 0x68, 0x3c, 0x67, 0xcd, 0x77, - 0x0d, 0x52, 0xee, 0xd1, 0x91, 0x8f, 0x59, 0x14, 0x93, 0x3a, 0x6f, 0x15, 0x7e, 0xc9, 0xaf, 0x65, - 0xd3, 0x63, 0xc5, 0x01, 0x3c, 0x56, 0x88, 0xe7, 0x28, 0x16, 0xaa, 0x91, 0x6c, 0x94, 0x98, 0x1c, - 0x3f, 0x65, 0xbe, 0xf8, 0x25, 0xa7, 0xe9, 0x13, 0x89, 0x1f, 0x17, 0x23, 0x9b, 0x81, 0x88, 0xa5, - 0xce, 0x12, 0xab, 0xe1, 0x47, 0x41, 0x95, 0x32, 0xcf, 0xc6, 0x9d, 0xe0, 0x84, 0x16, 0x47, 0x49, - 0x9d, 0x35, 0x46, 0xc8, 0x90, 0x19, 0x27, 0x03, 0x9f, 0xeb, 0x0b, 0x27, 0xc3, 0xab, 0xec, 0xce, - 0x45, 0xaf, 0x88, 0xe8, 0xab, 0x83, 0x7f, 0xe2, 0xa6, 0x24, 0x52, 0x81, 0xa1, 0x44, 0x0a, 0x7d, - 0x70, 0xce, 0x44, 0xfa, 0x01, 0xa4, 0xf9, 0xf5, 0x0b, 0x6d, 0x81, 0xca, 0x6f, 0x82, 0x67, 0xb1, - 0x29, 0xc3, 0x70, 0x55, 0x1b, 0xbd, 0x0e, 0x4b, 0x4d, 0x7c, 0x14, 0x18, 0xbe, 0x73, 0xd8, 0x74, - 0xda, 0xc7, 0x44, 0x52, 0x9e, 0x26, 0x79, 0x91, 0xa0, 0xeb, 0x0c, 0x5c, 0xb5, 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xeb, 0xa5, 0x77, 0xb3, 0xea, 0xc8, 0x5c, 0x0d, 0xed, 0xbb, 0x8d, 0x2c, 0x8c, - 0xcc, 0xc5, 0x2d, 0x32, 0xca, 0xb5, 0x46, 0x76, 0x11, 0x5d, 0x87, 0xe5, 0x11, 0xab, 0xe8, 0xc0, - 0x85, 0xd1, 0x99, 0x74, 0x4d, 0xcb, 0x5e, 0xbc, 0xfb, 0x73, 0x69, 0x40, 0x0e, 0xea, 0xd9, 0x67, - 0xe1, 0x99, 0xca, 0x5e, 0xd9, 0xd0, 0x1e, 0x6a, 0xb5, 0x86, 0xf0, 0x41, 0xf9, 0xe0, 0x01, 0x69, - 0xb1, 0x7c, 0x40, 0x32, 0xc9, 0x14, 0xd0, 0x3b, 0xa5, 0x46, 0x79, 0x47, 0xab, 0x64, 0x25, 0xf4, - 0x1c, 0xdc, 0x99, 0x04, 0x3a, 0xa8, 0x09, 0x98, 0x3c, 0x0d, 0xb6, 0xad, 0xef, 0x95, 0x2a, 0xe5, - 0x52, 0xbd, 0x91, 0x4d, 0x6c, 0xdf, 0xfb, 0xed, 0xe7, 0x2b, 0xd2, 0x27, 0x9f, 0xaf, 0x48, 0x7f, - 0xfe, 0x7c, 0x45, 0xfa, 0xe9, 0x5f, 0x56, 0x16, 0xe0, 0xb2, 0x8d, 0x7b, 0x82, 0x33, 0x66, 0xc7, - 0x29, 0xf6, 0x36, 0xf7, 0xa5, 0xf7, 0x94, 0xe2, 0x6b, 0xbd, 0xcd, 0xc3, 0x14, 0xcd, 0xd8, 0x5f, - 0xfb, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x6f, 0xe6, 0x3b, 0xea, 0x28, 0x00, 0x00, + // 2677 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xdb, 0x8f, 0x23, 0x47, + 0xd5, 0x9f, 0x6e, 0xb7, 0x2f, 0x7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 0x91, 0x56, 0x17, 0x37, 0xaf, + 0x15, 0xc3, 0x71, 0x8a, 0x6f, 0xd6, 0x77, 0x6b, 0x5a, 0x13, 0xb7, 0x70, 0x3b, 0xd0, 0x29, 0x06, + 0x7d, 0x07, 0xd4, 0x8e, 0x87, 0x7d, 0xdc, 0xb6, 0xb0, 0x9f, 0x93, 0xef, 0x24, 0x56, 0x17, 0x37, + 0x0b, 0x11, 0x01, 0xd1, 0x67, 0x71, 0x4f, 0x80, 0xb4, 0x76, 0xe0, 0xf5, 0xf5, 0x81, 0x50, 0xfe, + 0xbb, 0x70, 0x69, 0xb8, 0x11, 0x65, 0x21, 0x71, 0x82, 0xfb, 0x74, 0x78, 0x55, 0x27, 0x9f, 0xe8, + 0x39, 0x48, 0xf6, 0xcc, 0x66, 0x17, 0xe7, 0x64, 0xaa, 0xd2, 0x72, 0x64, 0x04, 0x21, 0xab, 0x33, + 0xc4, 0x2b, 0xf2, 0xcb, 0x52, 0xe1, 0xa7, 0x32, 0x40, 0xf9, 0xd8, 0x6c, 0x1f, 0xe1, 0x3d, 0xd3, + 0x3a, 0x41, 0x77, 0xe1, 0x82, 0xed, 0x5a, 0x5d, 0xa2, 0xb5, 0x31, 0xe8, 0x78, 0x51, 0xd4, 0xbd, + 0x85, 0xfb, 0xe8, 0x45, 0x00, 0xeb, 0x18, 0x5b, 0x27, 0x1d, 0xd7, 0x69, 0x07, 0x7c, 0x94, 0xab, + 0x91, 0x51, 0xca, 0x61, 0xa3, 0x1e, 0x01, 0xa2, 0x3c, 0x64, 0x7c, 0x6e, 0x61, 0x2e, 0x71, 0x47, + 0x5a, 0xbd, 0xa0, 0x87, 0x65, 0x74, 0x1f, 0xd2, 0x16, 0xd5, 0xc1, 0xcf, 0x29, 0x74, 0x5e, 0x2e, + 0x0f, 0xf5, 0x47, 0x5a, 0x74, 0x81, 0x40, 0x25, 0xb8, 0xdc, 0x72, 0xda, 0x86, 0xdf, 0x6f, 0x5b, + 0xd8, 0x36, 0x02, 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, 0xf4, 0x7b, 0x97, 0x02, 0xb7, 0x17, 0x74, 0x20, 0x72, 0xac, 0x84, 0x4a, 0x40, 0x4b, 0x86, + 0xe9, 0x79, 0x66, 0x9f, 0xdb, 0x7f, 0x67, 0x4a, 0x27, 0x25, 0x82, 0x23, 0x07, 0x49, 0x22, 0x45, + 0x0b, 0xec, 0x3f, 0x9b, 0xd3, 0x72, 0x02, 0x27, 0xfc, 0x1b, 0x30, 0xa9, 0x87, 0x3d, 0x81, 0x23, + 0x3d, 0x84, 0x42, 0x68, 0x03, 0x94, 0x00, 0x3f, 0x16, 0x34, 0xba, 0x39, 0x41, 0x98, 0x6c, 0xc6, + 0xe4, 0x90, 0x4f, 0xa0, 0xe8, 0x15, 0x92, 0x3f, 0x76, 0xdb, 0x01, 0xf6, 0x78, 0x00, 0x58, 0x99, + 0x20, 0x55, 0x66, 0xa8, 0xed, 0x05, 0x5d, 0x08, 0xd0, 0xe1, 0x3c, 0x2c, 0x0e, 0xfa, 0x13, 0x87, + 0xf3, 0x30, 0xfd, 0x77, 0x41, 0xa0, 0xf9, 0x4f, 0x24, 0x80, 0xc1, 0x1c, 0xa2, 0x55, 0x48, 0xb6, + 0x49, 0x54, 0xca, 0x49, 0x74, 0x25, 0x45, 0x57, 0x9d, 0xbe, 0xdd, 0x20, 0x01, 0x4b, 0x67, 0x80, + 0x39, 0xcf, 0x17, 0x51, 0x4e, 0x26, 0xe6, 0xe0, 0xa4, 0x32, 0x1b, 0x27, 0xf3, 0x7f, 0x92, 0x40, + 0x0d, 0xbd, 0x3a, 0xd5, 0xaa, 0x07, 0xa5, 0xaf, 0x8e, 0x55, 0x7f, 0x97, 0x40, 0x0d, 0x99, 0x16, + 0xae, 0x3b, 0x69, 0xf6, 0x75, 0x27, 0x47, 0xd6, 0xdd, 0x9c, 0xa7, 0xdb, 0xa8, 0xad, 0xca, 0x1c, + 0xb6, 0x26, 0x67, 0xb4, 0xf5, 0x8f, 0x12, 0x28, 0x64, 0x61, 0xa0,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xca, 0xfb, 0x0f, 0x49, 0x89, 0xc5, 0x03, 0x12, 0x49, 0xa6, 0x80, 0xde, 0x2e, 0x35, + 0xca, 0xdb, 0x5a, 0x25, 0x2b, 0xa1, 0x67, 0xe0, 0xee, 0x24, 0xd0, 0x7e, 0x4d, 0xc0, 0xe4, 0x69, + 0xb0, 0x2d, 0x7d, 0xb7, 0x54, 0x29, 0x97, 0xea, 0x8d, 0x6c, 0x62, 0xeb, 0xfe, 0xef, 0x3e, 0x5d, + 0x91, 0x3e, 0xfe, 0x74, 0x45, 0xfa, 0xcb, 0xa7, 0x2b, 0xd2, 0xcf, 0x3e, 0x5b, 0x59, 0x80, 0xcb, + 0x36, 0xee, 0x09, 0xce, 0x98, 0x1d, 0xa7, 0xd8, 0xdb, 0xd8, 0x93, 0xde, 0x55, 0x8a, 0xaf, 0xf6, + 0x36, 0x0e, 0x52, 0x34, 0x62, 0x3f, 0xff, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x49, 0x47, + 0x88, 0xb4, 0x29, 0x00, 0x00, } func (m *Snapshot) Marshal() (dAtA []byte, err error) { @@ -4648,6 +4659,32 @@ func (m *Operation_Style) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + 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] = 0x32 + } + } if m.ExecutedAt != nil { { size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) @@ -7372,6 +7409,19 @@ func (m *Operation_Style) Size() (n int) { l = m.ExecutedAt.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)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -11229,6 +11279,135 @@ func (m *Operation_Style) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + 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 default: iNdEx = preIndex skippy, err := skipResources(dAtA[iNdEx:]) diff --git a/api/yorkie/v1/resources.proto b/api/yorkie/v1/resources.proto index 231e45508..ae4019b4f 100644 --- a/api/yorkie/v1/resources.proto +++ b/api/yorkie/v1/resources.proto @@ -111,6 +111,7 @@ message Operation { TextNodePos to = 3; map attributes = 4; TimeTicket executed_at = 5; + map created_at_map_by_actor = 6; } message Increase { TimeTicket parent_created_at = 1; From 19855751851d055372a86e6ec01005d5aa9f8acb Mon Sep 17 00:00:00 2001 From: sejongk Date: Wed, 13 Sep 2023 15:00:19 +0900 Subject: [PATCH 22/24] Clean up codes --- client/client.go | 6 ++++-- pkg/document/document.go | 14 +++++++------- test/integration/document_test.go | 15 +++++++++++++-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/client/client.go b/client/client.go index 02fc37238..63e65054c 100644 --- a/client/client.go +++ b/client/client.go @@ -410,7 +410,6 @@ func (c *Client) Watch( } rch := make(chan WatchResponse) - stream, err := c.client.WatchDocument( withShardKey(ctx, c.options.APIKey, doc.Key().String()), &api.WatchDocumentRequest{ @@ -554,7 +553,10 @@ func handleResponse( if handler, ok := doc.BroadcastEventHandlers()[eventBody.Topic]; ok && handler != nil { err := handler(eventBody.Topic, resp.Event.Publisher, eventBody.Payload) if err != nil { - return nil, err + return &WatchResponse{ + Type: DocumentBroadcast, + Err: err, + }, nil } } return nil, nil diff --git a/pkg/document/document.go b/pkg/document/document.go index f368aa7c6..c1548eb1e 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -360,7 +360,7 @@ func (d *Document) RemoveOnlineClient(clientID string) { d.doc.RemoveOnlineClient(clientID) } -// Events returns the document events of this document. +// Events returns the events of this document. func (d *Document) Events() <-chan DocEvent { return d.events } @@ -375,7 +375,7 @@ func (d *Document) BroadcastResponses() chan error { return d.broadcastResponses } -// Broadcast encodes the payload and makes a "Broadcast" type request. +// Broadcast encodes the given payload and sends a Broadcast request. func (d *Document) Broadcast(topic string, payload any) error { marshaled, err := gojson.Marshal(payload) if err != nil { @@ -389,8 +389,8 @@ func (d *Document) Broadcast(topic string, payload any) error { return <-d.broadcastResponses } -// SubscribeBroadcastEvent subscribes to the registers an event handler and makes -// a "Subscribe" type request. +// SubscribeBroadcastEvent subscribes to the given topic and registers +// an event handler func (d *Document) SubscribeBroadcastEvent( topic string, handler func(topic, publisher string, payload []byte) error, @@ -398,15 +398,15 @@ func (d *Document) SubscribeBroadcastEvent( d.broadcastEventHandlers[topic] = handler } -// UnsubscribeBroadcastEvent deregisters the event handler and makes -// a "Unsubscribe" type request. +// UnsubscribeBroadcastEvent unsubscribes to the given topic and deregisters +// the event handler func (d *Document) UnsubscribeBroadcastEvent( topic string, ) { delete(d.broadcastEventHandlers, topic) } -// BroadcastEventHandlers returns registered event handlers for events. +// BroadcastEventHandlers returns the registered handlers for broadcast events. func (d *Document) BroadcastEventHandlers() map[string](func(topic string, publisher string, payload []byte) error) { return d.broadcastEventHandlers diff --git a/test/integration/document_test.go b/test/integration/document_test.go index af08222ae..84c49d66d 100644 --- a/test/integration/document_test.go +++ b/test/integration/document_test.go @@ -618,6 +618,9 @@ func TestDocument(t *testing.T) { ctx := context.Background() handler := func(topic, publisher string, payload []byte) error { + var mentionedBy string + assert.Equal(t, topic, "mention") + assert.NoError(t, gojson.Unmarshal(payload, &mentionedBy)) return ErrBroadcastEventHandlingError } @@ -631,7 +634,7 @@ func TestDocument(t *testing.T) { assert.NoError(t, c2.Attach(ctx, d2)) rch2, err := c2.Watch(ctx, d2) assert.NoError(t, err) - d1.SubscribeBroadcastEvent("mention", handler) + d2.SubscribeBroadcastEvent("mention", handler) err = d2.Broadcast("mention", "yorkie") assert.NoError(t, err) @@ -640,14 +643,22 @@ func TestDocument(t *testing.T) { wg.Add(1) go func() { defer wg.Done() + rcv := 0 for { select { case resp := <-rch1: if resp.Err != nil { + assert.Equal(t, resp.Type, client.DocumentBroadcast) assert.ErrorIs(t, resp.Err, ErrBroadcastEventHandlingError) - return + rcv++ } case <-rch2: + case <-time.After(1 * time.Second): + // Assuming that every subscriber can receive the broadcast + // event within this timeout period, check if every subscriber + // successfully receives the event. + assert.Equal(t, 1, rcv) + return case <-ctx.Done(): return } From 5e50c941fbcb0ab9c0eaf9b7c6186835e57b8e90 Mon Sep 17 00:00:00 2001 From: sejongk Date: Fri, 15 Sep 2023 10:52:45 +0900 Subject: [PATCH 23/24] Add final newlines --- api/yorkie/v1/resources.proto | 2 +- api/yorkie/v1/yorkie.proto | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/yorkie/v1/resources.proto b/api/yorkie/v1/resources.proto index ae4019b4f..8c896bf80 100644 --- a/api/yorkie/v1/resources.proto +++ b/api/yorkie/v1/resources.proto @@ -370,4 +370,4 @@ message DocEvent { DocEventType type = 1; string publisher = 2; DocEventBody body = 3; -} \ No newline at end of file +} diff --git a/api/yorkie/v1/yorkie.proto b/api/yorkie/v1/yorkie.proto index bc23485b5..da71d6a11 100644 --- a/api/yorkie/v1/yorkie.proto +++ b/api/yorkie/v1/yorkie.proto @@ -120,4 +120,4 @@ message BroadcastRequest { } message BroadcastResponse { -} \ No newline at end of file +} From bde74a4b66cf03135ea107326a593b8410313e15 Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Mon, 2 Oct 2023 20:22:52 +0900 Subject: [PATCH 24/24] Remove lock from ActorID --- pkg/document/document.go | 14 +++++++----- pkg/document/time/actor_id.go | 27 +++++------------------ server/backend/sync/coordinator.go | 3 --- server/backend/sync/memory/coordinator.go | 12 +++------- server/rpc/yorkie_server.go | 3 --- 5 files changed, 16 insertions(+), 43 deletions(-) diff --git a/pkg/document/document.go b/pkg/document/document.go index c1548eb1e..347b25507 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -33,8 +33,7 @@ import ( var ( // ErrUnsupportedPayloadType is returned when the payload is unserializable to JSON. - ErrUnsupportedPayloadType = errors.New( - "the payload is an unsupported JSON type") + ErrUnsupportedPayloadType = errors.New("unsupported payload type") ) // DocEvent represents the event that occurred in the document. @@ -390,7 +389,7 @@ func (d *Document) Broadcast(topic string, payload any) error { } // SubscribeBroadcastEvent subscribes to the given topic and registers -// an event handler +// an event handler. func (d *Document) SubscribeBroadcastEvent( topic string, handler func(topic, publisher string, payload []byte) error, @@ -399,7 +398,7 @@ func (d *Document) SubscribeBroadcastEvent( } // UnsubscribeBroadcastEvent unsubscribes to the given topic and deregisters -// the event handler +// the event handler. func (d *Document) UnsubscribeBroadcastEvent( topic string, ) { @@ -407,8 +406,11 @@ func (d *Document) UnsubscribeBroadcastEvent( } // BroadcastEventHandlers returns the registered handlers for broadcast events. -func (d *Document) BroadcastEventHandlers() map[string](func(topic string, - publisher string, payload []byte) error) { +func (d *Document) BroadcastEventHandlers() map[string]func( + topic string, + publisher string, + payload []byte, +) error { return d.broadcastEventHandlers } diff --git a/pkg/document/time/actor_id.go b/pkg/document/time/actor_id.go index 6939369a6..a2bcb61f6 100644 --- a/pkg/document/time/actor_id.go +++ b/pkg/document/time/actor_id.go @@ -23,7 +23,6 @@ import ( "errors" "fmt" "math" - "sync" ) const actorIDSize = 12 @@ -57,13 +56,14 @@ var ( ErrInvalidActorID = errors.New("invalid actor id") ) -// ActorID is bytes represented by the hexadecimal string. -// It should be generated by unique value. +// ActorID represents the unique ID of the client. It is composed of 12 bytes. +// It caches the string representation of ActorID to reduce the number of calls +// to hex.EncodeToString. This causes a multi-routine problem, so it is +// recommended to use it in a single routine or to use it after locking. type ActorID struct { bytes [actorIDSize]byte - cachedString string - cachedStringMu sync.RWMutex + cachedString string } // ActorIDFromHex returns the bytes represented by the hexadecimal string str. @@ -106,23 +106,6 @@ func ActorIDFromBytes(bytes []byte) (*ActorID, error) { // String returns the hexadecimal encoding of ActorID. // If the receiver is nil, it would return empty string. func (id *ActorID) String() string { - id.cachedStringMu.RLock() - readLocked := true - defer func() { - if readLocked { - id.cachedStringMu.RUnlock() - } - }() - - if id.cachedString != "" { - return id.cachedString - } - - id.cachedStringMu.RUnlock() - readLocked = false - id.cachedStringMu.Lock() - defer id.cachedStringMu.Unlock() - if id.cachedString == "" { id.cachedString = hex.EncodeToString(id.bytes[:]) } diff --git a/server/backend/sync/coordinator.go b/server/backend/sync/coordinator.go index deab2105c..764a942d6 100644 --- a/server/backend/sync/coordinator.go +++ b/server/backend/sync/coordinator.go @@ -54,9 +54,6 @@ type Coordinator interface { // Publish publishes the given event. Publish(ctx context.Context, publisherID *time.ActorID, event DocEvent) - // PublishToLocal publishes the given event. - PublishToLocal(ctx context.Context, publisherID *time.ActorID, event DocEvent) - // Members returns the members of this cluster. Members() map[string]*ServerInfo diff --git a/server/backend/sync/memory/coordinator.go b/server/backend/sync/memory/coordinator.go index 57b6ca909..dfc0e1542 100644 --- a/server/backend/sync/memory/coordinator.go +++ b/server/backend/sync/memory/coordinator.go @@ -85,15 +85,9 @@ func (c *Coordinator) Publish( publisherID *time.ActorID, event sync.DocEvent, ) { - c.pubSub.Publish(ctx, publisherID, event) -} - -// PublishToLocal publishes the given event. -func (c *Coordinator) PublishToLocal( - ctx context.Context, - publisherID *time.ActorID, - event sync.DocEvent, -) { + // NOTE(hackerwins): String() triggers the cache of ActorID to avoid + // race condition of concurrent access to the cache. + _ = event.Publisher.String() c.pubSub.Publish(ctx, publisherID, event) } diff --git a/server/rpc/yorkie_server.go b/server/rpc/yorkie_server.go index d41faac7f..f3fa6bc67 100644 --- a/server/rpc/yorkie_server.go +++ b/server/rpc/yorkie_server.go @@ -584,9 +584,6 @@ func (s *yorkieServer) Broadcast( return nil, err } - if err != nil { - return nil, err - } s.backend.Coordinator.Publish( ctx, clientID,