task

package
v1.0.53 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProgressTracker

type ProgressTracker interface {
	Increment(success bool, err error)
	Complete() // Ensures any remaining updates are flushed
}

ProgressTracker defines the interface for tracking task progress

type Repository

type Repository interface {
	// Standard CRUD operations
	Create(ctx context.Context, task *Task) error
	Get(ctx context.Context, id string) (*Task, error)
	List(ctx context.Context, filter *types.TaskFilter) ([]*Task, error)
	Count(ctx context.Context, filter *types.TaskFilter) (int, error)
	Update(ctx context.Context, task *Task) error
	Delete(ctx context.Context, id string) error
}

Repository defines the interface for task operations

type Task

type Task struct {
	ID                string                 `json:"id"`
	TaskType          types.TaskType         `json:"task_type"`
	EntityType        types.EntityType       `json:"entity_type"`
	ScheduledTaskID   string                 `json:"scheduled_task_id,omitempty"`
	WorkflowID        *string                `json:"workflow_id,omitempty"`
	FileURL           string                 `json:"file_url"`
	FileName          *string                `json:"file_name,omitempty"`
	FileType          types.FileType         `json:"file_type"`
	TaskStatus        types.TaskStatus       `json:"task_status"`
	TotalRecords      *int                   `json:"total_records"`
	ProcessedRecords  int                    `json:"processed_records"`
	SuccessfulRecords int                    `json:"successful_records"`
	FailedRecords     int                    `json:"failed_records"`
	ErrorSummary      *string                `json:"error_summary"`
	Metadata          map[string]interface{} `json:"metadata"`
	StartedAt         *time.Time             `json:"started_at"`
	CompletedAt       *time.Time             `json:"completed_at"`
	FailedAt          *time.Time             `json:"failed_at"`
	EnvironmentID     string                 `json:"environment_id"`
	types.BaseModel
}

func FromEnt

func FromEnt(e *ent.Task) *Task

FromEnt converts ent.Task to domain Task

func FromEntList

func FromEntList(list []*ent.Task) []*Task

FromEntList converts a list of ent.Task to domain Tasks

func (*Task) Validate

func (t *Task) Validate() error

Validate validates the task

Jump to

Keyboard shortcuts

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