diff --git a/streams/Dockerfile b/streams/Dockerfile deleted file mode 100644 index 0289dae..0000000 --- a/streams/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM alpine -ADD streams /streams -ENTRYPOINT [ "/streams" ] diff --git a/streams/README.md b/streams/README.md deleted file mode 100644 index 10c3fd3..0000000 --- a/streams/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Streams Service - -This is the Streams service - -Generated with - -``` -micro new streams -``` - -## Usage - -Generate the proto code - -``` -make proto -``` - -Run the service - -``` -micro run . -``` \ No newline at end of file diff --git a/streams/micro.mu b/streams/micro.mu deleted file mode 100644 index c961f25..0000000 --- a/streams/micro.mu +++ /dev/null @@ -1 +0,0 @@ -service streams diff --git a/streams/proto/streams.pb.go b/streams/proto/streams.pb.go deleted file mode 100644 index 9e56083..0000000 --- a/streams/proto/streams.pb.go +++ /dev/null @@ -1,1465 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.23.0 -// protoc v3.13.0 -// source: proto/streams.proto - -package streams - -import ( - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type Conversation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` - CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` -} - -func (x *Conversation) Reset() { - *x = Conversation{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Conversation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Conversation) ProtoMessage() {} - -func (x *Conversation) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Conversation.ProtoReflect.Descriptor instead. -func (*Conversation) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{0} -} - -func (x *Conversation) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Conversation) GetGroupId() string { - if x != nil { - return x.GroupId - } - return "" -} - -func (x *Conversation) GetTopic() string { - if x != nil { - return x.Topic - } - return "" -} - -func (x *Conversation) GetCreatedAt() *timestamp.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -type Message struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - AuthorId string `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` - ConversationId string `protobuf:"bytes,3,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` - Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` - SentAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=sent_at,json=sentAt,proto3" json:"sent_at,omitempty"` -} - -func (x *Message) Reset() { - *x = Message{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Message) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Message) ProtoMessage() {} - -func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Message.ProtoReflect.Descriptor instead. -func (*Message) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{1} -} - -func (x *Message) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Message) GetAuthorId() string { - if x != nil { - return x.AuthorId - } - return "" -} - -func (x *Message) GetConversationId() string { - if x != nil { - return x.ConversationId - } - return "" -} - -func (x *Message) GetText() string { - if x != nil { - return x.Text - } - return "" -} - -func (x *Message) GetSentAt() *timestamp.Timestamp { - if x != nil { - return x.SentAt - } - return nil -} - -type CreateConversationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"` -} - -func (x *CreateConversationRequest) Reset() { - *x = CreateConversationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateConversationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateConversationRequest) ProtoMessage() {} - -func (x *CreateConversationRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateConversationRequest.ProtoReflect.Descriptor instead. -func (*CreateConversationRequest) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateConversationRequest) GetGroupId() string { - if x != nil { - return x.GroupId - } - return "" -} - -func (x *CreateConversationRequest) GetTopic() string { - if x != nil { - return x.Topic - } - return "" -} - -type CreateConversationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"` -} - -func (x *CreateConversationResponse) Reset() { - *x = CreateConversationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateConversationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateConversationResponse) ProtoMessage() {} - -func (x *CreateConversationResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateConversationResponse.ProtoReflect.Descriptor instead. -func (*CreateConversationResponse) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateConversationResponse) GetConversation() *Conversation { - if x != nil { - return x.Conversation - } - return nil -} - -type ReadConversationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - GroupId *wrappers.StringValue `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` -} - -func (x *ReadConversationRequest) Reset() { - *x = ReadConversationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadConversationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadConversationRequest) ProtoMessage() {} - -func (x *ReadConversationRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReadConversationRequest.ProtoReflect.Descriptor instead. -func (*ReadConversationRequest) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{4} -} - -func (x *ReadConversationRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *ReadConversationRequest) GetGroupId() *wrappers.StringValue { - if x != nil { - return x.GroupId - } - return nil -} - -type ReadConversationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"` -} - -func (x *ReadConversationResponse) Reset() { - *x = ReadConversationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadConversationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadConversationResponse) ProtoMessage() {} - -func (x *ReadConversationResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReadConversationResponse.ProtoReflect.Descriptor instead. -func (*ReadConversationResponse) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{5} -} - -func (x *ReadConversationResponse) GetConversation() *Conversation { - if x != nil { - return x.Conversation - } - return nil -} - -type ListConversationsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` -} - -func (x *ListConversationsRequest) Reset() { - *x = ListConversationsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListConversationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListConversationsRequest) ProtoMessage() {} - -func (x *ListConversationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListConversationsRequest.ProtoReflect.Descriptor instead. -func (*ListConversationsRequest) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{6} -} - -func (x *ListConversationsRequest) GetGroupId() string { - if x != nil { - return x.GroupId - } - return "" -} - -type ListConversationsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Conversations []*Conversation `protobuf:"bytes,1,rep,name=conversations,proto3" json:"conversations,omitempty"` -} - -func (x *ListConversationsResponse) Reset() { - *x = ListConversationsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListConversationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListConversationsResponse) ProtoMessage() {} - -func (x *ListConversationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListConversationsResponse.ProtoReflect.Descriptor instead. -func (*ListConversationsResponse) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{7} -} - -func (x *ListConversationsResponse) GetConversations() []*Conversation { - if x != nil { - return x.Conversations - } - return nil -} - -type UpdateConversationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"` -} - -func (x *UpdateConversationRequest) Reset() { - *x = UpdateConversationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateConversationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateConversationRequest) ProtoMessage() {} - -func (x *UpdateConversationRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateConversationRequest.ProtoReflect.Descriptor instead. -func (*UpdateConversationRequest) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateConversationRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *UpdateConversationRequest) GetTopic() string { - if x != nil { - return x.Topic - } - return "" -} - -type UpdateConversationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"` -} - -func (x *UpdateConversationResponse) Reset() { - *x = UpdateConversationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateConversationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateConversationResponse) ProtoMessage() {} - -func (x *UpdateConversationResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateConversationResponse.ProtoReflect.Descriptor instead. -func (*UpdateConversationResponse) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{9} -} - -func (x *UpdateConversationResponse) GetConversation() *Conversation { - if x != nil { - return x.Conversation - } - return nil -} - -type DeleteConversationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *DeleteConversationRequest) Reset() { - *x = DeleteConversationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteConversationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteConversationRequest) ProtoMessage() {} - -func (x *DeleteConversationRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteConversationRequest.ProtoReflect.Descriptor instead. -func (*DeleteConversationRequest) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{10} -} - -func (x *DeleteConversationRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type DeleteConversationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteConversationResponse) Reset() { - *x = DeleteConversationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteConversationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteConversationResponse) ProtoMessage() {} - -func (x *DeleteConversationResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteConversationResponse.ProtoReflect.Descriptor instead. -func (*DeleteConversationResponse) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{11} -} - -type CreateMessageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` - AuthorId string `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` - Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` -} - -func (x *CreateMessageRequest) Reset() { - *x = CreateMessageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateMessageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateMessageRequest) ProtoMessage() {} - -func (x *CreateMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateMessageRequest.ProtoReflect.Descriptor instead. -func (*CreateMessageRequest) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{12} -} - -func (x *CreateMessageRequest) GetConversationId() string { - if x != nil { - return x.ConversationId - } - return "" -} - -func (x *CreateMessageRequest) GetAuthorId() string { - if x != nil { - return x.AuthorId - } - return "" -} - -func (x *CreateMessageRequest) GetText() string { - if x != nil { - return x.Text - } - return "" -} - -type CreateMessageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *CreateMessageResponse) Reset() { - *x = CreateMessageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateMessageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateMessageResponse) ProtoMessage() {} - -func (x *CreateMessageResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateMessageResponse.ProtoReflect.Descriptor instead. -func (*CreateMessageResponse) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{13} -} - -func (x *CreateMessageResponse) GetMessage() *Message { - if x != nil { - return x.Message - } - return nil -} - -type ListMessagesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` - SentBefore *timestamp.Timestamp `protobuf:"bytes,2,opt,name=sent_before,json=sentBefore,proto3" json:"sent_before,omitempty"` - Limit *wrappers.Int32Value `protobuf:"bytes,3,opt,name=limit,proto3" json:"limit,omitempty"` -} - -func (x *ListMessagesRequest) Reset() { - *x = ListMessagesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListMessagesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListMessagesRequest) ProtoMessage() {} - -func (x *ListMessagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListMessagesRequest.ProtoReflect.Descriptor instead. -func (*ListMessagesRequest) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{14} -} - -func (x *ListMessagesRequest) GetConversationId() string { - if x != nil { - return x.ConversationId - } - return "" -} - -func (x *ListMessagesRequest) GetSentBefore() *timestamp.Timestamp { - if x != nil { - return x.SentBefore - } - return nil -} - -func (x *ListMessagesRequest) GetLimit() *wrappers.Int32Value { - if x != nil { - return x.Limit - } - return nil -} - -type ListMessagesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` -} - -func (x *ListMessagesResponse) Reset() { - *x = ListMessagesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListMessagesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListMessagesResponse) ProtoMessage() {} - -func (x *ListMessagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListMessagesResponse.ProtoReflect.Descriptor instead. -func (*ListMessagesResponse) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{15} -} - -func (x *ListMessagesResponse) GetMessages() []*Message { - if x != nil { - return x.Messages - } - return nil -} - -type RecentMessagesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ConversationIds []string `protobuf:"bytes,1,rep,name=conversation_ids,json=conversationIds,proto3" json:"conversation_ids,omitempty"` - LimitPerConversation *wrappers.Int32Value `protobuf:"bytes,2,opt,name=limit_per_conversation,json=limitPerConversation,proto3" json:"limit_per_conversation,omitempty"` -} - -func (x *RecentMessagesRequest) Reset() { - *x = RecentMessagesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecentMessagesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecentMessagesRequest) ProtoMessage() {} - -func (x *RecentMessagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecentMessagesRequest.ProtoReflect.Descriptor instead. -func (*RecentMessagesRequest) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{16} -} - -func (x *RecentMessagesRequest) GetConversationIds() []string { - if x != nil { - return x.ConversationIds - } - return nil -} - -func (x *RecentMessagesRequest) GetLimitPerConversation() *wrappers.Int32Value { - if x != nil { - return x.LimitPerConversation - } - return nil -} - -type RecentMessagesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` -} - -func (x *RecentMessagesResponse) Reset() { - *x = RecentMessagesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_streams_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecentMessagesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecentMessagesResponse) ProtoMessage() {} - -func (x *RecentMessagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_streams_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecentMessagesResponse.ProtoReflect.Descriptor instead. -func (*RecentMessagesResponse) Descriptor() ([]byte, []int) { - return file_proto_streams_proto_rawDescGZIP(), []int{17} -} - -func (x *RecentMessagesResponse) GetMessages() []*Message { - if x != nil { - return x.Messages - } - return nil -} - -var File_proto_streams_proto protoreflect.FileDescriptor - -var file_proto_streams_proto_rawDesc = []byte{ - 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x1f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x8a, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x6f, 0x70, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, - 0x63, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xa8, 0x01, 0x0a, - 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, - 0x78, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x06, 0x73, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x22, 0x4c, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x74, 0x6f, 0x70, 0x69, 0x63, 0x22, 0x57, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x62, - 0x0a, 0x17, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x37, 0x0a, 0x08, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x49, 0x64, 0x22, 0x55, 0x0a, 0x18, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, - 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x43, - 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x63, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x35, 0x0a, 0x18, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, - 0x22, 0x58, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, - 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x43, - 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x41, 0x0a, 0x19, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x22, 0x57, 0x0a, - 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x63, - 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x76, - 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, - 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2b, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x70, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x65, 0x78, 0x74, 0x22, 0x43, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xae, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, - 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, - 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x73, 0x65, 0x6e, - 0x74, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x73, 0x65, 0x6e, 0x74, - 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x44, 0x0a, 0x14, 0x4c, 0x69, 0x73, - 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, - 0x95, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x73, 0x12, 0x51, 0x0a, 0x16, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x65, - 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x14, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x76, 0x65, - 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x46, 0x0a, 0x16, 0x52, 0x65, 0x63, 0x65, 0x6e, - 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x32, - 0xcb, 0x05, 0x0a, 0x07, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x22, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x10, 0x52, 0x65, - 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, - 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x21, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x43, - 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, - 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, - 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x5a, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, - 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1d, - 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, - 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1c, 0x2e, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x52, 0x65, - 0x63, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0f, 0x5a, - 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_streams_proto_rawDescOnce sync.Once - file_proto_streams_proto_rawDescData = file_proto_streams_proto_rawDesc -) - -func file_proto_streams_proto_rawDescGZIP() []byte { - file_proto_streams_proto_rawDescOnce.Do(func() { - file_proto_streams_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_streams_proto_rawDescData) - }) - return file_proto_streams_proto_rawDescData -} - -var file_proto_streams_proto_msgTypes = make([]protoimpl.MessageInfo, 18) -var file_proto_streams_proto_goTypes = []interface{}{ - (*Conversation)(nil), // 0: streams.Conversation - (*Message)(nil), // 1: streams.Message - (*CreateConversationRequest)(nil), // 2: streams.CreateConversationRequest - (*CreateConversationResponse)(nil), // 3: streams.CreateConversationResponse - (*ReadConversationRequest)(nil), // 4: streams.ReadConversationRequest - (*ReadConversationResponse)(nil), // 5: streams.ReadConversationResponse - (*ListConversationsRequest)(nil), // 6: streams.ListConversationsRequest - (*ListConversationsResponse)(nil), // 7: streams.ListConversationsResponse - (*UpdateConversationRequest)(nil), // 8: streams.UpdateConversationRequest - (*UpdateConversationResponse)(nil), // 9: streams.UpdateConversationResponse - (*DeleteConversationRequest)(nil), // 10: streams.DeleteConversationRequest - (*DeleteConversationResponse)(nil), // 11: streams.DeleteConversationResponse - (*CreateMessageRequest)(nil), // 12: streams.CreateMessageRequest - (*CreateMessageResponse)(nil), // 13: streams.CreateMessageResponse - (*ListMessagesRequest)(nil), // 14: streams.ListMessagesRequest - (*ListMessagesResponse)(nil), // 15: streams.ListMessagesResponse - (*RecentMessagesRequest)(nil), // 16: streams.RecentMessagesRequest - (*RecentMessagesResponse)(nil), // 17: streams.RecentMessagesResponse - (*timestamp.Timestamp)(nil), // 18: google.protobuf.Timestamp - (*wrappers.StringValue)(nil), // 19: google.protobuf.StringValue - (*wrappers.Int32Value)(nil), // 20: google.protobuf.Int32Value -} -var file_proto_streams_proto_depIdxs = []int32{ - 18, // 0: streams.Conversation.created_at:type_name -> google.protobuf.Timestamp - 18, // 1: streams.Message.sent_at:type_name -> google.protobuf.Timestamp - 0, // 2: streams.CreateConversationResponse.conversation:type_name -> streams.Conversation - 19, // 3: streams.ReadConversationRequest.group_id:type_name -> google.protobuf.StringValue - 0, // 4: streams.ReadConversationResponse.conversation:type_name -> streams.Conversation - 0, // 5: streams.ListConversationsResponse.conversations:type_name -> streams.Conversation - 0, // 6: streams.UpdateConversationResponse.conversation:type_name -> streams.Conversation - 1, // 7: streams.CreateMessageResponse.message:type_name -> streams.Message - 18, // 8: streams.ListMessagesRequest.sent_before:type_name -> google.protobuf.Timestamp - 20, // 9: streams.ListMessagesRequest.limit:type_name -> google.protobuf.Int32Value - 1, // 10: streams.ListMessagesResponse.messages:type_name -> streams.Message - 20, // 11: streams.RecentMessagesRequest.limit_per_conversation:type_name -> google.protobuf.Int32Value - 1, // 12: streams.RecentMessagesResponse.messages:type_name -> streams.Message - 2, // 13: streams.Streams.CreateConversation:input_type -> streams.CreateConversationRequest - 4, // 14: streams.Streams.ReadConversation:input_type -> streams.ReadConversationRequest - 8, // 15: streams.Streams.UpdateConversation:input_type -> streams.UpdateConversationRequest - 10, // 16: streams.Streams.DeleteConversation:input_type -> streams.DeleteConversationRequest - 6, // 17: streams.Streams.ListConversations:input_type -> streams.ListConversationsRequest - 12, // 18: streams.Streams.CreateMessage:input_type -> streams.CreateMessageRequest - 14, // 19: streams.Streams.ListMessages:input_type -> streams.ListMessagesRequest - 16, // 20: streams.Streams.RecentMessages:input_type -> streams.RecentMessagesRequest - 3, // 21: streams.Streams.CreateConversation:output_type -> streams.CreateConversationResponse - 5, // 22: streams.Streams.ReadConversation:output_type -> streams.ReadConversationResponse - 9, // 23: streams.Streams.UpdateConversation:output_type -> streams.UpdateConversationResponse - 11, // 24: streams.Streams.DeleteConversation:output_type -> streams.DeleteConversationResponse - 7, // 25: streams.Streams.ListConversations:output_type -> streams.ListConversationsResponse - 13, // 26: streams.Streams.CreateMessage:output_type -> streams.CreateMessageResponse - 15, // 27: streams.Streams.ListMessages:output_type -> streams.ListMessagesResponse - 17, // 28: streams.Streams.RecentMessages:output_type -> streams.RecentMessagesResponse - 21, // [21:29] is the sub-list for method output_type - 13, // [13:21] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_proto_streams_proto_init() } -func file_proto_streams_proto_init() { - if File_proto_streams_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_streams_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Conversation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateConversationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateConversationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadConversationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadConversationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConversationsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConversationsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateConversationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateConversationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteConversationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteConversationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateMessageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateMessageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessagesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessagesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentMessagesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_streams_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentMessagesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_streams_proto_rawDesc, - NumEnums: 0, - NumMessages: 18, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_proto_streams_proto_goTypes, - DependencyIndexes: file_proto_streams_proto_depIdxs, - MessageInfos: file_proto_streams_proto_msgTypes, - }.Build() - File_proto_streams_proto = out.File - file_proto_streams_proto_rawDesc = nil - file_proto_streams_proto_goTypes = nil - file_proto_streams_proto_depIdxs = nil -} diff --git a/streams/.gitignore b/threads/.gitignore similarity index 100% rename from streams/.gitignore rename to threads/.gitignore diff --git a/threads/Dockerfile b/threads/Dockerfile new file mode 100644 index 0000000..d30a523 --- /dev/null +++ b/threads/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine +ADD threads /threads +ENTRYPOINT [ "/threads" ] diff --git a/streams/Makefile b/threads/Makefile similarity index 72% rename from streams/Makefile rename to threads/Makefile index b9a9ab8..74a0e4b 100644 --- a/streams/Makefile +++ b/threads/Makefile @@ -7,11 +7,11 @@ init: go get github.com/micro/micro/v3/cmd/protoc-gen-micro .PHONY: proto proto: - protoc --proto_path=. --micro_out=. --go_out=:. proto/streams.proto + protoc --proto_path=. --micro_out=. --go_out=:. proto/threads.proto .PHONY: build build: - go build -o streams *.go + go build -o threads *.go .PHONY: test test: @@ -19,4 +19,4 @@ test: .PHONY: docker docker: - docker build . -t streams:latest + docker build . -t threads:latest diff --git a/threads/README.md b/threads/README.md new file mode 100644 index 0000000..fba7f96 --- /dev/null +++ b/threads/README.md @@ -0,0 +1,27 @@ +Threads conversations + +# Threads Service + +Threads provides threaded conversations as a service grouped by topics. + +## Usage + +Generated with + +``` +micro new threads +``` + +## Usage + +Generate the proto code + +``` +make proto +``` + +Run the service + +``` +micro run . +``` diff --git a/streams/generate.go b/threads/generate.go similarity index 100% rename from streams/generate.go rename to threads/generate.go diff --git a/streams/handler/create_conversation.go b/threads/handler/create_conversation.go similarity index 88% rename from streams/handler/create_conversation.go rename to threads/handler/create_conversation.go index 9d449e3..4ea9b2b 100644 --- a/streams/handler/create_conversation.go +++ b/threads/handler/create_conversation.go @@ -6,11 +6,11 @@ import ( "github.com/google/uuid" "github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/streams/proto" + pb "github.com/micro/services/threads/proto" ) // Create a conversation -func (s *Streams) CreateConversation(ctx context.Context, req *pb.CreateConversationRequest, rsp *pb.CreateConversationResponse) error { +func (s *Threads) CreateConversation(ctx context.Context, req *pb.CreateConversationRequest, rsp *pb.CreateConversationResponse) error { // validate the request if len(req.GroupId) == 0 { return ErrMissingGroupID diff --git a/streams/handler/create_conversation_test.go b/threads/handler/create_conversation_test.go similarity index 92% rename from streams/handler/create_conversation_test.go rename to threads/handler/create_conversation_test.go index 879276a..3c2db53 100644 --- a/streams/handler/create_conversation_test.go +++ b/threads/handler/create_conversation_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "google.golang.org/protobuf/types/known/timestamppb" "github.com/google/uuid" diff --git a/streams/handler/create_message.go b/threads/handler/create_message.go similarity index 92% rename from streams/handler/create_message.go rename to threads/handler/create_message.go index 0f3a18c..aec5a5a 100644 --- a/streams/handler/create_message.go +++ b/threads/handler/create_message.go @@ -6,12 +6,12 @@ import ( "github.com/google/uuid" "github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/streams/proto" + pb "github.com/micro/services/threads/proto" "gorm.io/gorm" ) // Create a message within a conversation -func (s *Streams) CreateMessage(ctx context.Context, req *pb.CreateMessageRequest, rsp *pb.CreateMessageResponse) error { +func (s *Threads) CreateMessage(ctx context.Context, req *pb.CreateMessageRequest, rsp *pb.CreateMessageResponse) error { // validate the request if len(req.AuthorId) == 0 { return ErrMissingAuthorID diff --git a/streams/handler/create_message_test.go b/threads/handler/create_message_test.go similarity index 95% rename from streams/handler/create_message_test.go rename to threads/handler/create_message_test.go index e8a20a2..b72f530 100644 --- a/streams/handler/create_message_test.go +++ b/threads/handler/create_message_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "google.golang.org/protobuf/types/known/timestamppb" "github.com/google/uuid" diff --git a/streams/handler/delete_conversation.go b/threads/handler/delete_conversation.go similarity index 89% rename from streams/handler/delete_conversation.go rename to threads/handler/delete_conversation.go index 0b0ca39..b8d79b0 100644 --- a/streams/handler/delete_conversation.go +++ b/threads/handler/delete_conversation.go @@ -5,12 +5,12 @@ import ( "github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/streams/proto" + pb "github.com/micro/services/threads/proto" "gorm.io/gorm" ) // Delete a conversation and all the messages within -func (s *Streams) DeleteConversation(ctx context.Context, req *pb.DeleteConversationRequest, rsp *pb.DeleteConversationResponse) error { +func (s *Threads) DeleteConversation(ctx context.Context, req *pb.DeleteConversationRequest, rsp *pb.DeleteConversationResponse) error { // validate the request if len(req.Id) == 0 { return ErrMissingID diff --git a/streams/handler/delete_conversation_test.go b/threads/handler/delete_conversation_test.go similarity index 93% rename from streams/handler/delete_conversation_test.go rename to threads/handler/delete_conversation_test.go index a6281d0..ae16885 100644 --- a/streams/handler/delete_conversation_test.go +++ b/threads/handler/delete_conversation_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "github.com/google/uuid" "github.com/stretchr/testify/assert" diff --git a/streams/handler/list_conversations.go b/threads/handler/list_conversations.go similarity index 87% rename from streams/handler/list_conversations.go rename to threads/handler/list_conversations.go index d71de98..8a62f90 100644 --- a/streams/handler/list_conversations.go +++ b/threads/handler/list_conversations.go @@ -5,11 +5,11 @@ import ( "github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/streams/proto" + pb "github.com/micro/services/threads/proto" ) // List all the conversations for a group -func (s *Streams) ListConversations(ctx context.Context, req *pb.ListConversationsRequest, rsp *pb.ListConversationsResponse) error { +func (s *Threads) ListConversations(ctx context.Context, req *pb.ListConversationsRequest, rsp *pb.ListConversationsResponse) error { // validate the request if len(req.GroupId) == 0 { return ErrMissingGroupID diff --git a/streams/handler/list_conversations_test.go b/threads/handler/list_conversations_test.go similarity index 93% rename from streams/handler/list_conversations_test.go rename to threads/handler/list_conversations_test.go index 44189aa..87393aa 100644 --- a/streams/handler/list_conversations_test.go +++ b/threads/handler/list_conversations_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/google/uuid" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "github.com/stretchr/testify/assert" ) diff --git a/streams/handler/list_messages.go b/threads/handler/list_messages.go similarity index 91% rename from streams/handler/list_messages.go rename to threads/handler/list_messages.go index adefab1..e637493 100644 --- a/streams/handler/list_messages.go +++ b/threads/handler/list_messages.go @@ -5,14 +5,14 @@ import ( "github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/streams/proto" + pb "github.com/micro/services/threads/proto" ) const DefaultLimit = 25 // List the messages within a conversation in reverse chronological order, using sent_before to // offset as older messages need to be loaded -func (s *Streams) ListMessages(ctx context.Context, req *pb.ListMessagesRequest, rsp *pb.ListMessagesResponse) error { +func (s *Threads) ListMessages(ctx context.Context, req *pb.ListMessagesRequest, rsp *pb.ListMessagesResponse) error { // validate the request if len(req.ConversationId) == 0 { return ErrMissingConversationID diff --git a/streams/handler/list_messages_test.go b/threads/handler/list_messages_test.go similarity index 97% rename from streams/handler/list_messages_test.go rename to threads/handler/list_messages_test.go index 650b998..73046c9 100644 --- a/streams/handler/list_messages_test.go +++ b/threads/handler/list_messages_test.go @@ -8,8 +8,8 @@ import ( "time" "github.com/google/uuid" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/wrapperspb" ) diff --git a/streams/handler/read_conversation.go b/threads/handler/read_conversation.go similarity index 88% rename from streams/handler/read_conversation.go rename to threads/handler/read_conversation.go index 449cafc..2ae08c1 100644 --- a/streams/handler/read_conversation.go +++ b/threads/handler/read_conversation.go @@ -7,11 +7,11 @@ import ( "github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/streams/proto" + pb "github.com/micro/services/threads/proto" ) // Read a conversation using its ID, can filter using group ID if provided -func (s *Streams) ReadConversation(ctx context.Context, req *pb.ReadConversationRequest, rsp *pb.ReadConversationResponse) error { +func (s *Threads) ReadConversation(ctx context.Context, req *pb.ReadConversationRequest, rsp *pb.ReadConversationResponse) error { // validate the request if len(req.Id) == 0 { return ErrMissingID diff --git a/streams/handler/read_conversation_test.go b/threads/handler/read_conversation_test.go similarity index 94% rename from streams/handler/read_conversation_test.go rename to threads/handler/read_conversation_test.go index 542e542..35cfc25 100644 --- a/streams/handler/read_conversation_test.go +++ b/threads/handler/read_conversation_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/google/uuid" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/wrapperspb" ) diff --git a/streams/handler/recent_messages.go b/threads/handler/recent_messages.go similarity index 92% rename from streams/handler/recent_messages.go rename to threads/handler/recent_messages.go index b23782f..addda0d 100644 --- a/streams/handler/recent_messages.go +++ b/threads/handler/recent_messages.go @@ -5,14 +5,14 @@ import ( "github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/streams/proto" + pb "github.com/micro/services/threads/proto" "gorm.io/gorm" ) // RecentMessages returns the most recent messages in a group of conversations. By default the // most messages retrieved per conversation is 25, however this can be overriden using the // limit_per_conversation option -func (s *Streams) RecentMessages(ctx context.Context, req *pb.RecentMessagesRequest, rsp *pb.RecentMessagesResponse) error { +func (s *Threads) RecentMessages(ctx context.Context, req *pb.RecentMessagesRequest, rsp *pb.RecentMessagesResponse) error { // validate the request if len(req.ConversationIds) == 0 { return ErrMissingConversationIDs diff --git a/streams/handler/recent_messages_test.go b/threads/handler/recent_messages_test.go similarity index 96% rename from streams/handler/recent_messages_test.go rename to threads/handler/recent_messages_test.go index b59ba5a..3f8ab87 100644 --- a/streams/handler/recent_messages_test.go +++ b/threads/handler/recent_messages_test.go @@ -7,8 +7,8 @@ import ( "time" "github.com/google/uuid" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/wrapperspb" ) diff --git a/streams/handler/streams.go b/threads/handler/streams.go similarity index 95% rename from streams/handler/streams.go rename to threads/handler/streams.go index b896d81..97cf327 100644 --- a/streams/handler/streams.go +++ b/threads/handler/streams.go @@ -4,7 +4,7 @@ import ( "time" "github.com/micro/micro/v3/service/errors" - pb "github.com/micro/services/streams/proto" + pb "github.com/micro/services/threads/proto" "google.golang.org/protobuf/types/known/timestamppb" "gorm.io/gorm" ) @@ -20,7 +20,7 @@ var ( ErrNotFound = errors.NotFound("NOT_FOUND", "Conversation not found") ) -type Streams struct { +type Threads struct { DB *gorm.DB Time func() time.Time } diff --git a/streams/handler/streams_test.go b/threads/handler/streams_test.go similarity index 88% rename from streams/handler/streams_test.go rename to threads/handler/streams_test.go index 6f0856b..5cb17b8 100644 --- a/streams/handler/streams_test.go +++ b/threads/handler/streams_test.go @@ -4,17 +4,17 @@ import ( "testing" "time" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "github.com/stretchr/testify/assert" "gorm.io/driver/postgres" "gorm.io/gorm" ) -func testHandler(t *testing.T) *handler.Streams { +func testHandler(t *testing.T) *handler.Threads { // connect to the database - db, err := gorm.Open(postgres.Open("postgresql://postgres@localhost:5432/streams?sslmode=disable"), &gorm.Config{}) + db, err := gorm.Open(postgres.Open("postgresql://postgres@localhost:5432/threads?sslmode=disable"), &gorm.Config{}) if err != nil { t.Fatalf("Error connecting to database: %v", err) } @@ -29,7 +29,7 @@ func testHandler(t *testing.T) *handler.Streams { t.Fatalf("Error cleaning database: %v", err) } - return &handler.Streams{DB: db, Time: func() time.Time { return time.Unix(1611327673, 0) }} + return &handler.Threads{DB: db, Time: func() time.Time { return time.Unix(1611327673, 0) }} } func assertConversationsMatch(t *testing.T, exp, act *pb.Conversation) { diff --git a/streams/handler/update_conversation.go b/threads/handler/update_conversation.go similarity index 90% rename from streams/handler/update_conversation.go rename to threads/handler/update_conversation.go index d46f754..5076c32 100644 --- a/streams/handler/update_conversation.go +++ b/threads/handler/update_conversation.go @@ -5,12 +5,12 @@ import ( "github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/streams/proto" + pb "github.com/micro/services/threads/proto" "gorm.io/gorm" ) // Update a conversations topic -func (s *Streams) UpdateConversation(ctx context.Context, req *pb.UpdateConversationRequest, rsp *pb.UpdateConversationResponse) error { +func (s *Threads) UpdateConversation(ctx context.Context, req *pb.UpdateConversationRequest, rsp *pb.UpdateConversationResponse) error { // validate the request if len(req.Id) == 0 { return ErrMissingID diff --git a/streams/handler/update_conversation_test.go b/threads/handler/update_conversation_test.go similarity index 95% rename from streams/handler/update_conversation_test.go rename to threads/handler/update_conversation_test.go index 00d0945..ebbbf5f 100644 --- a/streams/handler/update_conversation_test.go +++ b/threads/handler/update_conversation_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/google/uuid" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "github.com/stretchr/testify/assert" ) diff --git a/streams/main.go b/threads/main.go similarity index 74% rename from streams/main.go rename to threads/main.go index 121d896..59d1d28 100644 --- a/streams/main.go +++ b/threads/main.go @@ -3,8 +3,8 @@ package main import ( "time" - "github.com/micro/services/streams/handler" - pb "github.com/micro/services/streams/proto" + "github.com/micro/services/threads/handler" + pb "github.com/micro/services/threads/proto" "github.com/micro/micro/v3/service" "github.com/micro/micro/v3/service/config" @@ -13,17 +13,17 @@ import ( "gorm.io/gorm" ) -var dbAddress = "postgresql://postgres@localhost:5432/streams?sslmode=disable" +var dbAddress = "postgresql://postgres@localhost:5432/threads?sslmode=disable" func main() { // Create service srv := service.New( - service.Name("streams"), + service.Name("threads"), service.Version("latest"), ) // Connect to the database - cfg, err := config.Get("streams.database") + cfg, err := config.Get("threads.database") if err != nil { logger.Fatalf("Error loading config: %v", err) } @@ -37,7 +37,7 @@ func main() { } // Register handler - pb.RegisterStreamsHandler(srv.Server(), &handler.Streams{DB: db, Time: time.Now}) + pb.RegisterThreadsHandler(srv.Server(), &handler.Threads{DB: db, Time: time.Now}) // Run service if err := srv.Run(); err != nil { diff --git a/threads/micro.mu b/threads/micro.mu new file mode 100644 index 0000000..2921d5e --- /dev/null +++ b/threads/micro.mu @@ -0,0 +1 @@ +service threads diff --git a/threads/proto/threads.pb.go b/threads/proto/threads.pb.go new file mode 100644 index 0000000..6827d63 --- /dev/null +++ b/threads/proto/threads.pb.go @@ -0,0 +1,911 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: proto/threads.proto + +package threads + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + wrappers "github.com/golang/protobuf/ptypes/wrappers" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type Conversation struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` + CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Conversation) Reset() { *m = Conversation{} } +func (m *Conversation) String() string { return proto.CompactTextString(m) } +func (*Conversation) ProtoMessage() {} +func (*Conversation) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{0} +} + +func (m *Conversation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Conversation.Unmarshal(m, b) +} +func (m *Conversation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Conversation.Marshal(b, m, deterministic) +} +func (m *Conversation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Conversation.Merge(m, src) +} +func (m *Conversation) XXX_Size() int { + return xxx_messageInfo_Conversation.Size(m) +} +func (m *Conversation) XXX_DiscardUnknown() { + xxx_messageInfo_Conversation.DiscardUnknown(m) +} + +var xxx_messageInfo_Conversation proto.InternalMessageInfo + +func (m *Conversation) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Conversation) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *Conversation) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +func (m *Conversation) GetCreatedAt() *timestamp.Timestamp { + if m != nil { + return m.CreatedAt + } + return nil +} + +type Message struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + AuthorId string `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` + ConversationId string `protobuf:"bytes,3,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` + Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` + SentAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=sent_at,json=sentAt,proto3" json:"sent_at,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Message) Reset() { *m = Message{} } +func (m *Message) String() string { return proto.CompactTextString(m) } +func (*Message) ProtoMessage() {} +func (*Message) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{1} +} + +func (m *Message) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Message.Unmarshal(m, b) +} +func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Message.Marshal(b, m, deterministic) +} +func (m *Message) XXX_Merge(src proto.Message) { + xxx_messageInfo_Message.Merge(m, src) +} +func (m *Message) XXX_Size() int { + return xxx_messageInfo_Message.Size(m) +} +func (m *Message) XXX_DiscardUnknown() { + xxx_messageInfo_Message.DiscardUnknown(m) +} + +var xxx_messageInfo_Message proto.InternalMessageInfo + +func (m *Message) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Message) GetAuthorId() string { + if m != nil { + return m.AuthorId + } + return "" +} + +func (m *Message) GetConversationId() string { + if m != nil { + return m.ConversationId + } + return "" +} + +func (m *Message) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +func (m *Message) GetSentAt() *timestamp.Timestamp { + if m != nil { + return m.SentAt + } + return nil +} + +type CreateConversationRequest struct { + GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateConversationRequest) Reset() { *m = CreateConversationRequest{} } +func (m *CreateConversationRequest) String() string { return proto.CompactTextString(m) } +func (*CreateConversationRequest) ProtoMessage() {} +func (*CreateConversationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{2} +} + +func (m *CreateConversationRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateConversationRequest.Unmarshal(m, b) +} +func (m *CreateConversationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateConversationRequest.Marshal(b, m, deterministic) +} +func (m *CreateConversationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateConversationRequest.Merge(m, src) +} +func (m *CreateConversationRequest) XXX_Size() int { + return xxx_messageInfo_CreateConversationRequest.Size(m) +} +func (m *CreateConversationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateConversationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateConversationRequest proto.InternalMessageInfo + +func (m *CreateConversationRequest) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *CreateConversationRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +type CreateConversationResponse struct { + Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateConversationResponse) Reset() { *m = CreateConversationResponse{} } +func (m *CreateConversationResponse) String() string { return proto.CompactTextString(m) } +func (*CreateConversationResponse) ProtoMessage() {} +func (*CreateConversationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{3} +} + +func (m *CreateConversationResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateConversationResponse.Unmarshal(m, b) +} +func (m *CreateConversationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateConversationResponse.Marshal(b, m, deterministic) +} +func (m *CreateConversationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateConversationResponse.Merge(m, src) +} +func (m *CreateConversationResponse) XXX_Size() int { + return xxx_messageInfo_CreateConversationResponse.Size(m) +} +func (m *CreateConversationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateConversationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateConversationResponse proto.InternalMessageInfo + +func (m *CreateConversationResponse) GetConversation() *Conversation { + if m != nil { + return m.Conversation + } + return nil +} + +type ReadConversationRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + GroupId *wrappers.StringValue `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReadConversationRequest) Reset() { *m = ReadConversationRequest{} } +func (m *ReadConversationRequest) String() string { return proto.CompactTextString(m) } +func (*ReadConversationRequest) ProtoMessage() {} +func (*ReadConversationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{4} +} + +func (m *ReadConversationRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadConversationRequest.Unmarshal(m, b) +} +func (m *ReadConversationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadConversationRequest.Marshal(b, m, deterministic) +} +func (m *ReadConversationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadConversationRequest.Merge(m, src) +} +func (m *ReadConversationRequest) XXX_Size() int { + return xxx_messageInfo_ReadConversationRequest.Size(m) +} +func (m *ReadConversationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ReadConversationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadConversationRequest proto.InternalMessageInfo + +func (m *ReadConversationRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ReadConversationRequest) GetGroupId() *wrappers.StringValue { + if m != nil { + return m.GroupId + } + return nil +} + +type ReadConversationResponse struct { + Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReadConversationResponse) Reset() { *m = ReadConversationResponse{} } +func (m *ReadConversationResponse) String() string { return proto.CompactTextString(m) } +func (*ReadConversationResponse) ProtoMessage() {} +func (*ReadConversationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{5} +} + +func (m *ReadConversationResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadConversationResponse.Unmarshal(m, b) +} +func (m *ReadConversationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadConversationResponse.Marshal(b, m, deterministic) +} +func (m *ReadConversationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadConversationResponse.Merge(m, src) +} +func (m *ReadConversationResponse) XXX_Size() int { + return xxx_messageInfo_ReadConversationResponse.Size(m) +} +func (m *ReadConversationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ReadConversationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadConversationResponse proto.InternalMessageInfo + +func (m *ReadConversationResponse) GetConversation() *Conversation { + if m != nil { + return m.Conversation + } + return nil +} + +type ListConversationsRequest struct { + GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListConversationsRequest) Reset() { *m = ListConversationsRequest{} } +func (m *ListConversationsRequest) String() string { return proto.CompactTextString(m) } +func (*ListConversationsRequest) ProtoMessage() {} +func (*ListConversationsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{6} +} + +func (m *ListConversationsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListConversationsRequest.Unmarshal(m, b) +} +func (m *ListConversationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListConversationsRequest.Marshal(b, m, deterministic) +} +func (m *ListConversationsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListConversationsRequest.Merge(m, src) +} +func (m *ListConversationsRequest) XXX_Size() int { + return xxx_messageInfo_ListConversationsRequest.Size(m) +} +func (m *ListConversationsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListConversationsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListConversationsRequest proto.InternalMessageInfo + +func (m *ListConversationsRequest) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +type ListConversationsResponse struct { + Conversations []*Conversation `protobuf:"bytes,1,rep,name=conversations,proto3" json:"conversations,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListConversationsResponse) Reset() { *m = ListConversationsResponse{} } +func (m *ListConversationsResponse) String() string { return proto.CompactTextString(m) } +func (*ListConversationsResponse) ProtoMessage() {} +func (*ListConversationsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{7} +} + +func (m *ListConversationsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListConversationsResponse.Unmarshal(m, b) +} +func (m *ListConversationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListConversationsResponse.Marshal(b, m, deterministic) +} +func (m *ListConversationsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListConversationsResponse.Merge(m, src) +} +func (m *ListConversationsResponse) XXX_Size() int { + return xxx_messageInfo_ListConversationsResponse.Size(m) +} +func (m *ListConversationsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListConversationsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListConversationsResponse proto.InternalMessageInfo + +func (m *ListConversationsResponse) GetConversations() []*Conversation { + if m != nil { + return m.Conversations + } + return nil +} + +type UpdateConversationRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateConversationRequest) Reset() { *m = UpdateConversationRequest{} } +func (m *UpdateConversationRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateConversationRequest) ProtoMessage() {} +func (*UpdateConversationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{8} +} + +func (m *UpdateConversationRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateConversationRequest.Unmarshal(m, b) +} +func (m *UpdateConversationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateConversationRequest.Marshal(b, m, deterministic) +} +func (m *UpdateConversationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateConversationRequest.Merge(m, src) +} +func (m *UpdateConversationRequest) XXX_Size() int { + return xxx_messageInfo_UpdateConversationRequest.Size(m) +} +func (m *UpdateConversationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateConversationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateConversationRequest proto.InternalMessageInfo + +func (m *UpdateConversationRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *UpdateConversationRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +type UpdateConversationResponse struct { + Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateConversationResponse) Reset() { *m = UpdateConversationResponse{} } +func (m *UpdateConversationResponse) String() string { return proto.CompactTextString(m) } +func (*UpdateConversationResponse) ProtoMessage() {} +func (*UpdateConversationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{9} +} + +func (m *UpdateConversationResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateConversationResponse.Unmarshal(m, b) +} +func (m *UpdateConversationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateConversationResponse.Marshal(b, m, deterministic) +} +func (m *UpdateConversationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateConversationResponse.Merge(m, src) +} +func (m *UpdateConversationResponse) XXX_Size() int { + return xxx_messageInfo_UpdateConversationResponse.Size(m) +} +func (m *UpdateConversationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateConversationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateConversationResponse proto.InternalMessageInfo + +func (m *UpdateConversationResponse) GetConversation() *Conversation { + if m != nil { + return m.Conversation + } + return nil +} + +type DeleteConversationRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteConversationRequest) Reset() { *m = DeleteConversationRequest{} } +func (m *DeleteConversationRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteConversationRequest) ProtoMessage() {} +func (*DeleteConversationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{10} +} + +func (m *DeleteConversationRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteConversationRequest.Unmarshal(m, b) +} +func (m *DeleteConversationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteConversationRequest.Marshal(b, m, deterministic) +} +func (m *DeleteConversationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteConversationRequest.Merge(m, src) +} +func (m *DeleteConversationRequest) XXX_Size() int { + return xxx_messageInfo_DeleteConversationRequest.Size(m) +} +func (m *DeleteConversationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteConversationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteConversationRequest proto.InternalMessageInfo + +func (m *DeleteConversationRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type DeleteConversationResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteConversationResponse) Reset() { *m = DeleteConversationResponse{} } +func (m *DeleteConversationResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteConversationResponse) ProtoMessage() {} +func (*DeleteConversationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{11} +} + +func (m *DeleteConversationResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteConversationResponse.Unmarshal(m, b) +} +func (m *DeleteConversationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteConversationResponse.Marshal(b, m, deterministic) +} +func (m *DeleteConversationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteConversationResponse.Merge(m, src) +} +func (m *DeleteConversationResponse) XXX_Size() int { + return xxx_messageInfo_DeleteConversationResponse.Size(m) +} +func (m *DeleteConversationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteConversationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteConversationResponse proto.InternalMessageInfo + +type CreateMessageRequest struct { + ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` + AuthorId string `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` + Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateMessageRequest) Reset() { *m = CreateMessageRequest{} } +func (m *CreateMessageRequest) String() string { return proto.CompactTextString(m) } +func (*CreateMessageRequest) ProtoMessage() {} +func (*CreateMessageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{12} +} + +func (m *CreateMessageRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateMessageRequest.Unmarshal(m, b) +} +func (m *CreateMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateMessageRequest.Marshal(b, m, deterministic) +} +func (m *CreateMessageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateMessageRequest.Merge(m, src) +} +func (m *CreateMessageRequest) XXX_Size() int { + return xxx_messageInfo_CreateMessageRequest.Size(m) +} +func (m *CreateMessageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateMessageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateMessageRequest proto.InternalMessageInfo + +func (m *CreateMessageRequest) GetConversationId() string { + if m != nil { + return m.ConversationId + } + return "" +} + +func (m *CreateMessageRequest) GetAuthorId() string { + if m != nil { + return m.AuthorId + } + return "" +} + +func (m *CreateMessageRequest) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +type CreateMessageResponse struct { + Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateMessageResponse) Reset() { *m = CreateMessageResponse{} } +func (m *CreateMessageResponse) String() string { return proto.CompactTextString(m) } +func (*CreateMessageResponse) ProtoMessage() {} +func (*CreateMessageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{13} +} + +func (m *CreateMessageResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateMessageResponse.Unmarshal(m, b) +} +func (m *CreateMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateMessageResponse.Marshal(b, m, deterministic) +} +func (m *CreateMessageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateMessageResponse.Merge(m, src) +} +func (m *CreateMessageResponse) XXX_Size() int { + return xxx_messageInfo_CreateMessageResponse.Size(m) +} +func (m *CreateMessageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateMessageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateMessageResponse proto.InternalMessageInfo + +func (m *CreateMessageResponse) GetMessage() *Message { + if m != nil { + return m.Message + } + return nil +} + +type ListMessagesRequest struct { + ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` + SentBefore *timestamp.Timestamp `protobuf:"bytes,2,opt,name=sent_before,json=sentBefore,proto3" json:"sent_before,omitempty"` + Limit *wrappers.Int32Value `protobuf:"bytes,3,opt,name=limit,proto3" json:"limit,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListMessagesRequest) Reset() { *m = ListMessagesRequest{} } +func (m *ListMessagesRequest) String() string { return proto.CompactTextString(m) } +func (*ListMessagesRequest) ProtoMessage() {} +func (*ListMessagesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{14} +} + +func (m *ListMessagesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListMessagesRequest.Unmarshal(m, b) +} +func (m *ListMessagesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListMessagesRequest.Marshal(b, m, deterministic) +} +func (m *ListMessagesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListMessagesRequest.Merge(m, src) +} +func (m *ListMessagesRequest) XXX_Size() int { + return xxx_messageInfo_ListMessagesRequest.Size(m) +} +func (m *ListMessagesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListMessagesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListMessagesRequest proto.InternalMessageInfo + +func (m *ListMessagesRequest) GetConversationId() string { + if m != nil { + return m.ConversationId + } + return "" +} + +func (m *ListMessagesRequest) GetSentBefore() *timestamp.Timestamp { + if m != nil { + return m.SentBefore + } + return nil +} + +func (m *ListMessagesRequest) GetLimit() *wrappers.Int32Value { + if m != nil { + return m.Limit + } + return nil +} + +type ListMessagesResponse struct { + Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListMessagesResponse) Reset() { *m = ListMessagesResponse{} } +func (m *ListMessagesResponse) String() string { return proto.CompactTextString(m) } +func (*ListMessagesResponse) ProtoMessage() {} +func (*ListMessagesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{15} +} + +func (m *ListMessagesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListMessagesResponse.Unmarshal(m, b) +} +func (m *ListMessagesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListMessagesResponse.Marshal(b, m, deterministic) +} +func (m *ListMessagesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListMessagesResponse.Merge(m, src) +} +func (m *ListMessagesResponse) XXX_Size() int { + return xxx_messageInfo_ListMessagesResponse.Size(m) +} +func (m *ListMessagesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListMessagesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListMessagesResponse proto.InternalMessageInfo + +func (m *ListMessagesResponse) GetMessages() []*Message { + if m != nil { + return m.Messages + } + return nil +} + +type RecentMessagesRequest struct { + ConversationIds []string `protobuf:"bytes,1,rep,name=conversation_ids,json=conversationIds,proto3" json:"conversation_ids,omitempty"` + LimitPerConversation *wrappers.Int32Value `protobuf:"bytes,2,opt,name=limit_per_conversation,json=limitPerConversation,proto3" json:"limit_per_conversation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RecentMessagesRequest) Reset() { *m = RecentMessagesRequest{} } +func (m *RecentMessagesRequest) String() string { return proto.CompactTextString(m) } +func (*RecentMessagesRequest) ProtoMessage() {} +func (*RecentMessagesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{16} +} + +func (m *RecentMessagesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RecentMessagesRequest.Unmarshal(m, b) +} +func (m *RecentMessagesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RecentMessagesRequest.Marshal(b, m, deterministic) +} +func (m *RecentMessagesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecentMessagesRequest.Merge(m, src) +} +func (m *RecentMessagesRequest) XXX_Size() int { + return xxx_messageInfo_RecentMessagesRequest.Size(m) +} +func (m *RecentMessagesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RecentMessagesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RecentMessagesRequest proto.InternalMessageInfo + +func (m *RecentMessagesRequest) GetConversationIds() []string { + if m != nil { + return m.ConversationIds + } + return nil +} + +func (m *RecentMessagesRequest) GetLimitPerConversation() *wrappers.Int32Value { + if m != nil { + return m.LimitPerConversation + } + return nil +} + +type RecentMessagesResponse struct { + Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RecentMessagesResponse) Reset() { *m = RecentMessagesResponse{} } +func (m *RecentMessagesResponse) String() string { return proto.CompactTextString(m) } +func (*RecentMessagesResponse) ProtoMessage() {} +func (*RecentMessagesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_78fcd0275ccaea0d, []int{17} +} + +func (m *RecentMessagesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RecentMessagesResponse.Unmarshal(m, b) +} +func (m *RecentMessagesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RecentMessagesResponse.Marshal(b, m, deterministic) +} +func (m *RecentMessagesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecentMessagesResponse.Merge(m, src) +} +func (m *RecentMessagesResponse) XXX_Size() int { + return xxx_messageInfo_RecentMessagesResponse.Size(m) +} +func (m *RecentMessagesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RecentMessagesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RecentMessagesResponse proto.InternalMessageInfo + +func (m *RecentMessagesResponse) GetMessages() []*Message { + if m != nil { + return m.Messages + } + return nil +} + +func init() { + proto.RegisterType((*Conversation)(nil), "threads.Conversation") + proto.RegisterType((*Message)(nil), "threads.Message") + proto.RegisterType((*CreateConversationRequest)(nil), "threads.CreateConversationRequest") + proto.RegisterType((*CreateConversationResponse)(nil), "threads.CreateConversationResponse") + proto.RegisterType((*ReadConversationRequest)(nil), "threads.ReadConversationRequest") + proto.RegisterType((*ReadConversationResponse)(nil), "threads.ReadConversationResponse") + proto.RegisterType((*ListConversationsRequest)(nil), "threads.ListConversationsRequest") + proto.RegisterType((*ListConversationsResponse)(nil), "threads.ListConversationsResponse") + proto.RegisterType((*UpdateConversationRequest)(nil), "threads.UpdateConversationRequest") + proto.RegisterType((*UpdateConversationResponse)(nil), "threads.UpdateConversationResponse") + proto.RegisterType((*DeleteConversationRequest)(nil), "threads.DeleteConversationRequest") + proto.RegisterType((*DeleteConversationResponse)(nil), "threads.DeleteConversationResponse") + proto.RegisterType((*CreateMessageRequest)(nil), "threads.CreateMessageRequest") + proto.RegisterType((*CreateMessageResponse)(nil), "threads.CreateMessageResponse") + proto.RegisterType((*ListMessagesRequest)(nil), "threads.ListMessagesRequest") + proto.RegisterType((*ListMessagesResponse)(nil), "threads.ListMessagesResponse") + proto.RegisterType((*RecentMessagesRequest)(nil), "threads.RecentMessagesRequest") + proto.RegisterType((*RecentMessagesResponse)(nil), "threads.RecentMessagesResponse") +} + +func init() { proto.RegisterFile("proto/threads.proto", fileDescriptor_78fcd0275ccaea0d) } + +var fileDescriptor_78fcd0275ccaea0d = []byte{ + // 749 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xdb, 0x6e, 0xd3, 0x4a, + 0x14, 0x95, 0xd3, 0xa6, 0x69, 0x76, 0x7a, 0x3b, 0xd3, 0xb4, 0xc7, 0x71, 0x6f, 0x39, 0x73, 0x1e, + 0x4e, 0x0f, 0xa0, 0x54, 0xa4, 0x42, 0xa8, 0xea, 0x53, 0x2f, 0x42, 0x8a, 0x28, 0x88, 0x9a, 0x96, + 0xa2, 0x4a, 0x55, 0xe4, 0xc4, 0xd3, 0xd4, 0x52, 0x62, 0x1b, 0xcf, 0x04, 0xf8, 0x06, 0xde, 0xf9, + 0x07, 0x9e, 0xf8, 0x11, 0x7e, 0x0a, 0x65, 0x66, 0x9c, 0x8c, 0x2f, 0x93, 0x02, 0x7d, 0xf3, 0xcc, + 0xac, 0xd9, 0x5e, 0x6b, 0xcf, 0x5e, 0x0b, 0x56, 0xc3, 0x28, 0x60, 0xc1, 0x1e, 0xbb, 0x8b, 0x88, + 0xe3, 0xd2, 0x06, 0x5f, 0xa1, 0x92, 0x5c, 0x5a, 0x3b, 0xbd, 0x20, 0xe8, 0xf5, 0xc9, 0x1e, 0xdf, + 0xee, 0x0c, 0x6f, 0xf7, 0x98, 0x37, 0x20, 0x94, 0x39, 0x83, 0x50, 0x20, 0xad, 0xed, 0x34, 0xe0, + 0x53, 0xe4, 0x84, 0x21, 0x89, 0x64, 0x25, 0xfc, 0xc5, 0x80, 0x85, 0x93, 0xc0, 0xff, 0x48, 0x22, + 0xea, 0x30, 0x2f, 0xf0, 0xd1, 0x12, 0x14, 0x3c, 0xd7, 0x34, 0xea, 0xc6, 0x6e, 0xd9, 0x2e, 0x78, + 0x2e, 0xaa, 0xc1, 0x7c, 0x2f, 0x0a, 0x86, 0x61, 0xdb, 0x73, 0xcd, 0x02, 0xdf, 0x2d, 0xf1, 0x75, + 0xcb, 0x45, 0x55, 0x28, 0xb2, 0x20, 0xf4, 0xba, 0xe6, 0x0c, 0xdf, 0x17, 0x0b, 0x74, 0x00, 0xd0, + 0x8d, 0x88, 0xc3, 0x88, 0xdb, 0x76, 0x98, 0x39, 0x5b, 0x37, 0x76, 0x2b, 0x4d, 0xab, 0x21, 0x68, + 0x34, 0x62, 0x1a, 0x8d, 0x8b, 0x98, 0xa7, 0x5d, 0x96, 0xe8, 0x23, 0x86, 0xbf, 0x19, 0x50, 0x7a, + 0x45, 0x28, 0x75, 0x7a, 0x24, 0xc3, 0x63, 0x03, 0xca, 0xce, 0x90, 0xdd, 0x05, 0xd1, 0x84, 0xc8, + 0xbc, 0xd8, 0x68, 0xb9, 0xe8, 0x3f, 0x58, 0xee, 0x2a, 0x22, 0x46, 0x10, 0xc1, 0x69, 0x49, 0xdd, + 0x6e, 0xb9, 0x08, 0xc1, 0x2c, 0x23, 0x9f, 0x05, 0xad, 0xb2, 0xcd, 0xbf, 0xd1, 0x3e, 0x94, 0x28, + 0xf1, 0xd9, 0x88, 0x6d, 0xf1, 0x5e, 0xb6, 0x73, 0x23, 0xe8, 0x11, 0xc3, 0x67, 0x50, 0x3b, 0xe1, + 0xbc, 0xd5, 0xe6, 0xd9, 0xe4, 0xc3, 0x90, 0x50, 0x96, 0xe8, 0x99, 0xa1, 0xe9, 0x59, 0x41, 0xe9, + 0x19, 0xbe, 0x02, 0x2b, 0xaf, 0x1a, 0x0d, 0x03, 0x9f, 0x12, 0x74, 0x00, 0x0b, 0xaa, 0x0c, 0x5e, + 0xb2, 0xd2, 0x5c, 0x6b, 0xc4, 0x33, 0x91, 0xb8, 0x94, 0x80, 0xe2, 0x0e, 0xfc, 0x6d, 0x13, 0xc7, + 0xcd, 0x23, 0x99, 0x6e, 0xf0, 0xf3, 0xd4, 0x43, 0x57, 0x9a, 0x9b, 0x99, 0x3e, 0xbc, 0x65, 0x91, + 0xe7, 0xf7, 0xde, 0x39, 0xfd, 0x21, 0x19, 0x4b, 0xc2, 0x97, 0x60, 0x66, 0xff, 0xf1, 0x70, 0xea, + 0xcf, 0xc0, 0x3c, 0xf3, 0x28, 0x53, 0x11, 0xf4, 0xfe, 0x06, 0xe3, 0xf7, 0x50, 0xcb, 0xb9, 0x26, + 0xe9, 0x1c, 0xc2, 0xa2, 0xfa, 0x0f, 0x6a, 0x1a, 0xf5, 0x19, 0x3d, 0x9f, 0x24, 0x16, 0x1f, 0x41, + 0xed, 0x32, 0x74, 0x35, 0x4f, 0x9e, 0xee, 0xa6, 0xf6, 0x9d, 0xf3, 0x4a, 0x3c, 0xbc, 0x59, 0x8f, + 0xa1, 0x76, 0x4a, 0xfa, 0xe4, 0x97, 0xb8, 0xe1, 0x4d, 0xb0, 0xf2, 0xc0, 0x82, 0x05, 0x0e, 0xa1, + 0x2a, 0x66, 0x51, 0x3a, 0x31, 0xae, 0x92, 0xe3, 0x31, 0x23, 0xd7, 0x63, 0x53, 0x9d, 0x1a, 0x1b, + 0x70, 0x66, 0x62, 0x40, 0x7c, 0x02, 0x6b, 0xa9, 0x3f, 0xca, 0x86, 0x3c, 0x82, 0xd2, 0x40, 0x6c, + 0xc9, 0x5e, 0xac, 0x8c, 0x7b, 0x11, 0x43, 0x63, 0x00, 0xfe, 0x6e, 0xc0, 0xea, 0xe8, 0xe1, 0xe5, + 0x01, 0xfd, 0x6d, 0xda, 0x87, 0x50, 0xe1, 0x31, 0xd0, 0x21, 0xb7, 0x41, 0x44, 0xa4, 0x05, 0xa6, + 0x45, 0x01, 0x8c, 0xe0, 0xc7, 0x1c, 0x8d, 0x9e, 0x42, 0xb1, 0xef, 0x0d, 0x3c, 0xa1, 0xab, 0xd2, + 0xdc, 0xc8, 0x5c, 0x6b, 0xf9, 0x6c, 0xbf, 0x29, 0x8c, 0x23, 0x90, 0xf8, 0x14, 0xaa, 0x49, 0xbe, + 0x52, 0xf4, 0x13, 0x98, 0x97, 0x9a, 0xe2, 0xf1, 0xcc, 0xaa, 0x1e, 0x23, 0xf0, 0x57, 0x03, 0xd6, + 0x6c, 0xd2, 0x25, 0x7e, 0x46, 0xf8, 0xff, 0xb0, 0x92, 0x12, 0x2e, 0xea, 0x95, 0xed, 0xe5, 0xa4, + 0x72, 0x8a, 0xce, 0x61, 0x9d, 0x73, 0x6a, 0x87, 0x24, 0x6a, 0x27, 0x46, 0xb0, 0x70, 0xbf, 0x9c, + 0x2a, 0xbf, 0xfa, 0x86, 0x44, 0xea, 0x34, 0xe1, 0x17, 0xb0, 0x9e, 0xa6, 0xf5, 0x27, 0xfa, 0x9a, + 0x3f, 0x8a, 0x50, 0xba, 0x10, 0xa7, 0xe8, 0x06, 0x50, 0x36, 0x25, 0x11, 0x9e, 0xf8, 0x43, 0x17, + 0xc8, 0xd6, 0xbf, 0x53, 0x31, 0x92, 0xd8, 0x15, 0xac, 0xa4, 0x73, 0x0c, 0xd5, 0xc7, 0x17, 0x35, + 0x31, 0x6a, 0xfd, 0x33, 0x05, 0x21, 0x0b, 0xdf, 0x00, 0xca, 0xba, 0x5e, 0xe1, 0xad, 0x4d, 0x15, + 0x85, 0xf7, 0x94, 0xd8, 0xb8, 0x01, 0x94, 0xb5, 0xb3, 0x52, 0x5e, 0x1b, 0x0c, 0x4a, 0x79, 0x7d, + 0x1e, 0xa0, 0x6b, 0xf8, 0x2b, 0x13, 0xa8, 0x68, 0xa2, 0x5a, 0x97, 0xd1, 0x16, 0x9e, 0x06, 0x91, + 0xb5, 0x5f, 0xc3, 0x62, 0xc2, 0xf9, 0x68, 0x2b, 0xf5, 0x50, 0xc9, 0x0c, 0xb2, 0xb6, 0x75, 0xc7, + 0xb2, 0xde, 0x4b, 0x58, 0x50, 0x3d, 0x85, 0x36, 0x13, 0x1c, 0x52, 0x0e, 0xb1, 0xb6, 0x34, 0xa7, + 0xb2, 0xd8, 0x39, 0x2c, 0x25, 0x47, 0x18, 0x6d, 0x2b, 0x6f, 0x9d, 0x63, 0x39, 0x6b, 0x47, 0x7b, + 0x2e, 0x4a, 0x1e, 0x2f, 0x5f, 0x2f, 0x72, 0x0b, 0x1d, 0x4a, 0x5c, 0x67, 0x8e, 0x2f, 0xf7, 0x7f, + 0x06, 0x00, 0x00, 0xff, 0xff, 0x8c, 0xab, 0xc6, 0xc8, 0xe6, 0x09, 0x00, 0x00, +} diff --git a/streams/proto/streams.pb.micro.go b/threads/proto/threads.pb.micro.go similarity index 72% rename from streams/proto/streams.pb.micro.go rename to threads/proto/threads.pb.micro.go index f78bb41..9ba22b8 100644 --- a/streams/proto/streams.pb.micro.go +++ b/threads/proto/threads.pb.micro.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-micro. DO NOT EDIT. -// source: proto/streams.proto +// source: proto/threads.proto -package streams +package threads import ( fmt "fmt" @@ -35,15 +35,15 @@ var _ context.Context var _ client.Option var _ server.Option -// Api Endpoints for Streams service +// Api Endpoints for Threads service -func NewStreamsEndpoints() []*api.Endpoint { +func NewThreadsEndpoints() []*api.Endpoint { return []*api.Endpoint{} } -// Client API for Streams service +// Client API for Threads service -type StreamsService interface { +type ThreadsService interface { // Create a conversation CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...client.CallOption) (*CreateConversationResponse, error) // Read a conversation using its ID, can filter using group ID if provided @@ -60,25 +60,25 @@ type StreamsService interface { // offset as older messages need to be loaded ListMessages(ctx context.Context, in *ListMessagesRequest, opts ...client.CallOption) (*ListMessagesResponse, error) // RecentMessages returns the most recent messages in a group of conversations. By default the - // most messages retrieved per conversation is 10, however this can be overriden using the + // most messages retrieved per conversation is 25, however this can be overriden using the // limit_per_conversation option RecentMessages(ctx context.Context, in *RecentMessagesRequest, opts ...client.CallOption) (*RecentMessagesResponse, error) } -type streamsService struct { +type threadsService struct { c client.Client name string } -func NewStreamsService(name string, c client.Client) StreamsService { - return &streamsService{ +func NewThreadsService(name string, c client.Client) ThreadsService { + return &threadsService{ c: c, name: name, } } -func (c *streamsService) CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...client.CallOption) (*CreateConversationResponse, error) { - req := c.c.NewRequest(c.name, "Streams.CreateConversation", in) +func (c *threadsService) CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...client.CallOption) (*CreateConversationResponse, error) { + req := c.c.NewRequest(c.name, "Threads.CreateConversation", in) out := new(CreateConversationResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -87,8 +87,8 @@ func (c *streamsService) CreateConversation(ctx context.Context, in *CreateConve return out, nil } -func (c *streamsService) ReadConversation(ctx context.Context, in *ReadConversationRequest, opts ...client.CallOption) (*ReadConversationResponse, error) { - req := c.c.NewRequest(c.name, "Streams.ReadConversation", in) +func (c *threadsService) ReadConversation(ctx context.Context, in *ReadConversationRequest, opts ...client.CallOption) (*ReadConversationResponse, error) { + req := c.c.NewRequest(c.name, "Threads.ReadConversation", in) out := new(ReadConversationResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -97,8 +97,8 @@ func (c *streamsService) ReadConversation(ctx context.Context, in *ReadConversat return out, nil } -func (c *streamsService) UpdateConversation(ctx context.Context, in *UpdateConversationRequest, opts ...client.CallOption) (*UpdateConversationResponse, error) { - req := c.c.NewRequest(c.name, "Streams.UpdateConversation", in) +func (c *threadsService) UpdateConversation(ctx context.Context, in *UpdateConversationRequest, opts ...client.CallOption) (*UpdateConversationResponse, error) { + req := c.c.NewRequest(c.name, "Threads.UpdateConversation", in) out := new(UpdateConversationResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -107,8 +107,8 @@ func (c *streamsService) UpdateConversation(ctx context.Context, in *UpdateConve return out, nil } -func (c *streamsService) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, opts ...client.CallOption) (*DeleteConversationResponse, error) { - req := c.c.NewRequest(c.name, "Streams.DeleteConversation", in) +func (c *threadsService) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, opts ...client.CallOption) (*DeleteConversationResponse, error) { + req := c.c.NewRequest(c.name, "Threads.DeleteConversation", in) out := new(DeleteConversationResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -117,8 +117,8 @@ func (c *streamsService) DeleteConversation(ctx context.Context, in *DeleteConve return out, nil } -func (c *streamsService) ListConversations(ctx context.Context, in *ListConversationsRequest, opts ...client.CallOption) (*ListConversationsResponse, error) { - req := c.c.NewRequest(c.name, "Streams.ListConversations", in) +func (c *threadsService) ListConversations(ctx context.Context, in *ListConversationsRequest, opts ...client.CallOption) (*ListConversationsResponse, error) { + req := c.c.NewRequest(c.name, "Threads.ListConversations", in) out := new(ListConversationsResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -127,8 +127,8 @@ func (c *streamsService) ListConversations(ctx context.Context, in *ListConversa return out, nil } -func (c *streamsService) CreateMessage(ctx context.Context, in *CreateMessageRequest, opts ...client.CallOption) (*CreateMessageResponse, error) { - req := c.c.NewRequest(c.name, "Streams.CreateMessage", in) +func (c *threadsService) CreateMessage(ctx context.Context, in *CreateMessageRequest, opts ...client.CallOption) (*CreateMessageResponse, error) { + req := c.c.NewRequest(c.name, "Threads.CreateMessage", in) out := new(CreateMessageResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -137,8 +137,8 @@ func (c *streamsService) CreateMessage(ctx context.Context, in *CreateMessageReq return out, nil } -func (c *streamsService) ListMessages(ctx context.Context, in *ListMessagesRequest, opts ...client.CallOption) (*ListMessagesResponse, error) { - req := c.c.NewRequest(c.name, "Streams.ListMessages", in) +func (c *threadsService) ListMessages(ctx context.Context, in *ListMessagesRequest, opts ...client.CallOption) (*ListMessagesResponse, error) { + req := c.c.NewRequest(c.name, "Threads.ListMessages", in) out := new(ListMessagesResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -147,8 +147,8 @@ func (c *streamsService) ListMessages(ctx context.Context, in *ListMessagesReque return out, nil } -func (c *streamsService) RecentMessages(ctx context.Context, in *RecentMessagesRequest, opts ...client.CallOption) (*RecentMessagesResponse, error) { - req := c.c.NewRequest(c.name, "Streams.RecentMessages", in) +func (c *threadsService) RecentMessages(ctx context.Context, in *RecentMessagesRequest, opts ...client.CallOption) (*RecentMessagesResponse, error) { + req := c.c.NewRequest(c.name, "Threads.RecentMessages", in) out := new(RecentMessagesResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -157,9 +157,9 @@ func (c *streamsService) RecentMessages(ctx context.Context, in *RecentMessagesR return out, nil } -// Server API for Streams service +// Server API for Threads service -type StreamsHandler interface { +type ThreadsHandler interface { // Create a conversation CreateConversation(context.Context, *CreateConversationRequest, *CreateConversationResponse) error // Read a conversation using its ID, can filter using group ID if provided @@ -176,13 +176,13 @@ type StreamsHandler interface { // offset as older messages need to be loaded ListMessages(context.Context, *ListMessagesRequest, *ListMessagesResponse) error // RecentMessages returns the most recent messages in a group of conversations. By default the - // most messages retrieved per conversation is 10, however this can be overriden using the + // most messages retrieved per conversation is 25, however this can be overriden using the // limit_per_conversation option RecentMessages(context.Context, *RecentMessagesRequest, *RecentMessagesResponse) error } -func RegisterStreamsHandler(s server.Server, hdlr StreamsHandler, opts ...server.HandlerOption) error { - type streams interface { +func RegisterThreadsHandler(s server.Server, hdlr ThreadsHandler, opts ...server.HandlerOption) error { + type threads interface { CreateConversation(ctx context.Context, in *CreateConversationRequest, out *CreateConversationResponse) error ReadConversation(ctx context.Context, in *ReadConversationRequest, out *ReadConversationResponse) error UpdateConversation(ctx context.Context, in *UpdateConversationRequest, out *UpdateConversationResponse) error @@ -192,45 +192,45 @@ func RegisterStreamsHandler(s server.Server, hdlr StreamsHandler, opts ...server ListMessages(ctx context.Context, in *ListMessagesRequest, out *ListMessagesResponse) error RecentMessages(ctx context.Context, in *RecentMessagesRequest, out *RecentMessagesResponse) error } - type Streams struct { - streams + type Threads struct { + threads } - h := &streamsHandler{hdlr} - return s.Handle(s.NewHandler(&Streams{h}, opts...)) + h := &threadsHandler{hdlr} + return s.Handle(s.NewHandler(&Threads{h}, opts...)) } -type streamsHandler struct { - StreamsHandler +type threadsHandler struct { + ThreadsHandler } -func (h *streamsHandler) CreateConversation(ctx context.Context, in *CreateConversationRequest, out *CreateConversationResponse) error { - return h.StreamsHandler.CreateConversation(ctx, in, out) +func (h *threadsHandler) CreateConversation(ctx context.Context, in *CreateConversationRequest, out *CreateConversationResponse) error { + return h.ThreadsHandler.CreateConversation(ctx, in, out) } -func (h *streamsHandler) ReadConversation(ctx context.Context, in *ReadConversationRequest, out *ReadConversationResponse) error { - return h.StreamsHandler.ReadConversation(ctx, in, out) +func (h *threadsHandler) ReadConversation(ctx context.Context, in *ReadConversationRequest, out *ReadConversationResponse) error { + return h.ThreadsHandler.ReadConversation(ctx, in, out) } -func (h *streamsHandler) UpdateConversation(ctx context.Context, in *UpdateConversationRequest, out *UpdateConversationResponse) error { - return h.StreamsHandler.UpdateConversation(ctx, in, out) +func (h *threadsHandler) UpdateConversation(ctx context.Context, in *UpdateConversationRequest, out *UpdateConversationResponse) error { + return h.ThreadsHandler.UpdateConversation(ctx, in, out) } -func (h *streamsHandler) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, out *DeleteConversationResponse) error { - return h.StreamsHandler.DeleteConversation(ctx, in, out) +func (h *threadsHandler) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, out *DeleteConversationResponse) error { + return h.ThreadsHandler.DeleteConversation(ctx, in, out) } -func (h *streamsHandler) ListConversations(ctx context.Context, in *ListConversationsRequest, out *ListConversationsResponse) error { - return h.StreamsHandler.ListConversations(ctx, in, out) +func (h *threadsHandler) ListConversations(ctx context.Context, in *ListConversationsRequest, out *ListConversationsResponse) error { + return h.ThreadsHandler.ListConversations(ctx, in, out) } -func (h *streamsHandler) CreateMessage(ctx context.Context, in *CreateMessageRequest, out *CreateMessageResponse) error { - return h.StreamsHandler.CreateMessage(ctx, in, out) +func (h *threadsHandler) CreateMessage(ctx context.Context, in *CreateMessageRequest, out *CreateMessageResponse) error { + return h.ThreadsHandler.CreateMessage(ctx, in, out) } -func (h *streamsHandler) ListMessages(ctx context.Context, in *ListMessagesRequest, out *ListMessagesResponse) error { - return h.StreamsHandler.ListMessages(ctx, in, out) +func (h *threadsHandler) ListMessages(ctx context.Context, in *ListMessagesRequest, out *ListMessagesResponse) error { + return h.ThreadsHandler.ListMessages(ctx, in, out) } -func (h *streamsHandler) RecentMessages(ctx context.Context, in *RecentMessagesRequest, out *RecentMessagesResponse) error { - return h.StreamsHandler.RecentMessages(ctx, in, out) +func (h *threadsHandler) RecentMessages(ctx context.Context, in *RecentMessagesRequest, out *RecentMessagesResponse) error { + return h.ThreadsHandler.RecentMessages(ctx, in, out) } diff --git a/streams/proto/streams.proto b/threads/proto/threads.proto similarity index 97% rename from streams/proto/streams.proto rename to threads/proto/threads.proto index d76069d..ffde7e0 100644 --- a/streams/proto/streams.proto +++ b/threads/proto/threads.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package streams; -option go_package = "proto;streams"; +package threads; +option go_package = "proto;threads"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; -service Streams { +service Threads { // Create a conversation rpc CreateConversation(CreateConversationRequest) returns (CreateConversationResponse); // Read a conversation using its ID, can filter using group ID if provided @@ -110,4 +110,4 @@ message RecentMessagesRequest { message RecentMessagesResponse { repeated Message messages = 1; -} \ No newline at end of file +}