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
// RemoteIdentityWatcher provides identities that have been allocated on a
// remote cluster.
RemoteIdentityWatcher RemoteIdentityWatcher
// 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 RemoteIdentityWatcher ¶ added in v1.6.7
type RemoteIdentityWatcher interface {
// WatchRemoteIdentities starts watching for identities in another kvstore and
// syncs all identities to the local identity cache.
WatchRemoteIdentities(backend kvstore.BackendOperations) (*allocator.RemoteCache, error)
// Close stops the watcher.
Close()
}
RemoteIdentityWatcher is any type which provides identities that have been allocated on a remote cluster.
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.