# Functions
NewJetStreamRepository creates a new JetStream-backed task repository.
NewPayload creates a new payload with the given type and data.
NewProcessor creates a new task processor.
NewTask creates a new TaskBuilder with the given name This is the only required field when creating a task.
RegisterDefaultHandlers registers all default task handlers with the processor.
WithDelay returns a TaskOption that sets the task delay duration.
WithDescription returns a TaskOption that sets the task description.
WithMaxRetries returns a TaskOption that sets the maximum number of retries.
WithMetadata returns a TaskOption that adds metadata to the task.
WithPayload returns a TaskOption that sets the task payload.
WithPriority returns a TaskOption that sets the task priority.
WithSchedule returns a TaskOption that sets the task schedule.
WithTags returns a TaskOption that sets the task tags.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
ErrEmptyTaskName is returned when a task name is empty.
ErrInvalidPriority is returned when a task priority is invalid.
ErrInvalidProgress is returned when progress is not between 0 and 100.
ErrInvalidStatus is returned when a task status is invalid.
ErrInvalidTaskID is returned when a task ID is invalid.
ErrTaskAlreadyExists is returned when a task with the same ID already exists.
ErrTaskNameRequired is returned when a task name is empty.
ErrTaskNotFound is returned when a task is not found.
ErrTaskPriorityRequired is returned when a task priority is empty.
ErrTaskStatusRequired is returned when a task status is empty.
# Structs
Filter defines criteria for filtering tasks.
JetStreamRepository implements Repository using NATS JetStream.
Payload represents the task payload data.
Processor manages task handlers and processes tasks.
Task represents a unit of work in the system.
TaskBuilder provides a fluent interface for building tasks Required fields: - Name (set via NewTask)
Optional fields with default values: - Status: StatusPending - Priority: PriorityMedium - MaxRetries: 3 - Progress: 0 - Tags: empty slice - Metadata: empty map - RetryCount: 0
Optional fields without defaults: - Description - Payload - Schedule (cron expression) - DelayDuration.
# Interfaces
Repository defines the interface for task storage operations.
# Type aliases
Handler is a function that processes a task.
Priority represents the importance level of a task.
Status represents the current state of a task.
TaskOption defines a function type for configuring tasks.