Documentation ¶
Index ¶
- Variables
- func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer)
- type ChatServiceClient
- type ChatServiceServer
- type ChatService_OpenConnectionClient
- type ChatService_OpenConnectionServer
- type Close
- type Connect
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetBody() string
- func (x *Message) GetTimestamp() int32
- func (x *Message) GetUser() *User
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type UnimplementedChatServiceServer
- func (UnimplementedChatServiceServer) Broadcast(context.Context, *Message) (*Close, error)
- func (UnimplementedChatServiceServer) CloseConnection(context.Context, *User) (*Close, error)
- func (UnimplementedChatServiceServer) OpenConnection(*Connect, ChatService_OpenConnectionServer) error
- func (UnimplementedChatServiceServer) Publish(context.Context, *Message) (*Message, error)
- type UnsafeChatServiceServer
- type User
Constants ¶
This section is empty.
Variables ¶
var ChatService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "chat.ChatService", HandlerType: (*ChatServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CloseConnection", Handler: _ChatService_CloseConnection_Handler, }, { MethodName: "Publish", Handler: _ChatService_Publish_Handler, }, { MethodName: "Broadcast", Handler: _ChatService_Broadcast_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "OpenConnection", Handler: _ChatService_OpenConnection_Handler, ServerStreams: true, }, }, Metadata: "Message.proto", }
ChatService_ServiceDesc is the grpc.ServiceDesc for ChatService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_Message_proto protoreflect.FileDescriptor
Functions ¶
func RegisterChatServiceServer ¶
func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer)
Types ¶
type ChatServiceClient ¶
type ChatServiceClient interface { OpenConnection(ctx context.Context, in *Connect, opts ...grpc.CallOption) (ChatService_OpenConnectionClient, error) CloseConnection(ctx context.Context, in *User, opts ...grpc.CallOption) (*Close, error) Publish(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) Broadcast(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Close, error) }
ChatServiceClient is the client API for ChatService 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 NewChatServiceClient ¶
func NewChatServiceClient(cc grpc.ClientConnInterface) ChatServiceClient
type ChatServiceServer ¶
type ChatServiceServer interface { OpenConnection(*Connect, ChatService_OpenConnectionServer) error CloseConnection(context.Context, *User) (*Close, error) Publish(context.Context, *Message) (*Message, error) Broadcast(context.Context, *Message) (*Close, error) // contains filtered or unexported methods }
ChatServiceServer is the server API for ChatService service. All implementations must embed UnimplementedChatServiceServer for forward compatibility
type ChatService_OpenConnectionClient ¶
type ChatService_OpenConnectionClient interface { Recv() (*Message, error) grpc.ClientStream }
type ChatService_OpenConnectionServer ¶
type ChatService_OpenConnectionServer interface { Send(*Message) error grpc.ServerStream }
type Close ¶
type Close struct {
// contains filtered or unexported fields
}
func (*Close) Descriptor
deprecated
func (*Close) ProtoMessage ¶
func (*Close) ProtoMessage()
func (*Close) ProtoReflect ¶
func (x *Close) ProtoReflect() protoreflect.Message
type Connect ¶
type Connect struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Active bool `protobuf:"varint,2,opt,name=active,proto3" json:"active,omitempty"` // contains filtered or unexported fields }
func (*Connect) Descriptor
deprecated
func (*Connect) ProtoMessage ¶
func (*Connect) ProtoMessage()
func (*Connect) ProtoReflect ¶
func (x *Connect) ProtoReflect() protoreflect.Message
type Message ¶
type Message struct { Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` Timestamp int32 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetTimestamp ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type UnimplementedChatServiceServer ¶
type UnimplementedChatServiceServer struct { }
UnimplementedChatServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedChatServiceServer) CloseConnection ¶
func (UnimplementedChatServiceServer) OpenConnection ¶
func (UnimplementedChatServiceServer) OpenConnection(*Connect, ChatService_OpenConnectionServer) error
type UnsafeChatServiceServer ¶
type UnsafeChatServiceServer interface {
// contains filtered or unexported methods
}
UnsafeChatServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChatServiceServer will result in compilation errors.
type User ¶
type User struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Timestamp int32 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetTimestamp ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message