Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShouldTranslate ¶
func ShouldTranslate(ctx context.Context, provider TranslatorProvider, tasks []*models.Task) (bool, error)
ShouldTranslate works out whether we need to carry on with translation, that is are there any engine types specified that are not a default engine and we know how to translate. If not, then we can exit early.
func Translate ¶
func Translate(ctx context.Context, provider TranslatorProvider, original *models.Job) (*models.Job, error)
Translate attempts to translate from one job to another, based on the engine type of the tasks in the job. After ensuring that each of the tasks is either a default (docker, wasm) or available via the provider, then a new Job is cloned from the original and the individual tasks updated.
Types ¶
type Translator ¶
Translator defines what functions are required for a component that is able to translate from one job to another. It is important that implementers ensure that their implementation is reentrant - which means it should not use any mutable state after initialization.
type TranslatorProvider ¶
type TranslatorProvider interface { provider.Provider[Translator] }
TranslatorProvider is an alias for `provider.Provider[Translator]`
func NewStandardTranslatorsProvider ¶
func NewStandardTranslatorsProvider() TranslatorProvider
NewStandardTranslatorsProvider returns a TranslatorProvider which maps names to implementations of the Translator interface