control

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultSessionTTL is the default agent session TTL
	DefaultSessionTTL = 5 * time.Minute // 默认 5 分钟
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	serverv1.UnimplementedControlServiceServer
	// contains filtered or unexported fields
}

Server implements the ControlService and exposes a registry store for other components.

func NewServer

func NewServer(registry *reg.Store) *Server

func (*Server) GetAgentSystemInfo

func (s *Server) GetAgentSystemInfo(ctx context.Context, in *serverv1.GetAgentSystemInfoRequest) (*opsv1.SystemInfo, error)

GetAgentSystemInfo retrieves system info for a specific agent. It returns cached info if available, otherwise queries the agent directly.

func (*Server) Heartbeat

Heartbeat extends the expiry of an agent session.

func (*Server) ListAgentProcesses

ListAgentProcesses lists processes on a specific agent.

func (*Server) ListFunctionsSummary

func (s *Server) ListFunctionsSummary(ctx context.Context, _ *emptypb.Empty) (*serverv1.ListFunctionsSummaryResponse, error)

ListFunctionsSummary aggregates unique functions across all registered agents and returns a summarized descriptor list for dashboard consumption. This is a minimal baseline that can be enriched with UI/RBAC metadata sourced from proto options or provider manifests.

func (*Server) MetricsStore

func (s *Server) MetricsStore() *reg.MetricsStore

MetricsStore returns the metrics store (for HTTP handlers).

func (*Server) QueryMetrics

QueryMetrics queries stored metrics from agents.

func (*Server) Register

Register registers or updates an agent session. Minimal fields are accepted.

func (*Server) RegisterCapabilities

RegisterCapabilities handles provider manifest registration with language-agnostic declaration.

func (*Server) ReportMetrics

func (s *Server) ReportMetrics(ctx context.Context, in *opsv1.MetricsReport) (*emptypb.Empty, error)

ReportMetrics receives and stores metrics reports from agents.

func (*Server) SetDefaultSessionTTL added in v0.1.1

func (s *Server) SetDefaultSessionTTL(ttl time.Duration)

SetDefaultSessionTTL sets the default session TTL for agent registrations.

func (*Server) SetUpstreamClient

func (s *Server) SetUpstreamClient(cli serverv1.ControlServiceClient)

SetUpstreamClient configures an optional upstream ControlService client. When set (typically in Edge), Register/Heartbeat/Capabilities can be forwarded to the central Server.

func (*Server) Store

func (s *Server) Store() *reg.Store

Store returns the underlying registry Store (for function server / HTTP handlers).

func (*Server) SystemInfoCache

func (s *Server) SystemInfoCache() *reg.SystemInfoCache

SystemInfoCache returns the system info cache (for HTTP handlers).

Jump to

Keyboard shortcuts

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