clustermesh

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterMesh

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

ClusterMesh is a cache of multiple remote clusters

func NewClusterMesh

func NewClusterMesh(c Configuration) (*ClusterMesh, error)

NewClusterMesh creates a new remote cluster cache based on the provided configuration

func (*ClusterMesh) Close

func (cm *ClusterMesh) Close()

Close stops watching for remote cluster configuration files to appear and will close all connections to remote clusters

func (*ClusterMesh) NumReadyClusters

func (cm *ClusterMesh) NumReadyClusters() int

NumReadyClusters returns the number of remote clusters to which a connection has been established

type Configuration

type Configuration struct {
	// Name is the name of the remote cluster cache. This is for logging
	// purposes only
	Name string

	// ConfigDirectory is the path to the directory that will be watched for etcd
	// configuration files to appear
	ConfigDirectory string

	// NodeKeyCreator is the function used to create node instances as
	// nodes are being discovered in remote clusters
	NodeKeyCreator store.KeyCreator

	// ServiceMerger is the interface responsible to merge service and
	// endpoints into an existing cache
	ServiceMerger ServiceMerger

	// NodeManager is the node manager to manage all discovered remote
	// nodes
	NodeManager *nodemanager.Manager
	// contains filtered or unexported fields
}

Configuration is the configuration that must be provided to NewClusterMesh()

func (*Configuration) NodeObserver

func (c *Configuration) NodeObserver() store.Observer

NodeObserver returns the node store observer of the configuration

type ServiceMerger

type ServiceMerger interface {
	MergeExternalServiceUpdate(service *service.ClusterService)
	MergeExternalServiceDelete(service *service.ClusterService)
}

ServiceMerger is the interface to be implemented by the owner of local services. The functions have to merge service updates and deletions with local services to provide a shared view.

Jump to

Keyboard shortcuts

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