Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { ClusterEndpoint ProbeableEndpoint NodeEndpoints map[string]ProbeableEndpoint }
func NewCluster ¶
func NewCluster(cluster ProbeableEndpoint) Cluster
func (*Cluster) AddEndpoint ¶
func (c *Cluster) AddEndpoint(endpoint ProbeableEndpoint)
type ClusterMap ¶
func NewClusterMap ¶
func NewClusterMap() ClusterMap
func (*ClusterMap) AppendCluster ¶
func (cm *ClusterMap) AppendCluster(cluster Cluster)
func (*ClusterMap) Diff ¶
func (oldMap *ClusterMap) Diff(newMap *ClusterMap) (oldEndpoints []ProbeableEndpoint, newEndpoints []ProbeableEndpoint)
Diff make the intersection between two clusters and return: oldEndpoints: the endpoints that were present in the old cluster map but not in the new one newEndpoints: the endpoints that are present in the new cluster map but not in the old one
type DummyEndpoint ¶
DummyEndpoint is a fake ProbeableEndpoint that don't do anything Useful for testing
func (DummyEndpoint) Close ¶
func (d DummyEndpoint) Close() error
func (DummyEndpoint) Connect ¶
func (d DummyEndpoint) Connect() error
func (DummyEndpoint) GetHash ¶
func (d DummyEndpoint) GetHash() string
func (DummyEndpoint) GetName ¶
func (d DummyEndpoint) GetName() string
func (DummyEndpoint) IsCluster ¶
func (d DummyEndpoint) IsCluster() bool
func (DummyEndpoint) Refresh ¶
func (d DummyEndpoint) Refresh() error
type ProbeableEndpoint ¶
type ProbeableEndpoint interface { // Hash used to compare two endpoints (useful for topology updates) GetHash() string // Name of the endpoint useful for metrics and loggings GetName() string // IsCluster return true if the endpoint is cluster endpoint, false if node IsCluster() bool // Connect is called to initialize connections to the remote database Connect() error // Refresh is called to refresh the states of the endpoint // Can be used to check for new tables/namespaces/nodes Refresh() error // Close should terminate all connections to the remote database Close() error }
ProbeableEndpoint represent an endpoint that can be checked by the probe
Click to show internal directories.
Click to hide internal directories.