Documentation
¶
Overview ¶
Package connector implements ReplicaConnector interface using gRPC as a mechanism to exchange messages with replicas over the network
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectManyReplicas ¶
func ConnectManyReplicas(conn ReplicaConnector, targets map[uint32]string, dialOpts ...grpc.DialOption) error
ConnectManyReplicas helps to establish connections to multiple replicas. It invokes ConnectReplica on the specified connector for each replica in the supplied map. The map holds gRPC target addresses indexed by replica ID.
Types ¶
type ReplicaConnector ¶
type ReplicaConnector interface {
api.ReplicaConnector
ConnectReplica(replicaID uint32, target string, dialOpts ...grpc.DialOption) error
}
ReplicaConnector implements connectivity API using gRPC as a network communication mechanism.
ConnectReplica method establishes a connection to a replica by its gRPC target address.
func NewClientSide ¶
func NewClientSide() ReplicaConnector
NewClientSide creates a new instance of ReplicaConnector to use at client side, i.e. initiate client-to-replica connections.
func NewReplicaSide ¶
func NewReplicaSide() ReplicaConnector
NewReplicaSide creates a new instance of ReplicaConnector to use at replica side, i.e. initiate replica-to-replica connections.