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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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