pipeline

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResType = "cam"
)

Variables

View Source
var DefaultManager *resource.Manager

Functions

func GetDataResolver

func GetDataResolver() resolve.CompositeResolver

func GetManager

func GetManager() *resource.Manager

func GetMapperFactory

func GetMapperFactory() mapper.Factory

func NewDefaultOperationOutputMapper

func NewDefaultOperationOutputMapper(stage *Stage) mapper.Mapper

func NewPipelineScope

func NewPipelineScope(input map[string]interface{}, labels map[string]interface{}) (data.Scope, error)

NewPipelineScope gets the scope from the input and label map.

func NewResourceLoader

func NewResourceLoader(mapperFactory mapper.Factory, resolver resolve.CompositeResolver) resource.Loader

func SetMapperFactory

func SetMapperFactory(factory mapper.Factory)

Types

type BasicRemotePipelineProvider

type BasicRemotePipelineProvider struct {
}

func (*BasicRemotePipelineProvider) GetPipeline

func (*BasicRemotePipelineProvider) GetPipeline(pipelineURI string) (*DefinitionConfig, error)

type Definition

type Definition struct {
	// contains filtered or unexported fields
}

Defination struct

func NewDefinition

func NewDefinition(config *DefinitionConfig, mf mapper.Factory, resolver resolve.CompositeResolver) (*Definition, error)

NewDefinition gets a defination struct from config.

func (*Definition) MetaData added in v0.2.5

func (d *Definition) MetaData() *metadata.IOMetadata

func (*Definition) Name

func (d *Definition) Name() string

type DefinitionConfig

type DefinitionConfig struct {
	Name   string          `json:"name"`
	Tasks  []TaskConfig    `json:"structure"`
	Input  []PipelineInput `json:"input"`
	Output PipelineOutput  `json:"output"`
}

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance(definition *Definition, id string, logger log.Logger) *Instance

NewInstance gets new instance from defination

func (*Instance) Id

func (inst *Instance) Id() string

func (*Instance) Run

func (inst *Instance) Run(input map[string]interface{}) (output map[string]interface{}, err error)

Run runs the instance of the CML.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) GetPipeline

func (m *Manager) GetPipeline(uri string) (*Definition, error)

type NewDefaultMapperFactory

type NewDefaultMapperFactory struct {
}

func (*NewDefaultMapperFactory) NewMapper

func (n *NewDefaultMapperFactory) NewMapper(mappings map[string]interface{}) (mapper.Mapper, error)

Newmapper gets the mapper from the mappings.

type PipelineInput

type PipelineInput struct {
	Type      string      `json:"type"`
	Dimension int         `json:"dimension"`
	Shape     []int       `json:"shape"`
	Label     interface{} `json:"label"`
}

Input of the CML Pipeline.

type PipelineOutput

type PipelineOutput struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
}

Output of CML Pipeline

type ResourceLoader

type ResourceLoader struct {
	// contains filtered or unexported fields
}

func (*ResourceLoader) LoadResource

func (rl *ResourceLoader) LoadResource(config *resource.Config) (*resource.Resource, error)

Load Reasource from the config.

type Stage

type Stage struct {
	// contains filtered or unexported fields
}

func NewStage

func NewStage(config *StageConfig, mf mapper.Factory, resolver resolve.CompositeResolver) (*Stage, error)

NewStage gets the satage from the stage config.

type StageConfig

type StageConfig struct {
	*operation.Config
}

type Task added in v0.2.5

type Task interface {
	Eval(scope data.Scope, logger log.Logger) (data.Scope, error)
	Name() string
	Position()
}

func NewTask added in v0.2.5

func NewTask(config TaskConfig, mf mapper.Factory, resolver resolve.CompositeResolver) (Task, error)

NewTask returns a Task based on the TaskConfig.

type TaskConfig added in v0.2.5

type TaskConfig struct {
	Operation string      `json:"operation,required"`
	Params    interface{} `json:"params,omitempty"`
	Input     interface{} `json:"input,omitempty"`
	Output    interface{} `json:"output,required"`
}

Config of Task.

type TaskImpl added in v0.2.5

type TaskImpl struct {
	// contains filtered or unexported fields
}

func (TaskImpl) Eval added in v0.2.5

func (t TaskImpl) Eval(scope data.Scope, logger log.Logger) (data.Scope, error)

Eval runs the Task. A Task is composed of single or multiple stages.

func (TaskImpl) Name added in v0.2.5

func (t TaskImpl) Name() string

func (TaskImpl) Position added in v0.2.8

func (t TaskImpl) Position()

Jump to

Keyboard shortcuts

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