Documentation
¶
Index ¶
- Variables
- type BadgerTaskStore
- func (s *BadgerTaskStore) Close() error
- func (s *BadgerTaskStore) Delete(ctx context.Context, id string) error
- func (s *BadgerTaskStore) Get(ctx context.Context, id string) (worker.Task, error)
- func (s *BadgerTaskStore) GetByStatus(ctx context.Context, status worker.TaskStatus) ([]worker.Task, error)
- func (s *BadgerTaskStore) GetCompleted(ctx context.Context) ([]worker.Task, error)
- func (s *BadgerTaskStore) GetFailed(ctx context.Context) ([]worker.Task, error)
- func (s *BadgerTaskStore) List(ctx context.Context, filter worker.TaskFilter) ([]worker.Task, error)
- func (s *BadgerTaskStore) Save(ctx context.Context, task worker.Task) error
- func (s *BadgerTaskStore) Update(ctx context.Context, task worker.Task) error
- type MemoryTaskStore
- func (s *MemoryTaskStore) Delete(ctx context.Context, id string) error
- func (s *MemoryTaskStore) Get(ctx context.Context, id string) (worker.Task, error)
- func (s *MemoryTaskStore) GetByStatus(ctx context.Context, status worker.TaskStatus) ([]worker.Task, error)
- func (s *MemoryTaskStore) GetCompleted(ctx context.Context) ([]worker.Task, error)
- func (s *MemoryTaskStore) GetFailed(ctx context.Context) ([]worker.Task, error)
- func (s *MemoryTaskStore) List(ctx context.Context, filter worker.TaskFilter) ([]worker.Task, error)
- func (s *MemoryTaskStore) Save(ctx context.Context, task worker.Task) error
- func (s *MemoryTaskStore) Update(ctx context.Context, task worker.Task) error
- type PersistentTaskStore
- func (s *PersistentTaskStore) Delete(ctx context.Context, id string) error
- func (s *PersistentTaskStore) Get(ctx context.Context, id string) (worker.Task, error)
- func (s *PersistentTaskStore) GetByStatus(ctx context.Context, status worker.TaskStatus) ([]worker.Task, error)
- func (s *PersistentTaskStore) GetCompleted(ctx context.Context) ([]worker.Task, error)
- func (s *PersistentTaskStore) GetFailed(ctx context.Context) ([]worker.Task, error)
- func (s *PersistentTaskStore) List(ctx context.Context, filter worker.TaskFilter) ([]worker.Task, error)
- func (s *PersistentTaskStore) Save(ctx context.Context, task worker.Task) error
- func (s *PersistentTaskStore) Update(ctx context.Context, task worker.Task) error
- type TaskStore
Constants ¶
This section is empty.
Variables ¶
var (
ErrTaskNotFound = errors.New("task not found")
)
Functions ¶
This section is empty.
Types ¶
type BadgerTaskStore ¶
type BadgerTaskStore struct {
// contains filtered or unexported fields
}
BadgerTaskStore implements TaskStore using BadgerDB for persistence
func NewBadgerTaskStore ¶
func NewBadgerTaskStore(dbPath string) (*BadgerTaskStore, error)
NewBadgerTaskStore creates a new BadgerDB-based task store
func (*BadgerTaskStore) Close ¶
func (s *BadgerTaskStore) Close() error
Close closes the BadgerDB connection
func (*BadgerTaskStore) Delete ¶
func (s *BadgerTaskStore) Delete(ctx context.Context, id string) error
func (*BadgerTaskStore) GetByStatus ¶
func (s *BadgerTaskStore) GetByStatus(ctx context.Context, status worker.TaskStatus) ([]worker.Task, error)
Convenience method implementations for BadgerTaskStore
func (*BadgerTaskStore) GetCompleted ¶
func (*BadgerTaskStore) List ¶
func (s *BadgerTaskStore) List(ctx context.Context, filter worker.TaskFilter) ([]worker.Task, error)
type MemoryTaskStore ¶
type MemoryTaskStore struct {
// contains filtered or unexported fields
}
MemoryTaskStore implements TaskStore using in-memory storage
func NewMemoryTaskStore ¶
func NewMemoryTaskStore() *MemoryTaskStore
NewMemoryTaskStore creates a new memory task store
func (*MemoryTaskStore) Delete ¶
func (s *MemoryTaskStore) Delete(ctx context.Context, id string) error
func (*MemoryTaskStore) GetByStatus ¶
func (s *MemoryTaskStore) GetByStatus(ctx context.Context, status worker.TaskStatus) ([]worker.Task, error)
Convenience method implementations for MemoryTaskStore
func (*MemoryTaskStore) GetCompleted ¶
func (*MemoryTaskStore) List ¶
func (s *MemoryTaskStore) List(ctx context.Context, filter worker.TaskFilter) ([]worker.Task, error)
type PersistentTaskStore ¶
type PersistentTaskStore struct {
// contains filtered or unexported fields
}
PersistentTaskStore implements TaskStore with persistence
func NewPersistentTaskStore ¶
func NewPersistentTaskStore(store TaskStore) *PersistentTaskStore
NewPersistentTaskStore creates a new persistent task store
func (*PersistentTaskStore) Delete ¶
func (s *PersistentTaskStore) Delete(ctx context.Context, id string) error
func (*PersistentTaskStore) GetByStatus ¶
func (s *PersistentTaskStore) GetByStatus(ctx context.Context, status worker.TaskStatus) ([]worker.Task, error)
Convenience method implementations for PersistentTaskStore
func (*PersistentTaskStore) GetCompleted ¶
func (*PersistentTaskStore) List ¶
func (s *PersistentTaskStore) List(ctx context.Context, filter worker.TaskFilter) ([]worker.Task, error)
type TaskStore ¶
type TaskStore interface {
// Save stores a task (including its execution state and results)
Save(ctx context.Context, task worker.Task) error
// Get retrieves a task by ID
Get(ctx context.Context, id string) (worker.Task, error)
// List retrieves tasks matching the filter
List(ctx context.Context, filter worker.TaskFilter) ([]worker.Task, error)
// Update updates an existing task (including execution state)
Update(ctx context.Context, task worker.Task) error
// Delete removes a task
Delete(ctx context.Context, id string) error
// GetByStatus retrieves tasks by status (convenience method)
GetByStatus(ctx context.Context, status worker.TaskStatus) ([]worker.Task, error)
// GetCompleted retrieves all completed tasks
GetCompleted(ctx context.Context) ([]worker.Task, error)
// GetFailed retrieves all failed tasks
GetFailed(ctx context.Context) ([]worker.Task, error)
}
TaskStore defines the interface for storing and retrieving tasks with their execution state