Documentation
¶
Index ¶
- Variables
- func RegisterTransactionReceiverServer(s grpc.ServiceRegistrar, srv TransactionReceiverServer)
- type ByeBye
- type TransactionReceiver
- type TransactionReceiverClient
- type TransactionReceiverServer
- type TransactionReceiver_ListenClient
- type TransactionReceiver_ListenServer
- type UnimplementedTransactionReceiverServer
- type UnsafeTransactionReceiverServer
Constants ¶
This section is empty.
Variables ¶
var File_transactionreceiver_transactionreceiver_proto protoreflect.FileDescriptor
var TransactionReceiver_ServiceDesc = grpc.ServiceDesc{ ServiceName: "receiver.TransactionReceiver", HandlerType: (*TransactionReceiverServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Listen", Handler: _TransactionReceiver_Listen_Handler, ClientStreams: true, }, }, Metadata: "transactionreceiver/transactionreceiver.proto", }
TransactionReceiver_ServiceDesc is the grpc.ServiceDesc for TransactionReceiver service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTransactionReceiverServer ¶
func RegisterTransactionReceiverServer(s grpc.ServiceRegistrar, srv TransactionReceiverServer)
Types ¶
type ByeBye ¶
type ByeBye struct {
// contains filtered or unexported fields
}
func (*ByeBye) Descriptor
deprecated
func (*ByeBye) ProtoMessage ¶
func (*ByeBye) ProtoMessage()
func (*ByeBye) ProtoReflect ¶
func (x *ByeBye) ProtoReflect() protoreflect.Message
type TransactionReceiver ¶
type TransactionReceiver struct { UnimplementedTransactionReceiverServer // contains filtered or unexported fields }
func NewTransactionReceiver ¶
func NewTransactionReceiver(node *mir.Node, moduleID t.ModuleID, logger logging.Logger) *TransactionReceiver
NewTransactionReceiver returns a new initialized transaction receiver. The returned TransactionReceiver is not yet running (able to receive transactions). This needs to be done explicitly by calling the Start() method. For the transactions to be processed by passed Node, the Node must also be running.
func (*TransactionReceiver) Listen ¶
func (rr *TransactionReceiver) Listen(srv TransactionReceiver_ListenServer) error
Listen implements the gRPC Listen service (multi-request-single-response). It receives messages from the gRPC client running on the Mir client and submits them to the Node associated with this TransactionReceiver. This function is called by the gRPC system on every new connection from a Mir client's gRPC client.
func (*TransactionReceiver) ServerError ¶
func (rr *TransactionReceiver) ServerError() error
ServerError returns the error returned by the gRPC server's Serve() call. ServerError() must not be called before the TransactionReceiver is stopped and its Stop() method has returned.
func (*TransactionReceiver) Start ¶
func (rr *TransactionReceiver) Start(port int) error
Start starts the TransactionReceiver by initializing and starting the internal gRPC server, listening on the passed port. Before ths method is called, no client connections are accepted.
func (*TransactionReceiver) Stop ¶
func (rr *TransactionReceiver) Stop()
Stop stops the own gRPC server (preventing further incoming connections). After Stop() returns, the error returned by the gRPC server's Serve() call can be obtained through the ServerError() method.
type TransactionReceiverClient ¶
type TransactionReceiverClient interface {
Listen(ctx context.Context, opts ...grpc.CallOption) (TransactionReceiver_ListenClient, error)
}
TransactionReceiverClient is the client API for TransactionReceiver 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 NewTransactionReceiverClient ¶
func NewTransactionReceiverClient(cc grpc.ClientConnInterface) TransactionReceiverClient
type TransactionReceiverServer ¶
type TransactionReceiverServer interface { Listen(TransactionReceiver_ListenServer) error // contains filtered or unexported methods }
TransactionReceiverServer is the server API for TransactionReceiver service. All implementations must embed UnimplementedTransactionReceiverServer for forward compatibility
type TransactionReceiver_ListenClient ¶
type TransactionReceiver_ListenClient interface { Send(*trantorpb.Transaction) error CloseAndRecv() (*ByeBye, error) grpc.ClientStream }
type TransactionReceiver_ListenServer ¶
type TransactionReceiver_ListenServer interface { SendAndClose(*ByeBye) error Recv() (*trantorpb.Transaction, error) grpc.ServerStream }
type UnimplementedTransactionReceiverServer ¶
type UnimplementedTransactionReceiverServer struct { }
UnimplementedTransactionReceiverServer must be embedded to have forward compatible implementations.
type UnsafeTransactionReceiverServer ¶
type UnsafeTransactionReceiverServer interface {
// contains filtered or unexported methods
}
UnsafeTransactionReceiverServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TransactionReceiverServer will result in compilation errors.