collector

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 20 Imported by: 0

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.

func (*GitStatusCollector) Run

func (c *GitStatusCollector) Run(ctx context.Context, st *store.Store, updates chan<- store.Update) error

Run starts the git status collection loop.

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.

func (*NoteCollector) Run

func (c *NoteCollector) Run(ctx context.Context, st *store.Store, updates chan<- store.Update) error

Run starts the note counts collection loop.

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.

func (*PlanCollector) Run

func (c *PlanCollector) Run(ctx context.Context, st *store.Store, updates chan<- store.Update) error

Run starts the plan stats collection loop.

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.

func (*SessionCollector) Run

func (c *SessionCollector) Run(ctx context.Context, st *store.Store, updates chan<- store.Update) error

Run starts the session monitoring loop with fsnotify watching.

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.

func (*WorkspaceCollector) Run

func (c *WorkspaceCollector) Run(ctx context.Context, st *store.Store, updates chan<- store.Update) error

Run starts the workspace discovery loop.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL