polaris

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

README

An extremely light weight workflow orchestrator for Golang.

Installation | Documentation | Twitter | Inspiration

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRegistry

func InitRegistry(ds IDataStore)

func Name

func Name(strucc interface{}) string

func RegisterWorkflow

func RegisterWorkflow(workflowKey string, workflow IWorkflow) error

Types

type BuilderContext

type BuilderContext struct {
	DataSet DataSet
}

func (*BuilderContext) Get added in v1.0.2

func (bc *BuilderContext) Get(data IData) (IData, bool)

type BuilderInfo

type BuilderInfo struct {
	Consumes  []IData
	Optionals []IData
	Accesses  []IData
	Produces  IData
}

type BuilderMeta

type BuilderMeta struct {
	Consumes  mapset.Set[string]
	Optionals mapset.Set[string]
	Accesses  mapset.Set[string]
	Produces  string
	Name      string
	Rank      int
	Type      reflect.Type
}

func (*BuilderMeta) EffectiveConsumes

func (meta *BuilderMeta) EffectiveConsumes() mapset.Set[string]

type DataExecutionResponse

type DataExecutionResponse struct {
	Responses map[string]IData
}

func (*DataExecutionResponse) Get added in v1.0.2

func (de *DataExecutionResponse) Get(data IData) (IData, bool)

type DataFlow

type DataFlow struct {
	Name                string
	TargetData          string
	DependencyHierarchy [][]BuilderMeta
	// contains filtered or unexported fields
}

type DataSet

type DataSet struct {
	AvailableData map[string]IData
}

type Executor

type Executor struct {
	Before func(builder reflect.Type, delta []IData) // TODO: add trigger delta
	After  func(builder reflect.Type, produced IData)
}

func (*Executor) Parallel

func (e *Executor) Parallel(workflowKey string, workflowId string, data ...IData) (DataExecutionResponse, error)

* This is experimental and severely untested. Use with caution.

func (*Executor) Sequential

func (e *Executor) Sequential(workflowKey string, workflowId string, data ...IData) (DataExecutionResponse, error)

type IBuilder

type IBuilder interface {
	GetBuilderInfo() BuilderInfo
	Process(BuilderContext) IData
}

type IData

type IData interface {
}

type IDataStore

type IDataStore interface {
	Write(key string, value interface{})
	Read(key string) (interface{}, bool)
}

type IWorkflow

type IWorkflow interface {
	GetWorkflowMeta() WorkflowMeta
}

type MetaDataManager

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

type WorkflowMeta

type WorkflowMeta struct {
	Builders   []IBuilder
	TargetData IData
}

Jump to

Keyboard shortcuts

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