Documentation
¶
Overview ¶
Package store provides the in-memory state store for the grove daemon.
Index ¶
- type State
- type Store
- func (s *Store) ApplyUpdate(u Update)
- func (s *Store) Get() State
- func (s *Store) GetFocus() map[string]struct{}
- func (s *Store) GetSessions() []*models.Session
- func (s *Store) GetWorkspaces() []*enrichment.EnrichedWorkspace
- func (s *Store) IsFocused(path string) bool
- func (s *Store) SetFocus(paths []string)
- func (s *Store) Subscribe() chan Update
- func (s *Store) Unsubscribe(ch chan Update)
- type Update
- type UpdateType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct {
Workspaces map[string]*enrichment.EnrichedWorkspace `json:"workspaces"` // Keyed by path
Sessions map[string]*models.Session `json:"sessions"` // Keyed by ID
}
State represents the complete world view of the daemon.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the in-memory state store for the daemon. It is thread-safe and supports pub/sub for real-time updates.
func (*Store) ApplyUpdate ¶
ApplyUpdate modifies the state and notifies subscribers.
func (*Store) GetSessions ¶
GetSessions returns a slice of all sessions.
func (*Store) GetWorkspaces ¶
func (s *Store) GetWorkspaces() []*enrichment.EnrichedWorkspace
GetWorkspaces returns a slice of all enriched workspaces.
func (*Store) SetFocus ¶
SetFocus updates the set of focused workspace paths. Focused workspaces get priority scanning by collectors.
func (*Store) Unsubscribe ¶
Unsubscribe removes a subscription and closes its channel.
type Update ¶
type Update struct {
Type UpdateType
Source string // Which collector sent this update (e.g., "git", "workspace", "session", "plan", "note")
Scanned int // Number of items actually scanned (for focused updates)
Payload interface{}
}
Update represents a change to the state.
type UpdateType ¶
type UpdateType string
UpdateType defines what kind of data changed.
const ( UpdateWorkspaces UpdateType = "workspaces" UpdateSessions UpdateType = "sessions" UpdateFocus UpdateType = "focus" )