Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BulkWatchObject

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

func ParseTrigger

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

func ParseTriggerCondition

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

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

func ParseExecutorResponse

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

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

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)