cluster

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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

func (m *Manager) RemoveTopology(agentID string)

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.

func (*Manager) UpdateClusterTopology

func (m *Manager) UpdateClusterTopology(agentID string, topology *fodcv1.Topology)

UpdateClusterTopology updates cluster topology for a specific agent.

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

type RequestSender interface {
	RequestClusterData(agentID string) error
}

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.

Jump to

Keyboard shortcuts

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