Documentation
¶
Index ¶
- func ListStatusFiles() ([]string, error)
- func ListStatusFilesFromConfigDir(configDir string) ([]string, error)
- type CostTracking
- type FileStatusStore
- func (s *FileStatusStore) GetCostTracking() *CostTracking
- func (s *FileStatusStore) GetFilePath() string
- func (s *FileStatusStore) RemoveFile()
- func (s *FileStatusStore) SetClients(n int)
- func (s *FileStatusStore) SetDashboard(url string)
- func (s *FileStatusStore) SetHTTPFrontend(h *HTTPFrontendStatus)
- func (s *FileStatusStore) UpdateCostTracking(costTracking *CostTracking)
- func (s *FileStatusStore) UpdateServers(servers []ServerStatus)
- type HTTPFrontendStatus
- type ServerStatus
- type StatusInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListStatusFiles ¶
func ListStatusFilesFromConfigDir ¶ added in v0.6.0
Types ¶
type CostTracking ¶ added in v0.7.0
type FileStatusStore ¶
type FileStatusStore struct {
// contains filtered or unexported fields
}
func NewFileStatusStore ¶
func NewFileStatusStore(listenAddr string, logger *slog.Logger) (*FileStatusStore, error)
func NewFileStatusStoreFromConfigDir ¶ added in v0.6.0
func (*FileStatusStore) GetCostTracking ¶ added in v0.7.0
func (s *FileStatusStore) GetCostTracking() *CostTracking
func (*FileStatusStore) GetFilePath ¶
func (s *FileStatusStore) GetFilePath() string
func (*FileStatusStore) RemoveFile ¶
func (s *FileStatusStore) RemoveFile()
func (*FileStatusStore) SetClients ¶ added in v1.1.1
func (s *FileStatusStore) SetClients(n int)
SetClients records how many MCP clients are connected.
func (*FileStatusStore) SetDashboard ¶ added in v1.1.1
func (s *FileStatusStore) SetDashboard(url string)
SetDashboard records the dashboard URL.
func (*FileStatusStore) SetHTTPFrontend ¶ added in v1.1.1
func (s *FileStatusStore) SetHTTPFrontend(h *HTTPFrontendStatus)
SetHTTPFrontend records the exposure of the Streamable HTTP front end.
func (*FileStatusStore) UpdateCostTracking ¶ added in v0.7.0
func (s *FileStatusStore) UpdateCostTracking(costTracking *CostTracking)
func (*FileStatusStore) UpdateServers ¶
func (s *FileStatusStore) UpdateServers(servers []ServerStatus)
type HTTPFrontendStatus ¶ added in v1.1.1
type HTTPFrontendStatus struct {
URL string `json:"url"`
Loopback bool `json:"loopback"`
Auth bool `json:"auth"`
AllowedHosts []string `json:"allowed_hosts,omitempty"`
AllowedOrigins []string `json:"allowed_origins,omitempty"`
MaxSessions int `json:"max_sessions"`
}
HTTPFrontendStatus is the exposure of a Streamable HTTP front end. It never holds the token itself.
type ServerStatus ¶
type ServerStatus struct {
Name string `json:"name"`
Status string `json:"status"`
RequestCount int64 `json:"request_count"`
ErrorCount int64 `json:"error_count"`
RestartCount int `json:"restart_count"`
Uptime string `json:"uptime"`
ToolCount int `json:"tool_count"`
LastActivity time.Time `json:"last_activity"`
// Added with the per-server snapshot (see pool.ServerSnapshot).
Transport string `json:"transport,omitempty"`
State string `json:"state,omitempty"`
Summary string `json:"summary,omitempty"`
LastError string `json:"last_error,omitempty"`
AvgLatencyMs float64 `json:"avg_latency_ms,omitempty"`
InFlight int `json:"in_flight,omitempty"`
PID int `json:"pid,omitempty"`
}
type StatusInfo ¶
type StatusInfo struct {
PID int `json:"pid"`
StartedAt time.Time `json:"started_at"`
ListenAddr string `json:"listen_addr"`
Servers []ServerStatus `json:"servers"`
CostTracking *CostTracking `json:"cost_tracking,omitempty"`
// HTTP describes the exposure of a running Streamable HTTP front end
// (`server run --http`, issue #309), for `doctor security`.
HTTP *HTTPFrontendStatus `json:"http,omitempty"`
// Clients is how many MCP clients are connected to this process.
Clients int `json:"clients"`
// Dashboard is the URL of this process's dashboard, when it has one.
Dashboard string `json:"dashboard,omitempty"`
}
func ReadAllStatus ¶ added in v1.1.1
func ReadAllStatus() ([]StatusInfo, error)
ReadAllStatus returns the status of every proxy process running for this user, the shared HTTP gateway first, then the most recently started. The file of a process that no longer exists (it crashed, or was killed without a chance to clean up) is skipped and removed.
func ReadCurrentStatus ¶
func ReadCurrentStatus() (*StatusInfo, error)
ReadCurrentStatus returns the status of the running proxy: the shared HTTP gateway when there is one, else the most recently started process. It returns nil when none is running. See ReadAllStatus for all of them.
func ReadCurrentStatusFromConfigDir ¶ added in v0.6.0
func ReadCurrentStatusFromConfigDir(configDir string) (*StatusInfo, error)