// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.1 // - protoc v6.33.1 // source: signalexchange.proto package 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 ( SignalExchange_Send_FullMethodName = "/signalexchange.SignalExchange/Send" SignalExchange_ConnectStream_FullMethodName = "/signalexchange.SignalExchange/ConnectStream" ) // SignalExchangeClient is the client API for SignalExchange 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. type SignalExchangeClient interface { // Synchronously connect to the Signal Exchange service offering connection candidates and waiting for connection candidates from the other party (remote peer) Send(ctx context.Context, in *EncryptedMessage, opts ...grpc.CallOption) (*EncryptedMessage, error) // Connect to the Signal Exchange service offering connection candidates and maintain a channel for receiving candidates from the other party (remote peer) ConnectStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[EncryptedMessage, EncryptedMessage], error) } type signalExchangeClient struct { cc grpc.ClientConnInterface } func NewSignalExchangeClient(cc grpc.ClientConnInterface) SignalExchangeClient { return &signalExchangeClient{cc} } func (c *signalExchangeClient) Send(ctx context.Context, in *EncryptedMessage, opts ...grpc.CallOption) (*EncryptedMessage, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(EncryptedMessage) err := c.cc.Invoke(ctx, SignalExchange_Send_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *signalExchangeClient) ConnectStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[EncryptedMessage, EncryptedMessage], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &SignalExchange_ServiceDesc.Streams[0], SignalExchange_ConnectStream_FullMethodName, cOpts...) if err != nil { return nil, err } x := &grpc.GenericClientStream[EncryptedMessage, EncryptedMessage]{ClientStream: stream} 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 SignalExchange_ConnectStreamClient = grpc.BidiStreamingClient[EncryptedMessage, EncryptedMessage] // SignalExchangeServer is the server API for SignalExchange service. // All implementations must embed UnimplementedSignalExchangeServer // for forward compatibility. type SignalExchangeServer interface { // Synchronously connect to the Signal Exchange service offering connection candidates and waiting for connection candidates from the other party (remote peer) Send(context.Context, *EncryptedMessage) (*EncryptedMessage, error) // Connect to the Signal Exchange service offering connection candidates and maintain a channel for receiving candidates from the other party (remote peer) ConnectStream(grpc.BidiStreamingServer[EncryptedMessage, EncryptedMessage]) error mustEmbedUnimplementedSignalExchangeServer() } // UnimplementedSignalExchangeServer 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 UnimplementedSignalExchangeServer struct{} func (UnimplementedSignalExchangeServer) Send(context.Context, *EncryptedMessage) (*EncryptedMessage, error) { return nil, status.Error(codes.Unimplemented, "method Send not implemented") } func (UnimplementedSignalExchangeServer) ConnectStream(grpc.BidiStreamingServer[EncryptedMessage, EncryptedMessage]) error { return status.Error(codes.Unimplemented, "method ConnectStream not implemented") } func (UnimplementedSignalExchangeServer) mustEmbedUnimplementedSignalExchangeServer() {} func (UnimplementedSignalExchangeServer) testEmbeddedByValue() {} // UnsafeSignalExchangeServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to SignalExchangeServer will // result in compilation errors. type UnsafeSignalExchangeServer interface { mustEmbedUnimplementedSignalExchangeServer() } func RegisterSignalExchangeServer(s grpc.ServiceRegistrar, srv SignalExchangeServer) { // If the following call panics, it indicates UnimplementedSignalExchangeServer 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(&SignalExchange_ServiceDesc, srv) } func _SignalExchange_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EncryptedMessage) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(SignalExchangeServer).Send(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: SignalExchange_Send_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SignalExchangeServer).Send(ctx, req.(*EncryptedMessage)) } return interceptor(ctx, in, info, handler) } func _SignalExchange_ConnectStream_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(SignalExchangeServer).ConnectStream(&grpc.GenericServerStream[EncryptedMessage, EncryptedMessage]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type SignalExchange_ConnectStreamServer = grpc.BidiStreamingServer[EncryptedMessage, EncryptedMessage] // SignalExchange_ServiceDesc is the grpc.ServiceDesc for SignalExchange service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var SignalExchange_ServiceDesc = grpc.ServiceDesc{ ServiceName: "signalexchange.SignalExchange", HandlerType: (*SignalExchangeServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Send", Handler: _SignalExchange_Send_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "ConnectStream", Handler: _SignalExchange_ConnectStream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "signalexchange.proto", }