Documentation ¶
Index ¶
- Variables
- func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer)
- type ChatClient
- type ChatMessage
- func (*ChatMessage) Descriptor() ([]byte, []int)deprecated
- func (x *ChatMessage) GetRoomName() string
- func (x *ChatMessage) GetText() string
- func (x *ChatMessage) GetType() ChatMessageType
- func (x *ChatMessage) GetUserName() string
- func (*ChatMessage) ProtoMessage()
- func (x *ChatMessage) ProtoReflect() protoreflect.Message
- func (x *ChatMessage) Reset()
- func (x *ChatMessage) String() string
- type ChatMessageType
- func (ChatMessageType) Descriptor() protoreflect.EnumDescriptor
- func (x ChatMessageType) Enum() *ChatMessageType
- func (ChatMessageType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ChatMessageType) Number() protoreflect.EnumNumber
- func (x ChatMessageType) String() string
- func (ChatMessageType) Type() protoreflect.EnumType
- type ChatServer
- type Chat_ChatClient
- type Chat_ChatServer
- type Room
- type Rooms
- type UnimplementedChatServer
- type UnsafeChatServer
Constants ¶
This section is empty.
Variables ¶
var ( ChatMessageType_name = map[int32]string{ 0: "JOIN", 1: "SEND", } ChatMessageType_value = map[string]int32{ "JOIN": 0, "SEND": 1, } )
Enum value maps for ChatMessageType.
var Chat_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.Chat", HandlerType: (*ChatServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetRooms", Handler: _Chat_GetRooms_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Chat", Handler: _Chat_Chat_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "pb/chat.proto", }
Chat_ServiceDesc is the grpc.ServiceDesc for Chat service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_pb_chat_proto protoreflect.FileDescriptor
Functions ¶
func RegisterChatServer ¶
func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer)
Types ¶
type ChatClient ¶
type ChatClient interface { GetRooms(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Rooms, error) Chat(ctx context.Context, opts ...grpc.CallOption) (Chat_ChatClient, error) }
ChatClient is the client API for Chat 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 NewChatClient ¶
func NewChatClient(cc grpc.ClientConnInterface) ChatClient
type ChatMessage ¶
type ChatMessage struct { Type ChatMessageType `protobuf:"varint,1,opt,name=type,proto3,enum=pb.ChatMessageType" json:"type,omitempty"` RoomName string `protobuf:"bytes,2,opt,name=roomName,proto3" json:"roomName,omitempty"` UserName string `protobuf:"bytes,3,opt,name=userName,proto3" json:"userName,omitempty"` Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` // contains filtered or unexported fields }
func (*ChatMessage) Descriptor
deprecated
func (*ChatMessage) Descriptor() ([]byte, []int)
Deprecated: Use ChatMessage.ProtoReflect.Descriptor instead.
func (*ChatMessage) GetRoomName ¶
func (x *ChatMessage) GetRoomName() string
func (*ChatMessage) GetText ¶
func (x *ChatMessage) GetText() string
func (*ChatMessage) GetType ¶
func (x *ChatMessage) GetType() ChatMessageType
func (*ChatMessage) GetUserName ¶
func (x *ChatMessage) GetUserName() string
func (*ChatMessage) ProtoMessage ¶
func (*ChatMessage) ProtoMessage()
func (*ChatMessage) ProtoReflect ¶
func (x *ChatMessage) ProtoReflect() protoreflect.Message
func (*ChatMessage) Reset ¶
func (x *ChatMessage) Reset()
func (*ChatMessage) String ¶
func (x *ChatMessage) String() string
type ChatMessageType ¶
type ChatMessageType int32
const ( ChatMessageType_JOIN ChatMessageType = 0 ChatMessageType_SEND ChatMessageType = 1 )
func (ChatMessageType) Descriptor ¶
func (ChatMessageType) Descriptor() protoreflect.EnumDescriptor
func (ChatMessageType) Enum ¶
func (x ChatMessageType) Enum() *ChatMessageType
func (ChatMessageType) EnumDescriptor
deprecated
func (ChatMessageType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ChatMessageType.Descriptor instead.
func (ChatMessageType) Number ¶
func (x ChatMessageType) Number() protoreflect.EnumNumber
func (ChatMessageType) String ¶
func (x ChatMessageType) String() string
func (ChatMessageType) Type ¶
func (ChatMessageType) Type() protoreflect.EnumType
type ChatServer ¶
type ChatServer interface { GetRooms(context.Context, *empty.Empty) (*Rooms, error) Chat(Chat_ChatServer) error // contains filtered or unexported methods }
ChatServer is the server API for Chat service. All implementations must embed UnimplementedChatServer for forward compatibility
type Chat_ChatClient ¶
type Chat_ChatClient interface { Send(*ChatMessage) error Recv() (*ChatMessage, error) grpc.ClientStream }
type Chat_ChatServer ¶
type Chat_ChatServer interface { Send(*ChatMessage) error Recv() (*ChatMessage, error) grpc.ServerStream }
type Room ¶
type Room struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Room) Descriptor
deprecated
func (*Room) ProtoMessage ¶
func (*Room) ProtoMessage()
func (*Room) ProtoReflect ¶
func (x *Room) ProtoReflect() protoreflect.Message
type Rooms ¶
type Rooms struct { Rooms []*Room `protobuf:"bytes,1,rep,name=rooms,proto3" json:"rooms,omitempty"` // contains filtered or unexported fields }
func (*Rooms) Descriptor
deprecated
func (*Rooms) ProtoMessage ¶
func (*Rooms) ProtoMessage()
func (*Rooms) ProtoReflect ¶
func (x *Rooms) ProtoReflect() protoreflect.Message
type UnimplementedChatServer ¶
type UnimplementedChatServer struct { }
UnimplementedChatServer must be embedded to have forward compatible implementations.
func (UnimplementedChatServer) Chat ¶
func (UnimplementedChatServer) Chat(Chat_ChatServer) error
type UnsafeChatServer ¶
type UnsafeChatServer interface {
// contains filtered or unexported methods
}
UnsafeChatServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChatServer will result in compilation errors.