Documentation
¶
Index ¶
- type ServerStatus
- type ServerStatusSnapshot
- type ToolInfo
- type View
- func (v *View) Count() int
- func (v *View) CountByState(state string) int
- func (v *View) CountConnected() int
- func (v *View) GetAll() map[string]*ServerStatus
- func (v *View) GetServer(name string) (*ServerStatus, bool)
- func (v *View) RemoveServer(name string)
- func (v *View) Snapshot() *ServerStatusSnapshot
- func (v *View) UpdateServer(name string, fn func(*ServerStatus))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerStatus ¶
type ServerStatus struct {
Name string
Config *config.ServerConfig
State string // Actor state: idle, connecting, connected, error, etc.
Enabled bool
Quarantined bool
Connected bool
LastError string
LastErrorTime *time.Time
ConnectedAt *time.Time
DisconnectedAt *time.Time
RetryCount int
ToolCount int
Tools []ToolInfo // Phase 7.1: Cached tool list for lock-free reads
Metadata map[string]interface{}
}
ServerStatus represents the runtime status of an upstream server.
type ServerStatusSnapshot ¶
type ServerStatusSnapshot struct {
Servers map[string]*ServerStatus
Timestamp time.Time
}
ServerStatusSnapshot is an immutable snapshot of all server statuses.
type ToolInfo ¶
type ToolInfo struct {
Name string
Description string
InputSchema map[string]interface{}
Annotations *config.ToolAnnotations
}
ToolInfo represents a cached tool definition.
type View ¶
type View struct {
// contains filtered or unexported fields
}
View provides a read-only view of server statuses. It maintains an in-memory snapshot updated via supervisor events.
func (*View) CountByState ¶
CountByState returns the number of servers in a specific state (lock-free).
func (*View) CountConnected ¶
CountConnected returns the number of connected servers (lock-free).
func (*View) GetAll ¶
func (v *View) GetAll() map[string]*ServerStatus
GetAll returns all server statuses (lock-free).
func (*View) GetServer ¶
func (v *View) GetServer(name string) (*ServerStatus, bool)
GetServer returns the status for a specific server (lock-free).
func (*View) RemoveServer ¶
RemoveServer removes a server from the view.
func (*View) Snapshot ¶
func (v *View) Snapshot() *ServerStatusSnapshot
Snapshot returns the current immutable snapshot of all server statuses. This is a lock-free read operation.
func (*View) UpdateServer ¶
func (v *View) UpdateServer(name string, fn func(*ServerStatus))
UpdateServer updates or creates a server status entry.