engine

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BulkWatchObject added in v0.1.6

func BulkWatchObject(kubeconfig *string, namespace string, gvrList []GVR) <-chan watch.Event

Types

type App

type App struct {
	WorkflowInstances []WorkflowInstance
	ModelGVRMap       map[string]GVR
	StartAt           time.Time
}

func CreateApp

func CreateApp() App

func (*App) RegisterConfig

func (app *App) RegisterConfig(f func() Config)

func (*App) RegisterWorkflow

func (app *App) RegisterWorkflow(definition func() Workflow, steps func() map[string]func(handler handler.Handler), trigger func(event Event) bool)

func (*App) Start

func (app *App) Start()

type Config

type Config struct {
	GVRMap map[string]GVR `json:"gvr"`
}

func LoadConfig

func LoadConfig(filePath string) Config

func ParseConfig

func ParseConfig(filePath string) Config

type Event

type Event struct {
	Type  string
	Model string
}

type GVR

type GVR struct {
	Group    string `json:"group"`
	Version  string `json:"version"`
	Resource string `json:"resource"`
}

type NextStep

type NextStep struct {
	Name      string        `json:"name"`
	Condition StepCondition `json:"condition"`
}

type NextSteps

type NextSteps struct {
	NextSteps []NextStep `json:"nextSteps"`
}

type StepCondition

type StepCondition struct {
	Key      string `json:"key"`
	Value    string `json:"value"`
	Operator string `json:"operator"`
}

type Workflow

type Workflow struct {
	Name    string               `json:"name"`
	StartAt string               `json:"startAt"`
	Steps   map[string]NextSteps `json:"steps"`
}

func ParseDefinition

func ParseDefinition(filePath string) Workflow

type WorkflowInstance

type WorkflowInstance struct {
	Workflow   Workflow
	StepFunc   map[string]func(handler handler.Handler)
	Trigger    func(event Event) bool
	Kubeconfig *string
	WFObjName  string
}

func CreateWorkflowInstance

func CreateWorkflowInstance() WorkflowInstance

func (*WorkflowInstance) ExecuteWorkflow

func (wi *WorkflowInstance) ExecuteWorkflow(handler handler.Handler)

func (*WorkflowInstance) RegisterSteps

func (wi *WorkflowInstance) RegisterSteps(f func() map[string]func(handler handler.Handler))

func (*WorkflowInstance) RegisterTrigger

func (wi *WorkflowInstance) RegisterTrigger(f func(event Event) bool)

func (*WorkflowInstance) RegisterWorkflowDefinition

func (wi *WorkflowInstance) RegisterWorkflowDefinition(f func() Workflow)

Jump to

Keyboard shortcuts

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