connector

package
v0.0.0-...-2a45ea8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

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