Versions in this module Expand all Collapse all v1 v1.0.2 Sep 7, 2026 v1.0.1 Sep 7, 2026 v1.0.0 Sep 7, 2026 Changes in this version + const ActionApt + const ActionBuild + const ActionCustom + const ActionLogs + const ActionPull + const ActionReboot + const ActionRestart + func LoadEnv(paths ...string) + type ActionEvent struct + ActionID string + Address string + Chunk string + Command string + DurationMs int64 + Error string + ExitCode int + NodeID string + Status string + Stream string + Type string + type ActionRequest struct + ActionType string + AptMode string + CustomCommand string + GitBranch string + LogLines int + LogMode string + LogPath string + MakeTarget string + RepoPath string + RestartMode string + RestartParams map[string]*NodeRestartParams + SSHKeyPath string + SSHPort int + SSHUser string + TargetNodeIDs []string + TargetService string + TimeoutSeconds int + type AdminServer struct + func NewAdminServer(stateFile, staticDir string) *AdminServer + func (a *AdminServer) AlertManager() *AlertManager + func (a *AdminServer) AuthManager() *AuthManager + func (a *AdminServer) CallSetQuota(address string, username string, quotaBytes uint64) error + func (a *AdminServer) FetchNodeLogs(ctx context.Context, nodeID string, service string, lines int, mode string, ...) (*LogTailResponse, error) + func (a *AdminServer) History() *CommandHistory + func (a *AdminServer) IsTLS() bool + func (a *AdminServer) LoadMetricsSnapshot(filePath string) error + func (a *AdminServer) Orchestrator() *Orchestrator + func (a *AdminServer) Run(port int) error + func (a *AdminServer) SaveMetricsSnapshot(filePath string) error + func (a *AdminServer) SetAlertManager(am *AlertManager) + func (a *AdminServer) SetAuthManager(am *AuthManager) + func (a *AdminServer) SetHistory(h *CommandHistory) + func (a *AdminServer) SetOrchestrator(o *Orchestrator) + func (a *AdminServer) SetTLS(certFile, keyFile string) + func (a *AdminServer) Stop() + type Alert struct + ID string + Message string + NodeID string + NodeName string + Resolved bool + ResolvedAt int64 + Severity AlertSeverity + Timestamp int64 + Title string + Type AlertType + Username string + type AlertFilters struct + Limit int + NodeID string + Severity string + Unresolved bool + type AlertManager struct + func NewAlertManager(capacity int, filePath string) *AlertManager + func (am *AlertManager) CheckNodeHealth(node *NodeState, prevLastSeen int64, prevUptime float64) + func (am *AlertManager) CheckUserQuota(username string, used, quota uint64, homeNodeID, homeNodeLabel string) + func (am *AlertManager) GetAll(f AlertFilters) []Alert + func (am *AlertManager) ResolveAlert(id string) bool + func (am *AlertManager) ResolveAll() int + func (am *AlertManager) Summary() AlertSummary + type AlertSeverity string + const SeverityCritical + const SeverityInfo + const SeverityWarning + type AlertSummary struct + CriticalCount int + InfoCount int + TotalUnresolved int + WarningCount int + type AlertType string + const AlertTypeErrorSpike + const AlertTypeNodeOffline + const AlertTypeNodeOnline + const AlertTypeQuotaExceeded + const AlertTypeServiceRestart + const AlertTypeStorageWarning + const AlertTypeTempWarning + type AuthManager struct + func NewAuthManager(envPaths ...string) *AuthManager + func (am *AuthManager) CreateSession() string + func (am *AuthManager) ExtractToken(r *http.Request) string + func (am *AuthManager) GetHash() string + func (am *AuthManager) IsAuthenticated(r *http.Request) bool + func (am *AuthManager) RequireAuth(next http.HandlerFunc) http.HandlerFunc + func (am *AuthManager) RevokeSession(token string) + func (am *AuthManager) SetHash(hash string) + func (am *AuthManager) VerifyPassword(candidate string) bool + type ClusterHistorySnapshot struct + ActiveConnections int + ErrorRatePct float64 + ReadIOPS float64 + ReadMbps float64 + Timestamp int64 + WriteIOPS float64 + WriteMbps float64 + type ClusterResponse struct + ClusterErrorRatePct float64 + ClusterReadIOPS float64 + ClusterReadMbps float64 + ClusterWriteIOPS float64 + ClusterWriteMbps float64 + NodeCount int + Nodes []*NodeState + OnlineCount int + OnlineUsers int + TotalStorageBytes uint64 + TotalUsers int + UsedStorageBytes uint64 + Users map[string]string + type CommandHistory struct + func NewCommandHistory(capacity int, filePath string) *CommandHistory + func (ch *CommandHistory) Count() int + func (ch *CommandHistory) GetAll() []CommandRecord + func (ch *CommandHistory) GetByID(id string) (*CommandRecord, bool) + func (ch *CommandHistory) Push(r CommandRecord) + func (ch *CommandHistory) Update(r CommandRecord) + type CommandRecord struct + ActionType string + Command string + DurationMs int64 + ID string + NodeResults map[string]*NodeResult + Status string + TargetNodes []string + Timestamp int64 + type FSInfo struct + Address string + LastHeartbeatUnix int64 + Status string + UserCount int + type FileserverMetrics struct + ActiveConnections int + ActiveUsers []string + BytesReadTotal uint64 + BytesWrittenTotal uint64 + CPUTempCelsius float64 + CPUUsagePercent float64 + ChunkCount int + DiskFreeBytes uint64 + DiskTotalBytes uint64 + DiskUsagePercent float64 + DiskUsedBytes uint64 + ErrorsTotal uint64 + FailedReadsTotal uint64 + FailedWritesTotal uint64 + LastRestartUnix int64 + LoadAvg1m float64 + LoadAvg5m float64 + MemTotalBytes uint64 + MemUsagePercent float64 + MemUsedBytes uint64 + OpLatencyReadMsP50 float64 + OpLatencyReadMsP95 float64 + OpLatencyReadMsP99 float64 + OpLatencyWriteMsP50 float64 + OpLatencyWriteMsP95 float64 + OpLatencyWriteMsP99 float64 + PerUserQuota map[string]uint64 + PerUserStorage map[string]uint64 + ReadOpsTotal uint64 + UptimeSeconds float64 + UsersAssigned int + WriteOpsTotal uint64 + type LogTailResponse struct + Address string + Content string + Lines int + NodeID string + Service string + Timestamp int64 + type MetaState struct + FileServers map[string]FSInfo + NextFsID uint64 + Users map[string]uint64 + func LoadMetaState(path string) (*MetaState, error) + type MetricsSnapshotFile struct + NodeData map[string]NodeHistoryStore + SavedAt int64 + type MockSSHCall struct + Command string + Host string + KeyPath string + Port int + User string + type MockSSHExecutor struct + Calls []MockSSHCall + Default MockSSHResponse + Responses map[string]MockSSHResponse + func NewMockSSHExecutor() *MockSSHExecutor + func (m *MockSSHExecutor) Run(ctx context.Context, host string, port int, user string, keyPath string, ...) (int, error) + type MockSSHResponse struct + Delay time.Duration + Err error + ExitCode int + Stderr string + Stdout string + type NodeHistoryStore struct + FsID string + Snapshots []Snapshot + type NodePerformance struct + ActiveConnections int + Address string + DisplayID int + DisplayName string + ErrorRatePct float64 + FsID string + LatencyReadP50 float64 + LatencyReadP95 float64 + LatencyReadP99 float64 + LatencyWriteP50 float64 + LatencyWriteP95 float64 + LatencyWriteP99 float64 + MachineName string + ReadIOPS float64 + ReadMbps float64 + Status string + WriteIOPS float64 + WriteMbps float64 + type NodeRestartParams struct + Address string + DataDir string + FsID string + Host string + MetaAddr string + OwnIP string + Port int + SSHPort int + SSHUser string + type NodeResult struct + Address string + DurationMs int64 + Error string + ExitCode int + NodeID string + Output string + type NodeState struct + Address string + DisplayID int + DisplayName string + ErrorRatePct float64 + FsID string + History *RingBuffer + LastSeen int64 + MachineName string + Metrics *FileserverMetrics + MetricsURL string + ReadIOPS float64 + ReadMbps float64 + ReadThroughputBps float64 + Status NodeStatus + WriteIOPS float64 + WriteMbps float64 + WriteThroughputBps float64 + type NodeStatus string + const StatusCritical + const StatusDegraded + const StatusOffline + const StatusOnline + const StatusWarning + type NodeUserStorage struct + Address string + DisplayID int + DisplayName string + FsID string + MachineName string + QuotaBytes uint64 + UsedBytes uint64 + type Orchestrator struct + func NewOrchestrator(server *AdminServer, ssh SSHExecutor, history *CommandHistory, ...) *Orchestrator + func (o *Orchestrator) Execute(ctx context.Context, req ActionRequest, onEvent func(ActionEvent)) (*CommandRecord, error) + func (o *Orchestrator) FormatCommand(req *ActionRequest, nodeID string, params *NodeRestartParams) string + func (o *Orchestrator) GetPresets() map[string]*NodeRestartParams + type PerformanceResponse struct + ClusterErrorRatePct float64 + ClusterReadIOPS float64 + ClusterReadMbps float64 + ClusterWriteIOPS float64 + ClusterWriteMbps float64 + Nodes []NodePerformance + type RemoteSSHExecutor struct + func NewRemoteSSHExecutor() *RemoteSSHExecutor + func (r *RemoteSSHExecutor) Run(ctx context.Context, host string, port int, user string, keyPath string, ...) (int, error) + type RingBuffer struct + func NewRingBuffer(size int) *RingBuffer + func (rb *RingBuffer) GetAll() []Snapshot + func (rb *RingBuffer) GetLast() (Snapshot, bool) + func (rb *RingBuffer) Push(s Snapshot) + type SSHExecutor interface + Run func(ctx context.Context, host string, port int, user string, keyPath string, ...) (int, error) + type SetQuotaPayload struct + QuotaBytes uint64 + type Snapshot struct + ErrorRatePct float64 + Metrics FileserverMetrics + ReadIOPS float64 + ReadMbps float64 + ReadThroughputBps float64 + Timestamp int64 + WriteIOPS float64 + WriteMbps float64 + WriteThroughputBps float64 + type UserSummary struct + ActiveSessions int + HomeFsAddress string + HomeFsDisplay string + HomeFsID string + HomeFsMachine string + IsOnline bool + Nodes []NodeUserStorage + QuotaLimit uint64 + QuotaUsed uint64 + UsagePercent float64 + Username string + type WebSocketHandler struct + func NewWebSocketHandler(orchestrator *Orchestrator, authManager ...*AuthManager) *WebSocketHandler + func (h *WebSocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)