Documentation ¶
Overview ¶
Package bridge connects data between the vizier NATS domain and cloud nats domain by using a GRPC channel. Each Vizier gets a dedicated subset of nats domain in the from v2c.<shard_id>.<cluster_id>.* and c2v.<shard_id>.<cluster_id>.*. v2c = vizier to cloud messages, c2v = cloud to vizier messages. The shard ID is determined by the first byte of the clusterID and is between 0x00 and 0xff.
This package has the cloud counterpart to Vizier's cloud_connector/bridge component.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMissingRegistrationMessage is produced if registration was not the first message. ErrMissingRegistrationMessage = errors.New("Expected registration message") // ErrBadRegistrationMessage ia produced if a malformed registration message is received. ErrBadRegistrationMessage = errors.New("Malformed registration message") // ErrRegistrationFailedUnknown is the error for vizier registration failure. ErrRegistrationFailedUnknown = errors.New("registration failed unknown") // ErrRegistrationFailedNotFound is the error for vizier registration failure when vizier is not found. ErrRegistrationFailedNotFound = errors.New("registration failed not found") // ErrRequestChannelClosed is an error returned when the streams have already been closed. ErrRequestChannelClosed = errors.New("request channel already closed") )
Functions ¶
This section is empty.
Types ¶
type GRPCServer ¶
type GRPCServer struct {
// contains filtered or unexported fields
}
GRPCServer is implementation of the vzconn server.
func NewBridgeGRPCServer ¶
func NewBridgeGRPCServer(vzmgrClient vzmgrpb.VZMgrServiceClient, vzDeploymentClient vzmgrpb.VZDeploymentServiceClient, nc *nats.Conn, st msgbus.Streamer) *GRPCServer
NewBridgeGRPCServer creates a new GRPCServer.
func (*GRPCServer) NATSBridge ¶
func (s *GRPCServer) NATSBridge(srv vzconnpb.VZConnService_NATSBridgeServer) error
NATSBridge is the endpoint that all viziers connect to.
func (*GRPCServer) RegisterVizierDeployment ¶
func (s *GRPCServer) RegisterVizierDeployment(ctx context.Context, req *vzconnpb.RegisterVizierDeploymentRequest) (*vzconnpb.RegisterVizierDeploymentResponse, error)
RegisterVizierDeployment registers the vizier using the deployment key passed in on X-API-KEY.
type NATSBridgeController ¶
type NATSBridgeController struct {
// contains filtered or unexported fields
}
NATSBridgeController is responsible for routing messages from Vizier to NATS. It assumes that all authentication/handshakes are completed before being created.
func NewNATSBridgeController ¶
func NewNATSBridgeController(clusterID uuid.UUID, srv vzconnpb.VZConnService_NATSBridgeServer, nc *nats.Conn, st msgbus.Streamer) *NATSBridgeController
NewNATSBridgeController creates a NATSBridgeController.
func (*NATSBridgeController) Run ¶
func (s *NATSBridgeController) Run() error
Run is the main loop of the NATS bridge controller. This function block until Stop is called.