cluster

package
v0.0.0-...-ed29c3e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	io.Closer

	// Node returns the local node
	Node() Node

	// Replica returns a replica by ID
	Replica(ReplicaID) *Replica

	// Replicas returns the set of remote replicas
	Replicas() ReplicaSet

	// Watch watches the cluster for changes to the replicas
	Watch(chan<- ReplicaSet) error
}

Cluster is an interface for interacting with the onos-ric cluster

func New

func New(client *client.Client) (Cluster, error)

New creates a new cluster

type Node

type Node struct {
	ID NodeID
}

Node is a cluster node

type NodeID

type NodeID string

NodeID is a node identifier

type Replica

type Replica struct {
	Node
	ID ReplicaID
	// contains filtered or unexported fields
}

Replica is a cluster replica

func (*Replica) Connect

func (r *Replica) Connect() (*grpc.ClientConn, error)

Connect connects to the replica

type ReplicaID

type ReplicaID NodeID

ReplicaID is a replica identifier

type ReplicaSet

type ReplicaSet map[ReplicaID]*Replica

ReplicaSet is a set of replicas

type Service

type Service func(NodeID, *grpc.Server)

Service is a gRPC service

type TestFactory

type TestFactory struct {
	// contains filtered or unexported fields
}

TestFactory is a factory for creating test clusters

func NewTestFactory

func NewTestFactory(services ...Service) *TestFactory

NewTestFactory creates a new cluster factory

func (*TestFactory) NewCluster

func (f *TestFactory) NewCluster(nodeID NodeID) (Cluster, error)

NewCluster creates a new test cluster

Jump to

Keyboard shortcuts

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