transactionreceiver

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_transactionreceiver_transactionreceiver_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use ByeBye.ProtoReflect.Descriptor instead.

func (*ByeBye) ProtoMessage

func (*ByeBye) ProtoMessage()

func (*ByeBye) ProtoReflect

func (x *ByeBye) ProtoReflect() protoreflect.Message

func (*ByeBye) Reset

func (x *ByeBye) Reset()

func (*ByeBye) String

func (x *ByeBye) String() string

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

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.

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.

func (UnimplementedTransactionReceiverServer) Listen

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL