Documentation ¶
Overview ¶
Package chatpb is a generated protocol buffer package.
It is generated from these files:
chat.proto
It has these top-level messages:
Conversation Message ActionEvent TypingMessage CreateConversationRequest CreateConversationResponse GetConversationsRequest GetConversationsResponse LeaveConversationRequest MemberRequest ChatMessage GetHistoryRequest GetHistoryResponse ReadHistoryRequest
Index ¶
- Variables
- func RegisterConversationServiceServer(s *grpc.Server, srv ConversationServiceServer)
- func RegisterMessageServiceServer(s *grpc.Server, srv MessageServiceServer)
- type ActionEvent
- type ActionEvent_EventType
- type ChatMessage
- func (*ChatMessage) Descriptor() ([]byte, []int)
- func (m *ChatMessage) GetContent() isChatMessage_Content
- func (m *ChatMessage) GetMessage() *Message
- func (m *ChatMessage) GetTyping() *TypingMessage
- func (*ChatMessage) ProtoMessage()
- func (m *ChatMessage) Reset()
- func (m *ChatMessage) String() string
- func (*ChatMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type ChatMessage_Message
- type ChatMessage_Typing
- type Conversation
- type ConversationServiceClient
- type ConversationServiceServer
- type Conversation_ConversationType
- type CreateConversationRequest
- type CreateConversationResponse
- type GetConversationsRequest
- type GetConversationsResponse
- type GetHistoryRequest
- type GetHistoryResponse
- type LeaveConversationRequest
- type MemberRequest
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetAudio() []byte
- func (m *Message) GetContent() isMessage_Content
- func (m *Message) GetCreationTime() *google_protobuf1.Timestamp
- func (m *Message) GetDeliveryTime() *google_protobuf1.Timestamp
- func (m *Message) GetEvent() *ActionEvent
- func (m *Message) GetImage() []byte
- func (m *Message) GetText() string
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) String() string
- func (*Message) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type MessageServiceClient
- type MessageServiceServer
- type MessageService_ComunicateClient
- type MessageService_ComunicateServer
- type Message_Audio
- type Message_Event
- type Message_Image
- type Message_Text
- type ReadHistoryRequest
- type TypingMessage
- type TypingMessage_ActionType
Constants ¶
This section is empty.
Variables ¶
View Source
var ActionEvent_EventType_name = map[int32]string{
0: "CREATED_GROUP",
1: "UPDATED_GROUP",
2: "JOIN_GROUP",
3: "LEAVE_GROUP",
4: "ADD_MEMBER",
5: "REMOVE_MEMBER",
6: "EDIT_TITLE",
}
View Source
var ActionEvent_EventType_value = map[string]int32{
"CREATED_GROUP": 0,
"UPDATED_GROUP": 1,
"JOIN_GROUP": 2,
"LEAVE_GROUP": 3,
"ADD_MEMBER": 4,
"REMOVE_MEMBER": 5,
"EDIT_TITLE": 6,
}
View Source
var Conversation_ConversationType_name = map[int32]string{
0: "INDIVIDUAL",
1: "GROUP",
}
View Source
var Conversation_ConversationType_value = map[string]int32{
"INDIVIDUAL": 0,
"GROUP": 1,
}
View Source
var TypingMessage_ActionType_name = map[int32]string{
0: "CANCEL_TYPING",
1: "TYPING",
2: "RECORDING_AUDIO",
3: "UPLOADING_AUDIO",
4: "UPLOADING_PHOTO",
}
View Source
var TypingMessage_ActionType_value = map[string]int32{
"CANCEL_TYPING": 0,
"TYPING": 1,
"RECORDING_AUDIO": 2,
"UPLOADING_AUDIO": 3,
"UPLOADING_PHOTO": 4,
}
Functions ¶
func RegisterConversationServiceServer ¶
func RegisterConversationServiceServer(s *grpc.Server, srv ConversationServiceServer)
func RegisterMessageServiceServer ¶
func RegisterMessageServiceServer(s *grpc.Server, srv MessageServiceServer)
Types ¶
type ActionEvent ¶
type ActionEvent struct { Event ActionEvent_EventType `protobuf:"varint,1,opt,name=event,enum=chatpb.ActionEvent_EventType" json:"event,omitempty"` // Extra key:value data to provide more context to events // this will vary by EventType // example: `{ "oldTitle": "Foo", "newTitle":"Bar" }` ExtraParams map[string]string `` /* 161-byte string literal not displayed */ }
func (*ActionEvent) Descriptor ¶
func (*ActionEvent) Descriptor() ([]byte, []int)
func (*ActionEvent) GetExtraParams ¶
func (m *ActionEvent) GetExtraParams() map[string]string
func (*ActionEvent) ProtoMessage ¶
func (*ActionEvent) ProtoMessage()
func (*ActionEvent) Reset ¶
func (m *ActionEvent) Reset()
func (*ActionEvent) String ¶
func (m *ActionEvent) String() string
type ActionEvent_EventType ¶
type ActionEvent_EventType int32
const ( ActionEvent_CREATED_GROUP ActionEvent_EventType = 0 ActionEvent_UPDATED_GROUP ActionEvent_EventType = 1 ActionEvent_JOIN_GROUP ActionEvent_EventType = 2 ActionEvent_LEAVE_GROUP ActionEvent_EventType = 3 ActionEvent_ADD_MEMBER ActionEvent_EventType = 4 ActionEvent_REMOVE_MEMBER ActionEvent_EventType = 5 ActionEvent_EDIT_TITLE ActionEvent_EventType = 6 )
func (ActionEvent_EventType) EnumDescriptor ¶
func (ActionEvent_EventType) EnumDescriptor() ([]byte, []int)
func (ActionEvent_EventType) String ¶
func (x ActionEvent_EventType) String() string
type ChatMessage ¶
type ChatMessage struct { ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId" json:"conversation_id,omitempty"` // Types that are valid to be assigned to Content: // *ChatMessage_Typing // *ChatMessage_Message Content isChatMessage_Content `protobuf_oneof:"content"` }
func (*ChatMessage) Descriptor ¶
func (*ChatMessage) Descriptor() ([]byte, []int)
func (*ChatMessage) GetContent ¶
func (m *ChatMessage) GetContent() isChatMessage_Content
func (*ChatMessage) GetMessage ¶
func (m *ChatMessage) GetMessage() *Message
func (*ChatMessage) GetTyping ¶
func (m *ChatMessage) GetTyping() *TypingMessage
func (*ChatMessage) ProtoMessage ¶
func (*ChatMessage) ProtoMessage()
func (*ChatMessage) Reset ¶
func (m *ChatMessage) Reset()
func (*ChatMessage) String ¶
func (m *ChatMessage) String() string
func (*ChatMessage) XXX_OneofFuncs ¶
func (*ChatMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
type ChatMessage_Message ¶
type ChatMessage_Message struct {
Message *Message `protobuf:"bytes,3,opt,name=message,oneof"`
}
type ChatMessage_Typing ¶
type ChatMessage_Typing struct {
Typing *TypingMessage `protobuf:"bytes,2,opt,name=typing,oneof"`
}
type Conversation ¶
type Conversation struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` Type Conversation_ConversationType `protobuf:"varint,3,opt,name=type,enum=chatpb.Conversation_ConversationType" json:"type,omitempty"` // Collection with member ids MemberIds []string `protobuf:"bytes,4,rep,name=member_ids,json=memberIds" json:"member_ids,omitempty"` Image []byte `protobuf:"bytes,5,opt,name=image,proto3" json:"image,omitempty"` CreationTime *google_protobuf1.Timestamp `protobuf:"bytes,20,opt,name=creation_time,json=creationTime" json:"creation_time,omitempty"` // Last update time (changes on conversations or last message time sent) UpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,21,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` }
func (*Conversation) Descriptor ¶
func (*Conversation) Descriptor() ([]byte, []int)
func (*Conversation) GetCreationTime ¶
func (m *Conversation) GetCreationTime() *google_protobuf1.Timestamp
func (*Conversation) GetUpdateTime ¶
func (m *Conversation) GetUpdateTime() *google_protobuf1.Timestamp
func (*Conversation) ProtoMessage ¶
func (*Conversation) ProtoMessage()
func (*Conversation) Reset ¶
func (m *Conversation) Reset()
func (*Conversation) String ¶
func (m *Conversation) String() string
type ConversationServiceClient ¶
type ConversationServiceClient interface { // Return conversations ordered by last update date Get(ctx context.Context, in *GetConversationsRequest, opts ...grpc.CallOption) (*GetConversationsResponse, error) Create(ctx context.Context, in *CreateConversationRequest, opts ...grpc.CallOption) (*CreateConversationResponse, error) Leave(ctx context.Context, in *LeaveConversationRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) AddMember(ctx context.Context, in *MemberRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) RemoveMember(ctx context.Context, in *MemberRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) }
func NewConversationServiceClient ¶
func NewConversationServiceClient(cc *grpc.ClientConn) ConversationServiceClient
type ConversationServiceServer ¶
type ConversationServiceServer interface { // Return conversations ordered by last update date Get(context.Context, *GetConversationsRequest) (*GetConversationsResponse, error) Create(context.Context, *CreateConversationRequest) (*CreateConversationResponse, error) Leave(context.Context, *LeaveConversationRequest) (*google_protobuf.Empty, error) AddMember(context.Context, *MemberRequest) (*google_protobuf.Empty, error) RemoveMember(context.Context, *MemberRequest) (*google_protobuf.Empty, error) }
type Conversation_ConversationType ¶
type Conversation_ConversationType int32
const ( Conversation_INDIVIDUAL Conversation_ConversationType = 0 Conversation_GROUP Conversation_ConversationType = 1 )
func (Conversation_ConversationType) EnumDescriptor ¶
func (Conversation_ConversationType) EnumDescriptor() ([]byte, []int)
func (Conversation_ConversationType) String ¶
func (x Conversation_ConversationType) String() string
type CreateConversationRequest ¶
type CreateConversationRequest struct { Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` Type Conversation_ConversationType `protobuf:"varint,2,opt,name=type,enum=chatpb.Conversation_ConversationType" json:"type,omitempty"` MemberIds []string `protobuf:"bytes,3,rep,name=member_ids,json=memberIds" json:"member_ids,omitempty"` Image []byte `protobuf:"bytes,4,opt,name=image,proto3" json:"image,omitempty"` }
func (*CreateConversationRequest) Descriptor ¶
func (*CreateConversationRequest) Descriptor() ([]byte, []int)
func (*CreateConversationRequest) ProtoMessage ¶
func (*CreateConversationRequest) ProtoMessage()
func (*CreateConversationRequest) Reset ¶
func (m *CreateConversationRequest) Reset()
func (*CreateConversationRequest) String ¶
func (m *CreateConversationRequest) String() string
type CreateConversationResponse ¶
type CreateConversationResponse struct {
Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation" json:"conversation,omitempty"`
}
func (*CreateConversationResponse) Descriptor ¶
func (*CreateConversationResponse) Descriptor() ([]byte, []int)
func (*CreateConversationResponse) GetConversation ¶
func (m *CreateConversationResponse) GetConversation() *Conversation
func (*CreateConversationResponse) ProtoMessage ¶
func (*CreateConversationResponse) ProtoMessage()
func (*CreateConversationResponse) Reset ¶
func (m *CreateConversationResponse) Reset()
func (*CreateConversationResponse) String ¶
func (m *CreateConversationResponse) String() string
type GetConversationsRequest ¶
type GetConversationsRequest struct { Limit int32 `protobuf:"varint,1,opt,name=limit" json:"limit,omitempty"` Offset int32 `protobuf:"varint,2,opt,name=offset" json:"offset,omitempty"` Id []string `protobuf:"bytes,3,rep,name=id" json:"id,omitempty"` }
func (*GetConversationsRequest) Descriptor ¶
func (*GetConversationsRequest) Descriptor() ([]byte, []int)
func (*GetConversationsRequest) ProtoMessage ¶
func (*GetConversationsRequest) ProtoMessage()
func (*GetConversationsRequest) Reset ¶
func (m *GetConversationsRequest) Reset()
func (*GetConversationsRequest) String ¶
func (m *GetConversationsRequest) String() string
type GetConversationsResponse ¶
type GetConversationsResponse struct {
Conversations []*Conversation `protobuf:"bytes,1,rep,name=conversations" json:"conversations,omitempty"`
}
func (*GetConversationsResponse) Descriptor ¶
func (*GetConversationsResponse) Descriptor() ([]byte, []int)
func (*GetConversationsResponse) GetConversations ¶
func (m *GetConversationsResponse) GetConversations() []*Conversation
func (*GetConversationsResponse) ProtoMessage ¶
func (*GetConversationsResponse) ProtoMessage()
func (*GetConversationsResponse) Reset ¶
func (m *GetConversationsResponse) Reset()
func (*GetConversationsResponse) String ¶
func (m *GetConversationsResponse) String() string
type GetHistoryRequest ¶
type GetHistoryRequest struct { Limit int32 `protobuf:"varint,1,opt,name=limit" json:"limit,omitempty"` Offset int32 `protobuf:"varint,2,opt,name=offset" json:"offset,omitempty"` ConversationId string `protobuf:"bytes,3,opt,name=conversation_id,json=conversationId" json:"conversation_id,omitempty"` }
func (*GetHistoryRequest) Descriptor ¶
func (*GetHistoryRequest) Descriptor() ([]byte, []int)
func (*GetHistoryRequest) ProtoMessage ¶
func (*GetHistoryRequest) ProtoMessage()
func (*GetHistoryRequest) Reset ¶
func (m *GetHistoryRequest) Reset()
func (*GetHistoryRequest) String ¶
func (m *GetHistoryRequest) String() string
type GetHistoryResponse ¶
type GetHistoryResponse struct {
Messages []*Message `protobuf:"bytes,1,rep,name=messages" json:"messages,omitempty"`
}
func (*GetHistoryResponse) Descriptor ¶
func (*GetHistoryResponse) Descriptor() ([]byte, []int)
func (*GetHistoryResponse) GetMessages ¶
func (m *GetHistoryResponse) GetMessages() []*Message
func (*GetHistoryResponse) ProtoMessage ¶
func (*GetHistoryResponse) ProtoMessage()
func (*GetHistoryResponse) Reset ¶
func (m *GetHistoryResponse) Reset()
func (*GetHistoryResponse) String ¶
func (m *GetHistoryResponse) String() string
type LeaveConversationRequest ¶
type LeaveConversationRequest struct {
ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId" json:"conversation_id,omitempty"`
}
func (*LeaveConversationRequest) Descriptor ¶
func (*LeaveConversationRequest) Descriptor() ([]byte, []int)
func (*LeaveConversationRequest) ProtoMessage ¶
func (*LeaveConversationRequest) ProtoMessage()
func (*LeaveConversationRequest) Reset ¶
func (m *LeaveConversationRequest) Reset()
func (*LeaveConversationRequest) String ¶
func (m *LeaveConversationRequest) String() string
type MemberRequest ¶
type MemberRequest struct { ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId" json:"conversation_id,omitempty"` UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId" json:"user_id,omitempty"` }
func (*MemberRequest) Descriptor ¶
func (*MemberRequest) Descriptor() ([]byte, []int)
func (*MemberRequest) ProtoMessage ¶
func (*MemberRequest) ProtoMessage()
func (*MemberRequest) Reset ¶
func (m *MemberRequest) Reset()
func (*MemberRequest) String ¶
func (m *MemberRequest) String() string
type Message ¶
type Message struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` SenderId string `protobuf:"bytes,2,opt,name=sender_id,json=senderId" json:"sender_id,omitempty"` // Types that are valid to be assigned to Content: // *Message_Event // *Message_Text // *Message_Audio // *Message_Image Content isMessage_Content `protobuf_oneof:"content"` CreationTime *google_protobuf1.Timestamp `protobuf:"bytes,8,opt,name=creation_time,json=creationTime" json:"creation_time,omitempty"` DeliveryTime *google_protobuf1.Timestamp `protobuf:"bytes,9,opt,name=delivery_time,json=deliveryTime" json:"delivery_time,omitempty"` }
func (*Message) Descriptor ¶
func (*Message) GetContent ¶
func (m *Message) GetContent() isMessage_Content
func (*Message) GetCreationTime ¶
func (m *Message) GetCreationTime() *google_protobuf1.Timestamp
func (*Message) GetDeliveryTime ¶
func (m *Message) GetDeliveryTime() *google_protobuf1.Timestamp
func (*Message) GetEvent ¶
func (m *Message) GetEvent() *ActionEvent
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
type MessageServiceClient ¶
type MessageServiceClient interface { // Return the history of messages for an conversation in DESC order. GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc.CallOption) (*GetHistoryResponse, error) // Notifies the reading of messages from a channel or a user. ReadHistory(ctx context.Context, in *ReadHistoryRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) // Send and receive Messages or events to/from conversations. Comunicate(ctx context.Context, opts ...grpc.CallOption) (MessageService_ComunicateClient, error) }
func NewMessageServiceClient ¶
func NewMessageServiceClient(cc *grpc.ClientConn) MessageServiceClient
type MessageServiceServer ¶
type MessageServiceServer interface { // Return the history of messages for an conversation in DESC order. GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error) // Notifies the reading of messages from a channel or a user. ReadHistory(context.Context, *ReadHistoryRequest) (*google_protobuf.Empty, error) // Send and receive Messages or events to/from conversations. Comunicate(MessageService_ComunicateServer) error }
type MessageService_ComunicateClient ¶
type MessageService_ComunicateClient interface { Send(*ChatMessage) error Recv() (*ChatMessage, error) grpc.ClientStream }
type MessageService_ComunicateServer ¶
type MessageService_ComunicateServer interface { Send(*ChatMessage) error Recv() (*ChatMessage, error) grpc.ServerStream }
type Message_Audio ¶
type Message_Audio struct {
Audio []byte `protobuf:"bytes,6,opt,name=audio,proto3,oneof"`
}
type Message_Event ¶
type Message_Event struct {
Event *ActionEvent `protobuf:"bytes,3,opt,name=event,oneof"`
}
type Message_Image ¶
type Message_Image struct {
Image []byte `protobuf:"bytes,7,opt,name=image,proto3,oneof"`
}
type Message_Text ¶
type Message_Text struct {
Text string `protobuf:"bytes,5,opt,name=text,oneof"`
}
type ReadHistoryRequest ¶
type ReadHistoryRequest struct { LastMessageId string `protobuf:"bytes,1,opt,name=last_message_id,json=lastMessageId" json:"last_message_id,omitempty"` ConversationId string `protobuf:"bytes,2,opt,name=conversation_id,json=conversationId" json:"conversation_id,omitempty"` }
func (*ReadHistoryRequest) Descriptor ¶
func (*ReadHistoryRequest) Descriptor() ([]byte, []int)
func (*ReadHistoryRequest) ProtoMessage ¶
func (*ReadHistoryRequest) ProtoMessage()
func (*ReadHistoryRequest) Reset ¶
func (m *ReadHistoryRequest) Reset()
func (*ReadHistoryRequest) String ¶
func (m *ReadHistoryRequest) String() string
type TypingMessage ¶
type TypingMessage struct { SenderId string `protobuf:"bytes,1,opt,name=sender_id,json=senderId" json:"sender_id,omitempty"` Type TypingMessage_ActionType `protobuf:"varint,2,opt,name=type,enum=chatpb.TypingMessage_ActionType" json:"type,omitempty"` }
func (*TypingMessage) Descriptor ¶
func (*TypingMessage) Descriptor() ([]byte, []int)
func (*TypingMessage) ProtoMessage ¶
func (*TypingMessage) ProtoMessage()
func (*TypingMessage) Reset ¶
func (m *TypingMessage) Reset()
func (*TypingMessage) String ¶
func (m *TypingMessage) String() string
type TypingMessage_ActionType ¶
type TypingMessage_ActionType int32
const ( TypingMessage_CANCEL_TYPING TypingMessage_ActionType = 0 TypingMessage_TYPING TypingMessage_ActionType = 1 TypingMessage_RECORDING_AUDIO TypingMessage_ActionType = 2 TypingMessage_UPLOADING_AUDIO TypingMessage_ActionType = 3 TypingMessage_UPLOADING_PHOTO TypingMessage_ActionType = 4 )
func (TypingMessage_ActionType) EnumDescriptor ¶
func (TypingMessage_ActionType) EnumDescriptor() ([]byte, []int)
func (TypingMessage_ActionType) String ¶
func (x TypingMessage_ActionType) String() string
Click to show internal directories.
Click to hide internal directories.