engine

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: Apache-2.0 Imports: 12 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

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"`
}

func LoadConfig

func LoadConfig(filePath string) Config

func ParseConfig

func ParseConfig(filePath string) Config

type Event

type Event struct {
	Type  string
	Model string
}

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

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 TriggerCondition added in v0.2.0

type TriggerCondition struct {
	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]NextSteps `json:"steps"`
}

func ParseDefinition

func ParseDefinition(filePath string) Workflow

type WorkflowInstance

type WorkflowInstance struct {
	Workflow   Workflow
	Kubeconfig *string
	WFObjName  string
}

func CreateWorkflowInstance

func CreateWorkflowInstance() WorkflowInstance

func (*WorkflowInstance) ExecuteWorkflow

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

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