Documentation
¶
Overview ¶
Package cluster provides cluster state management for FODC proxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages cluster state from multiple agents.
func NewManager ¶
func NewManager(registry *registry.AgentRegistry, grpcService RequestSender, log *logger.Logger) *Manager
NewManager creates a new cluster state manager.
func (*Manager) CollectClusterTopology ¶
func (m *Manager) CollectClusterTopology(ctx context.Context) *TopologyMap
CollectClusterTopology requests and collects cluster topology from all agents with context.
func (*Manager) RemoveTopology ¶
RemoveTopology removes cluster topology for a specific agent.
func (*Manager) SetGRPCService ¶
func (m *Manager) SetGRPCService(grpcService RequestSender)
SetGRPCService sets the gRPC service for sending cluster data requests.
type NodeWithStringRoles ¶
type NodeWithStringRoles struct {
*databasev1.Node
Status *registry.AgentStatus `json:"status,omitempty"`
LastHeartbeat *time.Time `json:"last_heartbeat,omitempty"`
Roles []string `json:"roles"`
}
NodeWithStringRoles represents a node with roles as strings instead of numeric enum values.
type RequestSender ¶
RequestSender is an interface for sending cluster data requests to agents.
type TopologyMap ¶
type TopologyMap struct {
Nodes []*NodeWithStringRoles `json:"nodes"`
Calls []*fodcv1.Call `json:"calls"`
}
TopologyMap represents processed cluster data with string roles.
Click to show internal directories.
Click to hide internal directories.