Documentation ¶
Index ¶
- Variables
- func RegisterIMServer(s grpc.ServiceRegistrar, srv IMServer)
- type CreateMessageRequest
- func (*CreateMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateMessageRequest) GetFrom() string
- func (x *CreateMessageRequest) GetMessage() string
- func (*CreateMessageRequest) ProtoMessage()
- func (x *CreateMessageRequest) ProtoReflect() protoreflect.Message
- func (x *CreateMessageRequest) Reset()
- func (x *CreateMessageRequest) String() string
- type CreateMessageResponse
- func (*CreateMessageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateMessageResponse) GetMessage() *Message
- func (*CreateMessageResponse) ProtoMessage()
- func (x *CreateMessageResponse) ProtoReflect() protoreflect.Message
- func (x *CreateMessageResponse) Reset()
- func (x *CreateMessageResponse) String() string
- type GetMessageStreamResponse
- func (*GetMessageStreamResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetMessageStreamResponse) GetMessage() *Message
- func (*GetMessageStreamResponse) ProtoMessage()
- func (x *GetMessageStreamResponse) ProtoReflect() protoreflect.Message
- func (x *GetMessageStreamResponse) Reset()
- func (x *GetMessageStreamResponse) String() string
- type IMClient
- type IMServer
- type IM_GetMessageStreamClient
- type IM_GetMessageStreamServer
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetCreatedAt() *timestamppb.Timestamp
- func (x *Message) GetFrom() string
- func (x *Message) GetMessage() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type UnimplementedIMServer
- type UnsafeIMServer
Constants ¶
This section is empty.
Variables ¶
var File_message_proto protoreflect.FileDescriptor
var File_rpc_create_message_proto protoreflect.FileDescriptor
var File_rpc_get_message_proto protoreflect.FileDescriptor
var File_service_im_proto protoreflect.FileDescriptor
var IM_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.IM", HandlerType: (*IMServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateMessage", Handler: _IM_CreateMessage_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GetMessageStream", Handler: _IM_GetMessageStream_Handler, ServerStreams: true, }, }, Metadata: "service_im.proto", }
IM_ServiceDesc is the grpc.ServiceDesc for IM service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterIMServer ¶
func RegisterIMServer(s grpc.ServiceRegistrar, srv IMServer)
Types ¶
type CreateMessageRequest ¶
type CreateMessageRequest struct { From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*CreateMessageRequest) Descriptor
deprecated
func (*CreateMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateMessageRequest.ProtoReflect.Descriptor instead.
func (*CreateMessageRequest) GetFrom ¶
func (x *CreateMessageRequest) GetFrom() string
func (*CreateMessageRequest) GetMessage ¶
func (x *CreateMessageRequest) GetMessage() string
func (*CreateMessageRequest) ProtoMessage ¶
func (*CreateMessageRequest) ProtoMessage()
func (*CreateMessageRequest) ProtoReflect ¶
func (x *CreateMessageRequest) ProtoReflect() protoreflect.Message
func (*CreateMessageRequest) Reset ¶
func (x *CreateMessageRequest) Reset()
func (*CreateMessageRequest) String ¶
func (x *CreateMessageRequest) String() string
type CreateMessageResponse ¶
type CreateMessageResponse struct { Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*CreateMessageResponse) Descriptor
deprecated
func (*CreateMessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateMessageResponse.ProtoReflect.Descriptor instead.
func (*CreateMessageResponse) GetMessage ¶
func (x *CreateMessageResponse) GetMessage() *Message
func (*CreateMessageResponse) ProtoMessage ¶
func (*CreateMessageResponse) ProtoMessage()
func (*CreateMessageResponse) ProtoReflect ¶
func (x *CreateMessageResponse) ProtoReflect() protoreflect.Message
func (*CreateMessageResponse) Reset ¶
func (x *CreateMessageResponse) Reset()
func (*CreateMessageResponse) String ¶
func (x *CreateMessageResponse) String() string
type GetMessageStreamResponse ¶
type GetMessageStreamResponse struct { Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*GetMessageStreamResponse) Descriptor
deprecated
func (*GetMessageStreamResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetMessageStreamResponse.ProtoReflect.Descriptor instead.
func (*GetMessageStreamResponse) GetMessage ¶
func (x *GetMessageStreamResponse) GetMessage() *Message
func (*GetMessageStreamResponse) ProtoMessage ¶
func (*GetMessageStreamResponse) ProtoMessage()
func (*GetMessageStreamResponse) ProtoReflect ¶
func (x *GetMessageStreamResponse) ProtoReflect() protoreflect.Message
func (*GetMessageStreamResponse) Reset ¶
func (x *GetMessageStreamResponse) Reset()
func (*GetMessageStreamResponse) String ¶
func (x *GetMessageStreamResponse) String() string
type IMClient ¶
type IMClient interface { GetMessageStream(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (IM_GetMessageStreamClient, error) CreateMessage(ctx context.Context, in *CreateMessageRequest, opts ...grpc.CallOption) (*CreateMessageResponse, error) }
IMClient is the client API for IM service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewIMClient ¶
func NewIMClient(cc grpc.ClientConnInterface) IMClient
type IMServer ¶
type IMServer interface { GetMessageStream(*emptypb.Empty, IM_GetMessageStreamServer) error CreateMessage(context.Context, *CreateMessageRequest) (*CreateMessageResponse, error) // contains filtered or unexported methods }
IMServer is the server API for IM service. All implementations must embed UnimplementedIMServer for forward compatibility
type IM_GetMessageStreamClient ¶
type IM_GetMessageStreamClient interface { Recv() (*GetMessageStreamResponse, error) grpc.ClientStream }
type IM_GetMessageStreamServer ¶
type IM_GetMessageStreamServer interface { Send(*GetMessageStreamResponse) error grpc.ServerStream }
type Message ¶
type Message struct { From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetCreatedAt ¶
func (x *Message) GetCreatedAt() *timestamppb.Timestamp
func (*Message) GetMessage ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type UnimplementedIMServer ¶
type UnimplementedIMServer struct { }
UnimplementedIMServer must be embedded to have forward compatible implementations.
func (UnimplementedIMServer) CreateMessage ¶
func (UnimplementedIMServer) CreateMessage(context.Context, *CreateMessageRequest) (*CreateMessageResponse, error)
func (UnimplementedIMServer) GetMessageStream ¶
func (UnimplementedIMServer) GetMessageStream(*emptypb.Empty, IM_GetMessageStreamServer) error
type UnsafeIMServer ¶
type UnsafeIMServer interface {
// contains filtered or unexported methods
}
UnsafeIMServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IMServer will result in compilation errors.