Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer)
- type ChatServiceClient
- type ChatServiceServer
- type ChatService_DispatchClient
- type ChatService_DispatchServer
- type DispatchRequest
- func (*DispatchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DispatchRequest) GetMessage() *Message
- func (*DispatchRequest) ProtoMessage()
- func (x *DispatchRequest) ProtoReflect() protoreflect.Message
- func (x *DispatchRequest) Reset()
- func (x *DispatchRequest) String() string
- func (x *DispatchRequest) Verbose() string
- type DispatchResponse
- func (*DispatchResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DispatchResponse) GetMessage() *Message
- func (x *DispatchResponse) GetPayload() isDispatchResponse_Payload
- func (x *DispatchResponse) GetStatus() *status.Status
- func (*DispatchResponse) ProtoMessage()
- func (x *DispatchResponse) ProtoReflect() protoreflect.Message
- func (x *DispatchResponse) Reset()
- func (x *DispatchResponse) String() string
- func (x *DispatchResponse) Verbose() string
- type DispatchResponse_Message
- type DispatchResponse_Status
- type Header
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetHeader() *Header
- func (x *Message) GetText() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- func (x *Message) Verbose() string
- type UnimplementedChatServiceServer
- type UnsafeChatServiceServer
Constants ¶
const (
ChatService_Dispatch_FullMethodName = "/api.chat.v1.ChatService/Dispatch"
)
Variables ¶
var ChatService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.chat.v1.ChatService", HandlerType: (*ChatServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Dispatch", Handler: _ChatService_Dispatch_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "api/chat/v1/service.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_api_chat_v1_messages_proto protoreflect.FileDescriptor
var File_api_chat_v1_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterChatServiceServer ¶
func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer)
Types ¶
type ChatServiceClient ¶
type ChatServiceClient interface {
// Dispatch is used for real-time message exchange.
Dispatch(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[DispatchRequest, DispatchResponse], 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.
ChatService provides real-time communication capabilities.
func NewChatServiceClient ¶
func NewChatServiceClient(cc grpc.ClientConnInterface) ChatServiceClient
type ChatServiceServer ¶
type ChatServiceServer interface {
// Dispatch is used for real-time message exchange.
Dispatch(grpc.BidiStreamingServer[DispatchRequest, DispatchResponse]) error
// contains filtered or unexported methods
}
ChatServiceServer is the server API for ChatService service. All implementations must embed UnimplementedChatServiceServer for forward compatibility.
ChatService provides real-time communication capabilities.
type ChatService_DispatchClient ¶
type ChatService_DispatchClient = grpc.BidiStreamingClient[DispatchRequest, DispatchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ChatService_DispatchServer ¶
type ChatService_DispatchServer = grpc.BidiStreamingServer[DispatchRequest, DispatchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type DispatchRequest ¶
type DispatchRequest struct {
// The message being dispatched by the client.
Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
// contains filtered or unexported fields
}
DispatchRequest is the envelope for sending a message to the stream.
func (*DispatchRequest) Descriptor
deprecated
func (*DispatchRequest) Descriptor() ([]byte, []int)
Deprecated: Use DispatchRequest.ProtoReflect.Descriptor instead.
func (*DispatchRequest) GetMessage ¶
func (x *DispatchRequest) GetMessage() *Message
func (*DispatchRequest) ProtoMessage ¶
func (*DispatchRequest) ProtoMessage()
func (*DispatchRequest) ProtoReflect ¶
func (x *DispatchRequest) ProtoReflect() protoreflect.Message
func (*DispatchRequest) Reset ¶
func (x *DispatchRequest) Reset()
func (*DispatchRequest) String ¶
func (x *DispatchRequest) String() string
func (*DispatchRequest) Verbose ¶
func (x *DispatchRequest) Verbose() string
type DispatchResponse ¶
type DispatchResponse struct {
// The content of the envelope.
//
// Types that are valid to be assigned to Payload:
//
// *DispatchResponse_Message
// *DispatchResponse_Status
Payload isDispatchResponse_Payload `protobuf_oneof:"payload"`
// contains filtered or unexported fields
}
DispatchResponse is the envelope for receiving data from the stream.
func (*DispatchResponse) Descriptor
deprecated
func (*DispatchResponse) Descriptor() ([]byte, []int)
Deprecated: Use DispatchResponse.ProtoReflect.Descriptor instead.
func (*DispatchResponse) GetMessage ¶
func (x *DispatchResponse) GetMessage() *Message
func (*DispatchResponse) GetPayload ¶
func (x *DispatchResponse) GetPayload() isDispatchResponse_Payload
func (*DispatchResponse) GetStatus ¶
func (x *DispatchResponse) GetStatus() *status.Status
func (*DispatchResponse) ProtoMessage ¶
func (*DispatchResponse) ProtoMessage()
func (*DispatchResponse) ProtoReflect ¶
func (x *DispatchResponse) ProtoReflect() protoreflect.Message
func (*DispatchResponse) Reset ¶
func (x *DispatchResponse) Reset()
func (*DispatchResponse) String ¶
func (x *DispatchResponse) String() string
func (*DispatchResponse) Verbose ¶
func (x *DispatchResponse) Verbose() string
type DispatchResponse_Message ¶
type DispatchResponse_Message struct {
// The message being dispatched to the client.
Message *Message `protobuf:"bytes,1,opt,name=message,proto3,oneof"`
}
type DispatchResponse_Status ¶
type Header ¶
type Header struct {
// Unique string used to track a message's lifecycle chatting.
CorrelationId string `protobuf:"bytes,1,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"`
// contains filtered or unexported fields
}
Header contains metadata for request tracking and observability.
func (*Header) Descriptor
deprecated
func (*Header) GetCorrelationId ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type Message ¶
type Message struct {
// Metadata for the message.
Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
// The actual text content of the message.
Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
// contains filtered or unexported fields
}
Message represents the core data unit exchanged in a chat session.
func (*Message) Descriptor
deprecated
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.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedChatServiceServer) Dispatch ¶
func (UnimplementedChatServiceServer) Dispatch(grpc.BidiStreamingServer[DispatchRequest, DispatchResponse]) 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.