transformer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDGenerator

func IDGenerator(_ context.Context, job *models.Job) error

IDGenerator is a transformer that generates a new ID for the job if it is empty.

Types

type ChainedJobTransformer

type ChainedJobTransformer []Job

ChainedJobTransformer is a slice of Transformers that runs in sequence

func (ChainedJobTransformer) Transform

func (ct ChainedJobTransformer) Transform(ctx context.Context, job *models.Job) error

Transform runs all transformers in sequence.

type Job

type Job interface {
	Transform(context.Context, *models.Job) error
}

Job is an interface that can be used to modify a job in place, such as setting default values or migrating.

func DefaultsApplier added in v1.1.0

func DefaultsApplier(defaults JobDefaults) Job

DefaultsApplier is a transformer that applies default values to the job.

func RequesterInfo added in v1.1.0

func RequesterInfo(requesterNodeID string, requesterPubKey model.PublicKey) Job

type JobDefaults added in v1.1.0

type JobDefaults struct {
	ExecutionTimeout time.Duration
}

type JobFn

type JobFn func(context.Context, *models.Job) error

JobFn is a function that implements Job transform interface.

func (JobFn) Transform

func (fn JobFn) Transform(ctx context.Context, job *models.Job) error

Jump to

Keyboard shortcuts

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