sqlite

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteStore

type SQLiteStore struct {
	// contains filtered or unexported fields
}

func New

func New(dsn string) (*SQLiteStore, error)

func (*SQLiteStore) BatchClaimTasks

func (s *SQLiteStore) BatchClaimTasks(workerID string, limit int) ([]*task.Task, error)

BatchClaimTasks claims multiple tasks at once

func (*SQLiteStore) BatchSaveTasks

func (s *SQLiteStore) BatchSaveTasks(tasks []*task.Task) error

BatchSaveTasks saves multiple tasks in a single transaction

func (*SQLiteStore) ClaimTask

func (s *SQLiteStore) ClaimTask(workerID string) (*task.Task, error)

ClaimTask claims a single task for processing

func (*SQLiteStore) Cleanup

func (s *SQLiteStore) Cleanup(completedRetention, failedRetention time.Duration) error

Cleanup removes old completed and failed tasks

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

Close closes the database connection

func (*SQLiteStore) CompleteTask

func (s *SQLiteStore) CompleteTask(id string) error

CompleteTask marks a task as completed

func (*SQLiteStore) FailTask

func (s *SQLiteStore) FailTask(id string, errMsg string) error

FailTask marks a task as failed and handles retries

func (*SQLiteStore) GetStats

func (s *SQLiteStore) GetStats() (*storage.Stats, error)

GetStats returns statistics about tasks

func (*SQLiteStore) GetTask

func (s *SQLiteStore) GetTask(id string) (*task.Task, error)

GetTask retrieves a single task by ID

func (*SQLiteStore) GetTaskHistory

func (s *SQLiteStore) GetTaskHistory(taskID string) ([]*storage.HistoryEntry, error)

GetTaskHistory retrieves the history of a task

func (*SQLiteStore) GetTasks

func (s *SQLiteStore) GetTasks(filter storage.TaskFilter) ([]*task.Task, error)

GetTasks retrieves tasks with filtering

func (*SQLiteStore) Ping

func (s *SQLiteStore) Ping() error

Ping checks the database connection

func (*SQLiteStore) RecordHistory

func (s *SQLiteStore) RecordHistory(taskID, event, message string) error

RecordHistory records an event in task history

func (*SQLiteStore) SaveTask

func (s *SQLiteStore) SaveTask(t *task.Task) error

SaveTask saves a single task to the database

Jump to

Keyboard shortcuts

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