cluster

package
v0.7.22 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 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(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)

Connect connects to the replica

func (*Replica) IsLocal added in v0.6.19

func (r *Replica) IsLocal() bool

IsLocal returns a bool indicating whether the replica is local

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