// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) // source: channel/v1/channel.proto package channelv1 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 ( ChannelService_Run_FullMethodName = "/channel.v1.ChannelService/Run" ) // ChannelServiceClient is the client API for ChannelService 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. // // ChannelService is the surface a chat channel extension serves. The host // launches one plugin process per enabled channel and serves the gateway // ChatService back to it over the plugin broker, so a channel carries messages // in and out through that service and never dials the gateway itself. type ChannelServiceClient interface { // Run starts the channel and keeps it running until the call is cancelled or // the channel fails. The stream reports lifecycle: STARTING before each // launch attempt, RUNNING once the channel can receive. A stream that ends // with an error is a failed channel; the host restarts it. Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RunResponse], error) } type channelServiceClient struct { cc grpc.ClientConnInterface } func NewChannelServiceClient(cc grpc.ClientConnInterface) ChannelServiceClient { return &channelServiceClient{cc} } func (c *channelServiceClient) Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RunResponse], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &ChannelService_ServiceDesc.Streams[0], ChannelService_Run_FullMethodName, cOpts...) if err != nil { return nil, err } x := &grpc.GenericClientStream[RunRequest, RunResponse]{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 ChannelService_RunClient = grpc.ServerStreamingClient[RunResponse] // ChannelServiceServer is the server API for ChannelService service. // All implementations must embed UnimplementedChannelServiceServer // for forward compatibility. // // ChannelService is the surface a chat channel extension serves. The host // launches one plugin process per enabled channel and serves the gateway // ChatService back to it over the plugin broker, so a channel carries messages // in and out through that service and never dials the gateway itself. type ChannelServiceServer interface { // Run starts the channel and keeps it running until the call is cancelled or // the channel fails. The stream reports lifecycle: STARTING before each // launch attempt, RUNNING once the channel can receive. A stream that ends // with an error is a failed channel; the host restarts it. Run(*RunRequest, grpc.ServerStreamingServer[RunResponse]) error mustEmbedUnimplementedChannelServiceServer() } // UnimplementedChannelServiceServer 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 UnimplementedChannelServiceServer struct{} func (UnimplementedChannelServiceServer) Run(*RunRequest, grpc.ServerStreamingServer[RunResponse]) error { return status.Error(codes.Unimplemented, "method Run not implemented") } func (UnimplementedChannelServiceServer) mustEmbedUnimplementedChannelServiceServer() {} func (UnimplementedChannelServiceServer) testEmbeddedByValue() {} // UnsafeChannelServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ChannelServiceServer will // result in compilation errors. type UnsafeChannelServiceServer interface { mustEmbedUnimplementedChannelServiceServer() } func RegisterChannelServiceServer(s grpc.ServiceRegistrar, srv ChannelServiceServer) { // If the following call panics, it indicates UnimplementedChannelServiceServer 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(&ChannelService_ServiceDesc, srv) } func _ChannelService_Run_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(RunRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(ChannelServiceServer).Run(m, &grpc.GenericServerStream[RunRequest, RunResponse]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type ChannelService_RunServer = grpc.ServerStreamingServer[RunResponse] // ChannelService_ServiceDesc is the grpc.ServiceDesc for ChannelService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var ChannelService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "channel.v1.ChannelService", HandlerType: (*ChannelServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Run", Handler: _ChannelService_Run_Handler, ServerStreams: true, }, }, Metadata: "channel/v1/channel.proto", }