Documentation
¶
Index ¶
- func HealthHandler(registry AgentRegistry) http.Handler
- func MetricsHandler(registry AgentRegistry) http.Handler
- type AgentAuthenticator
- type AgentConnection
- type AgentRegistry
- type FileAuthenticator
- type InMemoryRegistry
- func (r *InMemoryRegistry) ObserveQuery(tenantID, agentID string, latency time.Duration)
- func (r *InMemoryRegistry) Pick(ctx context.Context, tenantID string) (AgentConnection, error)
- func (r *InMemoryRegistry) Register(ctx context.Context, tenantID string, agentID string, conn AgentConnection) error
- func (r *InMemoryRegistry) Stats() RegistryStats
- func (r *InMemoryRegistry) Unregister(ctx context.Context, tenantID string, agentID string)
- type LatencyAgg
- type RegistryKey
- type RegistryStats
- type ReloadableAuthenticator
- type Server
- type StaticAgentSecret
- type StaticAuthenticator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthHandler ¶
func HealthHandler(registry AgentRegistry) http.Handler
HealthHandler returns a simple JSON health/readiness report. Ready = agents connected; Live = process serving.
func MetricsHandler ¶
func MetricsHandler(registry AgentRegistry) http.Handler
MetricsHandler exposes minimal Prometheus-style gauges for agent counts.
Types ¶
type AgentAuthenticator ¶
type AgentAuthenticator = types.AgentAuthenticator
AgentAuthenticator validates an incoming agent hello and returns tenant and agent IDs. Implementations may look up secrets in a datastore or config map.
type AgentConnection ¶
type AgentConnection = types.AgentConnection
Exported via types for external consumers.
type AgentRegistry ¶
type AgentRegistry = types.AgentRegistry
type FileAuthenticator ¶
type FileAuthenticator struct {
// contains filtered or unexported fields
}
FileAuthenticator reads agent credentials from a YAML/JSON file. Schema: list of {clientID, clientSecret, tenantID, agentID}
func NewFileAuthenticator ¶
func NewFileAuthenticator(path string) (*FileAuthenticator, error)
func (*FileAuthenticator) Authenticate ¶
func (*FileAuthenticator) Reload ¶
func (f *FileAuthenticator) Reload() error
type InMemoryRegistry ¶
type InMemoryRegistry struct {
// contains filtered or unexported fields
}
InMemoryRegistry is a simple in-process registry suitable for single-instance deployments.
func NewInMemoryRegistry ¶
func NewInMemoryRegistry() *InMemoryRegistry
func (*InMemoryRegistry) ObserveQuery ¶
func (r *InMemoryRegistry) ObserveQuery(tenantID, agentID string, latency time.Duration)
func (*InMemoryRegistry) Pick ¶
func (r *InMemoryRegistry) Pick(ctx context.Context, tenantID string) (AgentConnection, error)
func (*InMemoryRegistry) Register ¶
func (r *InMemoryRegistry) Register(ctx context.Context, tenantID string, agentID string, conn AgentConnection) error
func (*InMemoryRegistry) Stats ¶
func (r *InMemoryRegistry) Stats() RegistryStats
func (*InMemoryRegistry) Unregister ¶
func (r *InMemoryRegistry) Unregister(ctx context.Context, tenantID string, agentID string)
type LatencyAgg ¶
type LatencyAgg = types.LatencyAgg
type RegistryKey ¶
type RegistryKey = types.RegistryKey
type RegistryStats ¶
type RegistryStats = types.RegistryStats
type ReloadableAuthenticator ¶
type ReloadableAuthenticator interface {
AgentAuthenticator
Reload() error
}
ReloadableAuthenticator optionally supports live reload of credentials.
type Server ¶
type Server struct {
proto.UnimplementedAgentServiceServer
// contains filtered or unexported fields
}
Server implements the AgentService gRPC handlers.
func NewServer ¶
func NewServer(auth AgentAuthenticator, registry AgentRegistry, logger *slog.Logger) *Server
type StaticAgentSecret ¶
type StaticAuthenticator ¶
type StaticAuthenticator struct {
Secrets map[string]StaticAgentSecret
}
StaticAuthenticator is a simple map-based authenticator for bootstrapping and tests.