task

package
v2.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "task"
	Type = "stage"
)

Type of the entity.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task[ProcessingData, ConvertedData any] struct {
	// Logger of the job.
	Logger sypl.ISypl `json:"-"`

	// ID of the job.
	ID string `json:"id,omitempty"`

	// CreatedAt date.
	CreatedAt string `json:"createdAt,omitempty"`

	// Tags of the job, for example, processors adds their name to the tags
	// indicating that they have processed the job.
	Tags []string `json:"tags,omitempty"`

	// ProcessingData is the input of the task.
	ProcessingData []ProcessingData `json:"in" validate:"required"`

	// ConvertedData is the output of the task.
	ConvertedData []ConvertedData `json:"out"`
}

Task encapsulates the work to be done plus some metadata.

func New

func New[ProcessingData, ConvertedData any](
	processingData []ProcessingData,
) (Task[ProcessingData, ConvertedData], error)

New returns a new stage.

Jump to

Keyboard shortcuts

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