556 lines
24 KiB
Go
556 lines
24 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc (unknown)
|
|
// source: chat.proto
|
|
|
|
package l_ai_chat_proto
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
ChatService_ListTopics_FullMethodName = "/chat.ChatService/ListTopics"
|
|
ChatService_GetTopic_FullMethodName = "/chat.ChatService/GetTopic"
|
|
ChatService_CreateTopic_FullMethodName = "/chat.ChatService/CreateTopic"
|
|
ChatService_UpdateTopic_FullMethodName = "/chat.ChatService/UpdateTopic"
|
|
ChatService_PostMessage_FullMethodName = "/chat.ChatService/PostMessage"
|
|
ChatService_AgentPostMessage_FullMethodName = "/chat.ChatService/AgentPostMessage"
|
|
ChatService_GetMessage_FullMethodName = "/chat.ChatService/GetMessage"
|
|
ChatService_History_FullMethodName = "/chat.ChatService/History"
|
|
ChatService_Subscribe_FullMethodName = "/chat.ChatService/Subscribe"
|
|
ChatService_Acknowledge_FullMethodName = "/chat.ChatService/Acknowledge"
|
|
)
|
|
|
|
// 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 is the canonical API of the l-ai-chat Live Chat service.
|
|
// Chat Service is the single source of truth for messages; clients (Web UI,
|
|
// Telegram bot, agents) send and read messages through it.
|
|
type ChatServiceClient interface {
|
|
// ListTopics returns all topics in stable (creation) order.
|
|
ListTopics(ctx context.Context, in *ListTopicsRequest, opts ...grpc.CallOption) (*ListTopicsResponse, error)
|
|
// GetTopic returns one topic by id or slug.
|
|
GetTopic(ctx context.Context, in *GetTopicRequest, opts ...grpc.CallOption) (*Topic, error)
|
|
// CreateTopic creates a new topic. Slug must be unique.
|
|
CreateTopic(ctx context.Context, in *CreateTopicRequest, opts ...grpc.CallOption) (*Topic, error)
|
|
// UpdateTopic renames a topic (display_name). The slug is a stable
|
|
// identifier and cannot be changed. Topics are persistent in the MVP:
|
|
// there is no delete API.
|
|
UpdateTopic(ctx context.Context, in *UpdateTopicRequest, opts ...grpc.CallOption) (*Topic, error)
|
|
// PostMessage appends a message to a topic. NOTE: this RPC is fail-closed
|
|
// until the human-authentication stage: there is no trusted way to fill
|
|
// author_id/author_type/source yet, so any call currently returns
|
|
// Unimplemented. Agents MUST use AgentPostMessage (the server derives the
|
|
// identity from the service token). The internal canonical-message path is
|
|
// re-exposed after human auth lands.
|
|
PostMessage(ctx context.Context, in *PostMessageRequest, opts ...grpc.CallOption) (*PostMessageResponse, error)
|
|
// AgentPostMessage posts a message as the authenticated agent. The server
|
|
// derives every server-owned field: author_id (deterministic UUID of the
|
|
// authenticated identity), author_type=AGENT, source=AGENT, sequence,
|
|
// root_message_id, reply_depth, created_at. Clients cannot spoof them.
|
|
// idempotency_key is mandatory: retries with the same key return the
|
|
// original message (duplicated=true).
|
|
AgentPostMessage(ctx context.Context, in *AgentPostMessageRequest, opts ...grpc.CallOption) (*PostMessageResponse, error)
|
|
// GetMessage returns a single message by id.
|
|
GetMessage(ctx context.Context, in *GetMessageRequest, opts ...grpc.CallOption) (*Message, error)
|
|
// History returns messages of a topic, paginated by sequence (no offset
|
|
// pagination). Use before_sequence for newest-first backward paging or
|
|
// after_sequence for oldest-first forward paging; at most one may be set.
|
|
History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (*HistoryResponse, error)
|
|
// Subscribe opens the delivery stream of a topic for the authenticated
|
|
// consumer. Delivery is durable at-least-once: PostgreSQL (messages +
|
|
// per-(consumer, topic) delivery cursor) is the source of correctness;
|
|
// the stream is a live projection. Exactly one active subscription is
|
|
// admitted per (consumer, topic): a new Subscribe for the same pair
|
|
// replaces the previous one, which terminates with Aborted. Every
|
|
// DeliveryMessage carries the opaque subscription_id the consumer must
|
|
// echo in Acknowledge. Messages are delivered in ascending sequence
|
|
// order; gaps between sequences of one topic are normal (other topics
|
|
// consume global sequence values).
|
|
Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DeliveryMessage], error)
|
|
// Acknowledge advances the durable delivery cursor of the CURRENT active
|
|
// subscription of the authenticated consumer in a topic. Cumulative:
|
|
// last_ack_sequence = highest sequence the consumer has fully processed.
|
|
// The ACK is validated against the active subscription: the sequence must
|
|
// not exceed the highest sequence this subscription actually delivered,
|
|
// and a stale/old subscription_id is rejected. The cursor is monotonic —
|
|
// it never moves backwards. Cursor changes ONLY here; delivery itself
|
|
// never persists cursor state.
|
|
Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*AcknowledgeResponse, error)
|
|
}
|
|
|
|
type chatServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewChatServiceClient(cc grpc.ClientConnInterface) ChatServiceClient {
|
|
return &chatServiceClient{cc}
|
|
}
|
|
|
|
func (c *chatServiceClient) ListTopics(ctx context.Context, in *ListTopicsRequest, opts ...grpc.CallOption) (*ListTopicsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListTopicsResponse)
|
|
err := c.cc.Invoke(ctx, ChatService_ListTopics_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *chatServiceClient) GetTopic(ctx context.Context, in *GetTopicRequest, opts ...grpc.CallOption) (*Topic, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Topic)
|
|
err := c.cc.Invoke(ctx, ChatService_GetTopic_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *chatServiceClient) CreateTopic(ctx context.Context, in *CreateTopicRequest, opts ...grpc.CallOption) (*Topic, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Topic)
|
|
err := c.cc.Invoke(ctx, ChatService_CreateTopic_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *chatServiceClient) UpdateTopic(ctx context.Context, in *UpdateTopicRequest, opts ...grpc.CallOption) (*Topic, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Topic)
|
|
err := c.cc.Invoke(ctx, ChatService_UpdateTopic_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *chatServiceClient) PostMessage(ctx context.Context, in *PostMessageRequest, opts ...grpc.CallOption) (*PostMessageResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(PostMessageResponse)
|
|
err := c.cc.Invoke(ctx, ChatService_PostMessage_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *chatServiceClient) AgentPostMessage(ctx context.Context, in *AgentPostMessageRequest, opts ...grpc.CallOption) (*PostMessageResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(PostMessageResponse)
|
|
err := c.cc.Invoke(ctx, ChatService_AgentPostMessage_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *chatServiceClient) GetMessage(ctx context.Context, in *GetMessageRequest, opts ...grpc.CallOption) (*Message, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Message)
|
|
err := c.cc.Invoke(ctx, ChatService_GetMessage_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *chatServiceClient) History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (*HistoryResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(HistoryResponse)
|
|
err := c.cc.Invoke(ctx, ChatService_History_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *chatServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DeliveryMessage], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ChatService_ServiceDesc.Streams[0], ChatService_Subscribe_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[SubscribeRequest, DeliveryMessage]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ChatService_SubscribeClient = grpc.ServerStreamingClient[DeliveryMessage]
|
|
|
|
func (c *chatServiceClient) Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*AcknowledgeResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(AcknowledgeResponse)
|
|
err := c.cc.Invoke(ctx, ChatService_Acknowledge_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// ChatServiceServer is the server API for ChatService service.
|
|
// All implementations must embed UnimplementedChatServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// ChatService is the canonical API of the l-ai-chat Live Chat service.
|
|
// Chat Service is the single source of truth for messages; clients (Web UI,
|
|
// Telegram bot, agents) send and read messages through it.
|
|
type ChatServiceServer interface {
|
|
// ListTopics returns all topics in stable (creation) order.
|
|
ListTopics(context.Context, *ListTopicsRequest) (*ListTopicsResponse, error)
|
|
// GetTopic returns one topic by id or slug.
|
|
GetTopic(context.Context, *GetTopicRequest) (*Topic, error)
|
|
// CreateTopic creates a new topic. Slug must be unique.
|
|
CreateTopic(context.Context, *CreateTopicRequest) (*Topic, error)
|
|
// UpdateTopic renames a topic (display_name). The slug is a stable
|
|
// identifier and cannot be changed. Topics are persistent in the MVP:
|
|
// there is no delete API.
|
|
UpdateTopic(context.Context, *UpdateTopicRequest) (*Topic, error)
|
|
// PostMessage appends a message to a topic. NOTE: this RPC is fail-closed
|
|
// until the human-authentication stage: there is no trusted way to fill
|
|
// author_id/author_type/source yet, so any call currently returns
|
|
// Unimplemented. Agents MUST use AgentPostMessage (the server derives the
|
|
// identity from the service token). The internal canonical-message path is
|
|
// re-exposed after human auth lands.
|
|
PostMessage(context.Context, *PostMessageRequest) (*PostMessageResponse, error)
|
|
// AgentPostMessage posts a message as the authenticated agent. The server
|
|
// derives every server-owned field: author_id (deterministic UUID of the
|
|
// authenticated identity), author_type=AGENT, source=AGENT, sequence,
|
|
// root_message_id, reply_depth, created_at. Clients cannot spoof them.
|
|
// idempotency_key is mandatory: retries with the same key return the
|
|
// original message (duplicated=true).
|
|
AgentPostMessage(context.Context, *AgentPostMessageRequest) (*PostMessageResponse, error)
|
|
// GetMessage returns a single message by id.
|
|
GetMessage(context.Context, *GetMessageRequest) (*Message, error)
|
|
// History returns messages of a topic, paginated by sequence (no offset
|
|
// pagination). Use before_sequence for newest-first backward paging or
|
|
// after_sequence for oldest-first forward paging; at most one may be set.
|
|
History(context.Context, *HistoryRequest) (*HistoryResponse, error)
|
|
// Subscribe opens the delivery stream of a topic for the authenticated
|
|
// consumer. Delivery is durable at-least-once: PostgreSQL (messages +
|
|
// per-(consumer, topic) delivery cursor) is the source of correctness;
|
|
// the stream is a live projection. Exactly one active subscription is
|
|
// admitted per (consumer, topic): a new Subscribe for the same pair
|
|
// replaces the previous one, which terminates with Aborted. Every
|
|
// DeliveryMessage carries the opaque subscription_id the consumer must
|
|
// echo in Acknowledge. Messages are delivered in ascending sequence
|
|
// order; gaps between sequences of one topic are normal (other topics
|
|
// consume global sequence values).
|
|
Subscribe(*SubscribeRequest, grpc.ServerStreamingServer[DeliveryMessage]) error
|
|
// Acknowledge advances the durable delivery cursor of the CURRENT active
|
|
// subscription of the authenticated consumer in a topic. Cumulative:
|
|
// last_ack_sequence = highest sequence the consumer has fully processed.
|
|
// The ACK is validated against the active subscription: the sequence must
|
|
// not exceed the highest sequence this subscription actually delivered,
|
|
// and a stale/old subscription_id is rejected. The cursor is monotonic —
|
|
// it never moves backwards. Cursor changes ONLY here; delivery itself
|
|
// never persists cursor state.
|
|
Acknowledge(context.Context, *AcknowledgeRequest) (*AcknowledgeResponse, error)
|
|
mustEmbedUnimplementedChatServiceServer()
|
|
}
|
|
|
|
// 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.
|
|
type UnimplementedChatServiceServer struct{}
|
|
|
|
func (UnimplementedChatServiceServer) ListTopics(context.Context, *ListTopicsRequest) (*ListTopicsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListTopics not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) GetTopic(context.Context, *GetTopicRequest) (*Topic, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetTopic not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) CreateTopic(context.Context, *CreateTopicRequest) (*Topic, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateTopic not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) UpdateTopic(context.Context, *UpdateTopicRequest) (*Topic, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateTopic not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) PostMessage(context.Context, *PostMessageRequest) (*PostMessageResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method PostMessage not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) AgentPostMessage(context.Context, *AgentPostMessageRequest) (*PostMessageResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method AgentPostMessage not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) GetMessage(context.Context, *GetMessageRequest) (*Message, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetMessage not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) History(context.Context, *HistoryRequest) (*HistoryResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method History not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) Subscribe(*SubscribeRequest, grpc.ServerStreamingServer[DeliveryMessage]) error {
|
|
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) Acknowledge(context.Context, *AcknowledgeRequest) (*AcknowledgeResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Acknowledge not implemented")
|
|
}
|
|
func (UnimplementedChatServiceServer) mustEmbedUnimplementedChatServiceServer() {}
|
|
func (UnimplementedChatServiceServer) testEmbeddedByValue() {}
|
|
|
|
// 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 UnsafeChatServiceServer interface {
|
|
mustEmbedUnimplementedChatServiceServer()
|
|
}
|
|
|
|
func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedChatServiceServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&ChatService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _ChatService_ListTopics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListTopicsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ChatServiceServer).ListTopics(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ChatService_ListTopics_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ChatServiceServer).ListTopics(ctx, req.(*ListTopicsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ChatService_GetTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetTopicRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ChatServiceServer).GetTopic(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ChatService_GetTopic_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ChatServiceServer).GetTopic(ctx, req.(*GetTopicRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ChatService_CreateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateTopicRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ChatServiceServer).CreateTopic(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ChatService_CreateTopic_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ChatServiceServer).CreateTopic(ctx, req.(*CreateTopicRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ChatService_UpdateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateTopicRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ChatServiceServer).UpdateTopic(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ChatService_UpdateTopic_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ChatServiceServer).UpdateTopic(ctx, req.(*UpdateTopicRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ChatService_PostMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PostMessageRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ChatServiceServer).PostMessage(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ChatService_PostMessage_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ChatServiceServer).PostMessage(ctx, req.(*PostMessageRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ChatService_AgentPostMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AgentPostMessageRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ChatServiceServer).AgentPostMessage(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ChatService_AgentPostMessage_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ChatServiceServer).AgentPostMessage(ctx, req.(*AgentPostMessageRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ChatService_GetMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetMessageRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ChatServiceServer).GetMessage(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ChatService_GetMessage_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ChatServiceServer).GetMessage(ctx, req.(*GetMessageRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ChatService_History_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(HistoryRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ChatServiceServer).History(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ChatService_History_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ChatServiceServer).History(ctx, req.(*HistoryRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ChatService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(SubscribeRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(ChatServiceServer).Subscribe(m, &grpc.GenericServerStream[SubscribeRequest, DeliveryMessage]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ChatService_SubscribeServer = grpc.ServerStreamingServer[DeliveryMessage]
|
|
|
|
func _ChatService_Acknowledge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AcknowledgeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ChatServiceServer).Acknowledge(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ChatService_Acknowledge_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ChatServiceServer).Acknowledge(ctx, req.(*AcknowledgeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// 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 ChatService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "chat.ChatService",
|
|
HandlerType: (*ChatServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ListTopics",
|
|
Handler: _ChatService_ListTopics_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetTopic",
|
|
Handler: _ChatService_GetTopic_Handler,
|
|
},
|
|
{
|
|
MethodName: "CreateTopic",
|
|
Handler: _ChatService_CreateTopic_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateTopic",
|
|
Handler: _ChatService_UpdateTopic_Handler,
|
|
},
|
|
{
|
|
MethodName: "PostMessage",
|
|
Handler: _ChatService_PostMessage_Handler,
|
|
},
|
|
{
|
|
MethodName: "AgentPostMessage",
|
|
Handler: _ChatService_AgentPostMessage_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetMessage",
|
|
Handler: _ChatService_GetMessage_Handler,
|
|
},
|
|
{
|
|
MethodName: "History",
|
|
Handler: _ChatService_History_Handler,
|
|
},
|
|
{
|
|
MethodName: "Acknowledge",
|
|
Handler: _ChatService_Acknowledge_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Subscribe",
|
|
Handler: _ChatService_Subscribe_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "chat.proto",
|
|
}
|