Documentation
¶
Overview ¶
Package job_compilers contains functionality to convert a Flamenco job definition into concrete tasks and commands to execute by Workers.
Index ¶
- Variables
- func AuthorModule(r *goja.Runtime, module *goja.Object)
- func PathModule(r *goja.Runtime, module *goja.Object)
- func ProcessModule(r *goja.Runtime, module *goja.Object)
- type Author
- type AuthoredCommand
- type AuthoredCommandParameters
- type AuthoredJob
- type AuthoredTask
- type Compiler
- type ErrInvalidRange
- type JobMetadata
- type JobSettings
- type JobStorageInfo
- type Process
- type Service
- type TimeService
- type VM
Constants ¶
This section is empty.
Variables ¶
var ErrJobTypeBadEtag = errors.New("job type etag does not match")
var ErrJobTypeUnknown = errors.New("job type unknown")
var ErrScriptIncomplete = errors.New("job compiler script incomplete")
Functions ¶
func AuthorModule ¶
AuthorModule exports the Author module members to Goja.
func PathModule ¶
PathModule provides file path manipulation functions by wrapping Go's `path`.
Types ¶
type Author ¶
type Author struct {
// contains filtered or unexported fields
}
Author allows scripts to author tasks and commands.
func (*Author) Command ¶
func (a *Author) Command(cmdName string, parameters AuthoredCommandParameters) (*AuthoredCommand, error)
type AuthoredCommand ¶
type AuthoredCommand struct { Name string Parameters AuthoredCommandParameters }
type AuthoredCommandParameters ¶
type AuthoredCommandParameters map[string]interface{}
type AuthoredJob ¶
type AuthoredJob struct { JobID string WorkerTagUUID string Name string JobType string Priority int Status api.JobStatus Created time.Time Settings JobSettings Metadata JobMetadata Storage JobStorageInfo Tasks []AuthoredTask }
func (*AuthoredJob) AddTask ¶
func (aj *AuthoredJob) AddTask(at *AuthoredTask)
type AuthoredTask ¶
type AuthoredTask struct { // Tasks already get their UUID in the authoring stage. This makes it simpler // to store the dependencies, as the code doesn't have to worry about value // vs. pointer semantics. Tasks can always be unambiguously referenced by // their UUID. UUID string Name string Type string Priority int Commands []AuthoredCommand // Dependencies are tasks that need to be completed before this one can run. Dependencies []*AuthoredTask `json:"omitempty" yaml:"omitempty"` }
func (*AuthoredTask) AddCommand ¶
func (at *AuthoredTask) AddCommand(ac *AuthoredCommand)
func (*AuthoredTask) AddDependency ¶
func (at *AuthoredTask) AddDependency(dep *AuthoredTask) error
type ErrInvalidRange ¶
type ErrInvalidRange struct { Range string // The frame range that was invalid. Message string // The error message // contains filtered or unexported fields }
func (ErrInvalidRange) Error ¶
func (e ErrInvalidRange) Error() string
func (ErrInvalidRange) Unwrap ¶
func (e ErrInvalidRange) Unwrap() error
type JobMetadata ¶
type JobSettings ¶
type JobSettings map[string]interface{}
type JobStorageInfo ¶
type JobStorageInfo struct {
ShamanCheckoutID string
}
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process implements a subset of the built-in NodeJS process object. It purely exists to make a few NPM-installed packages work. See https://nodejs.org/api/process.html
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service contains job compilers defined in JavaScript.
func Load ¶
func Load(ts TimeService) (*Service, error)
Load returns a job compiler service with all JS files loaded.
func (*Service) Compile ¶
func (s *Service) Compile(ctx context.Context, sj api.SubmittedJob) (*AuthoredJob, error)
func (*Service) GetJobType ¶
func (s *Service) GetJobType(typeName string) (api.AvailableJobType, error)
GetJobType returns information about the named job type. Returns ErrJobTypeUnknown when the name doesn't correspond with a known job type.
func (*Service) ListJobTypes ¶
func (s *Service) ListJobTypes() api.AvailableJobTypes
ListJobTypes returns the list of available job types.
type TimeService ¶
TimeService is a service that can tell the current time.