executor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package executor provides an abstraction of a job executor.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCIDIsNotValid    = fmt.Errorf("cid is not valid")
	ErrJobNotSuccessful = fmt.Errorf("job was not successful")
)
View Source
var (
	ErrInternalJobNotFound = fmt.Errorf("internal job not found")
	ErrOnlyOneInput        = fmt.Errorf("must only be one input")
	ErrFailJobError        = fmt.Errorf("this is a test job that always fails")
)

Functions

This section is empty.

Types

type BacalhauExecutor

type BacalhauExecutor struct {
	Client *publicapi.RequesterAPIClient
}

func (*BacalhauExecutor) Execute

func (b *BacalhauExecutor) Execute(ctx context.Context, job config.Job, rawJob interface{}) (Result, error)

func (*BacalhauExecutor) Render

func (b *BacalhauExecutor) Render(job config.Job, inputs []ExecutorIOSpec, outputs []ExecutorIOSpec) (interface{}, error)

type Executor

type Executor interface {
	Execute(context.Context, config.Job, interface{}) (Result, error)
	Render(config.Job, []ExecutorIOSpec, []ExecutorIOSpec) (interface{}, error)
}

Executor abstracts the execution of a job

func NewBacalhauExecutor

func NewBacalhauExecutor() Executor

func NewInternalExecutor added in v0.1.1

func NewInternalExecutor() Executor

type ExecutorIOSpec

type ExecutorIOSpec struct {
	Name string
	Ref  string
	Path string
}

type InternalJob added in v0.1.1

type InternalJob interface {
	Execute(context.Context) (Result, error)
}

type Result

type Result struct {
	ID     string
	CID    string
	StdErr string
	StdOut string
	Status string
}

Result is an Amplify abstraction of a job result

Jump to

Keyboard shortcuts

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