Documentation
¶
Overview ¶
Package collector provides background workers that fetch and update daemon state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface {
// Name returns the collector's name for logging.
Name() string
// Run starts the collector. It should block until context is canceled.
// It emits updates via the updates channel.
// It can read from the store (thread-safe) to get context (e.g. list of workspaces).
Run(ctx context.Context, st *store.Store, updates chan<- store.Update) error
}
Collector is a background worker that fetches data and emits updates.
type GitStatusCollector ¶
type GitStatusCollector struct {
// contains filtered or unexported fields
}
GitStatusCollector updates git status for all workspaces.
func NewGitStatusCollector ¶
func NewGitStatusCollector(interval time.Duration) *GitStatusCollector
NewGitStatusCollector creates a new GitStatusCollector with the specified interval. If interval is 0, defaults to 10 seconds.
func (*GitStatusCollector) Name ¶
func (c *GitStatusCollector) Name() string
Name returns the collector's name.
type NoteCollector ¶
type NoteCollector struct {
// contains filtered or unexported fields
}
NoteCollector updates note counts for all workspaces.
func NewNoteCollector ¶
func NewNoteCollector(interval time.Duration) *NoteCollector
NewNoteCollector creates a new NoteCollector with the specified interval. If interval is 0, defaults to 60 seconds.
func (*NoteCollector) Name ¶
func (c *NoteCollector) Name() string
Name returns the collector's name.
type PlanCollector ¶
type PlanCollector struct {
// contains filtered or unexported fields
}
PlanCollector updates plan statistics for all workspaces.
func NewPlanCollector ¶
func NewPlanCollector(interval time.Duration) *PlanCollector
NewPlanCollector creates a new PlanCollector with the specified interval. If interval is 0, defaults to 30 seconds.
func (*PlanCollector) Name ¶
func (c *PlanCollector) Name() string
Name returns the collector's name.
type SessionCollector ¶
type SessionCollector struct {
// contains filtered or unexported fields
}
SessionCollector monitors active sessions using fsnotify for instant detection and periodic PID verification for liveness checking.
Phase 2 implementation: The daemon becomes the single source of truth for "what sessions are running?" This eliminates redundant scanning of ~/.grove/hooks/sessions by multiple tools.
Phase 3 enhancement: Now includes Flow Jobs and OpenCode sessions via periodic discovery scans, merged with real-time interactive session tracking.
func NewSessionCollector ¶
func NewSessionCollector(interval time.Duration) *SessionCollector
NewSessionCollector creates a new SessionCollector with the specified interval. If interval is 0, defaults to 2 seconds for PID verification.
func (*SessionCollector) GetSession ¶
func (c *SessionCollector) GetSession(id string) *models.Session
GetSession returns a specific session by ID from any source
func (*SessionCollector) GetSessions ¶
func (c *SessionCollector) GetSessions() []*models.Session
GetSessions returns a copy of the current session list from all sources (for direct access)
func (*SessionCollector) Name ¶
func (c *SessionCollector) Name() string
Name returns the collector's name.
type WorkspaceCollector ¶
type WorkspaceCollector struct {
// contains filtered or unexported fields
}
WorkspaceCollector discovers workspaces and maintains the base workspace list.
func NewWorkspaceCollector ¶
func NewWorkspaceCollector(interval time.Duration) *WorkspaceCollector
NewWorkspaceCollector creates a new WorkspaceCollector with the specified interval. If interval is 0, defaults to 30 seconds.
func (*WorkspaceCollector) Name ¶
func (c *WorkspaceCollector) Name() string
Name returns the collector's name.