Documentation
¶
Overview ¶
Package store provides task persistence and retrieval.
Index ¶
- type FileStore
- func (fs *FileStore) Close() error
- func (fs *FileStore) Delete(id string) error
- func (fs *FileStore) ForceSave() error
- func (fs *FileStore) Get(id string) (*models.Task, error)
- func (fs *FileStore) List(filter ListFilter) ([]*models.Task, error)
- func (fs *FileStore) ListByParentSession(sessionID string) ([]*models.Task, error)
- func (fs *FileStore) Reload() error
- func (fs *FileStore) Save(task *models.Task) error
- func (fs *FileStore) UpdateStatus(id string, status models.TaskStatus) error
- type ListFilter
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore implements Store using a JSON file for persistence.
func NewFileStore ¶
NewFileStore creates a new file-based store.
func (*FileStore) Close ¶
Close stops the background saver and performs final save. Safe to call multiple times.
func (*FileStore) List ¶
func (fs *FileStore) List(filter ListFilter) ([]*models.Task, error)
List retrieves tasks matching the filter.
func (*FileStore) ListByParentSession ¶ added in v0.601.2
ListByParentSession returns all tasks whose ParentSessionID matches the given session id, newest first. It is a thin convenience wrapper over List.
func (*FileStore) UpdateStatus ¶
func (fs *FileStore) UpdateStatus(id string, status models.TaskStatus) error
UpdateStatus updates only the status of a task.
type ListFilter ¶
type ListFilter struct {
Status []models.TaskStatus
Tags []string
Limit int
Offset int
// ParentSessionID, when non-empty, restricts results to tasks whose
// ParentSessionID matches exactly. Used for delegation correlation queries.
ParentSessionID string
}
ListFilter defines criteria for listing tasks.
type Store ¶
type Store interface {
Save(task *models.Task) error
Get(id string) (*models.Task, error)
List(filter ListFilter) ([]*models.Task, error)
// ListByParentSession returns tasks correlated to the given parent agent
// session id (see Task.ParentSessionID). Used by delegation phases to find
// the tasks spawned by a session; no consumer reads it yet.
ListByParentSession(sessionID string) ([]*models.Task, error)
Delete(id string) error
UpdateStatus(id string, status models.TaskStatus) error
Close() error
}
Store defines the interface for task storage.
Click to show internal directories.
Click to hide internal directories.