engine

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 20 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

func ParseTrigger added in v0.2.0

func ParseTrigger(t TriggerCondition, e Event) (bool, error)

func ParseTriggerCondition added in v0.2.2

func ParseTriggerCondition(input string, e Event) (bool, error)

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)

func (*App) Start

func (app *App) Start()

type Config

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

type Event

type Event struct {
	Type    string
	Model   string
	Kind    string
	Name    string
	Version string
	Object  interface{}
}

type ExecutorResponse added in v0.2.0

type ExecutorResponse struct {
	Message string `json:"message"`
	Status  string `json:"status"`
}

func ParseExecutorResponse added in v0.2.0

func ParseExecutorResponse(body []byte) (ExecutorResponse, error)

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"`
	When string `json:"when"`
}

type Step added in v0.2.2

type Step struct {
	Type        string           `json:"type"`
	StepTrigger TriggerCondition `json:"trigger"`
	Inputs      []string         `json:"inputs"`
	Condition   string           `json:"condition"`
	NextSteps   []NextStep       `json:"nextSteps"`
}

type StepCondition

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

type TriggerCondition added in v0.2.0

type TriggerCondition struct {
	Name      string
	Model     string `json:"model"`
	EventType string `json:"eventType"`
	When      string `json:"when"`
}

type Workflow

type Workflow struct {
	Name    string           `json:"name"`
	StartAt []string         `json:"startAt"`
	Trigger TriggerCondition `json:"trigger"`
	Steps   map[string]Step  `json:"steps"`
}

type WorkflowInstance

type WorkflowInstance struct {
	Workflow     Workflow
	StepTriggers map[string][]TriggerCondition
}

func CreateWorkflowInstance

func CreateWorkflowInstance() WorkflowInstance

func (*WorkflowInstance) ExecuteWorkflow

func (wi *WorkflowInstance) ExecuteWorkflow(kubeconfig *string, logger *zap.Logger, handler handler.Handler, wfObjName string, steps []string, isPendingManualStep bool, nextMatchedSteps []NextStep)

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