runtime_registry

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Source_ContentType_Text   SourceContentType = iota
	Source_ContentType_Binary                   = iota

	LogLevelInfo LogLevel = iota
	LogLevelDebug
	LogLevelWarning
	LogLevelError
	LogLevelSilent
)

Variables

This section is empty.

Functions

func RegisterRuntime

func RegisterRuntime(name string, factory func() Runner)

not thread safe, should be called as part of init

Types

type BindingSettings

type BindingSettings struct {
	Settings map[string]interface{} `json:"settings"`
}

func (BindingSettings) MarshalJSON

func (settings BindingSettings) MarshalJSON() ([]byte, error)

func (*BindingSettings) UnmarshalJSON

func (settings *BindingSettings) UnmarshalJSON(data []byte) error

type ExecutionMetadata

type ExecutionMetadata struct {
	StartedAt          time.Time     `json:"started_at"`
	ExecutionDuration  time.Duration `json:"execution_duration"`
	HasRunToCompletion bool          `json:"has_run_to_completion"`
}

type ExecutionResult

type ExecutionResult interface {
	ExecutionMetadata() ExecutionMetadata
	GetExitResult() interface{}
	GetContext() RuntimeContext
}

type IntrospectedExport

type IntrospectedExport interface {
	HasExport() bool
	Value() interface{}
	ValueAsMap() map[string]interface{}
	BindingsFrom(exportName string) map[string]BindingSettings
}

type IntrospectionOptions

type IntrospectionOptions struct {
	Exports []string
	Logger  Logger
}

type IntrospectionResult

type IntrospectionResult interface {
	GetExport(string) IntrospectedExport
}

type LogLevel

type LogLevel int

type Logger

type Logger interface {
	Log(level LogLevel, params ...interface{})
}

type Runner

type Runner interface {
	// Execute the workflow
	Execute(ctx context.Context, workflow WorkflowDescriptor, startOptions StartOptions) (ExecutionResult, error)
	// Introspect the workflow for exports without executing it
	Introspect(ctx context.Context, workflow WorkflowDescriptor, options IntrospectionOptions) (IntrospectionResult, error)
}

func ResolveRuntime

func ResolveRuntime(name string) (Runner, error)

Resolves runtime from available registrations

type RuntimeContext

type RuntimeContext interface {
	GetValues() map[string]interface{}
	GetValueAsMap(key string) (map[string]interface{}, error)
}

type RuntimeLimits

type RuntimeLimits struct {
	MaxExecutionDuration time.Duration `json:"max_execution_duration"`
}

type SourceContentType

type SourceContentType int

type SourceDescriptor

type SourceDescriptor struct {
	Source     []byte            `json:"source"`
	SourceType SourceContentType `json:"source_type"`
	BuildHash  string            `json:"build_hash"`
}

type StartOptions

type StartOptions struct {
	EntryPoint string
	Arguments  []interface{}
	Loggger    Logger
}

type WorkflowDescriptor

type WorkflowDescriptor struct {
	ProcessedSource   SourceDescriptor           `json:"processed_source"`
	RequestedBindings map[string]BindingSettings `json:"bindings"`
	Limits            RuntimeLimits              `json:"runtime_limits"`
}

func (*WorkflowDescriptor) GetHash

func (wd *WorkflowDescriptor) GetHash() string

Returns a hash of the workflow descriptor

Jump to

Keyboard shortcuts

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