velaql

package
v1.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// PatternQL is the pattern string of velaQL, velaQL's query syntax is `ViewName{key1=value1 ,key2="value2",}.Export`
	PatternQL = `(?P<view>[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?)(?P<parameter>{.*?})?\.?(?P<export>[_a-zA-Z][\._a-zA-Z0-9]*)?`
	// PatternKV is the pattern string of parameter
	PatternKV = `(?P<key>[^=]+)=(?P<value>[^=]*?)(?:,|$)`
	// KeyWordView represent view keyword
	KeyWordView = "view"
	// KeyWordParameter represent parameter keyword
	KeyWordParameter = "parameter"
	// KeyWordExport represent export keyword
	KeyWordExport = "export"
	// DefaultExportValue is the default Export value
	DefaultExportValue = "status"
)
View Source
const (

	// ViewTaskPhaseSucceeded means view task run succeeded.
	ViewTaskPhaseSucceeded = "succeeded"
)

Variables

View Source
var OutputsTemplate = `
{
    "outputs": [
        {
            "valueFrom": "%s",
            "name": "%s"
        }
    ]
}
`

OutputsTemplate output template

Functions

func NewViewContext

func NewViewContext() (wfContext.Context, error)

NewViewContext new view context

func ParseParameter

func ParseParameter(parameter string) (map[string]interface{}, error)

ParseParameter parse parameter to map[string]interface{}

Types

type QueryParameterKey

type QueryParameterKey struct {
	Outputs common.StepOutputs `json:"outputs"`
}

QueryParameterKey query parameter key

type QueryView

type QueryView struct {
	View      string
	Parameter map[string]interface{}
	Export    string
}

QueryView contains query data

func ParseVelaQL

func ParseVelaQL(ql string) (QueryView, error)

ParseVelaQL parse velaQL to QueryView

type ViewContext

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

ViewContext is view context

func (ViewContext) Commit

func (c ViewContext) Commit() error

Commit the workflow context and persist it's content.

func (ViewContext) GetComponent

func (c ViewContext) GetComponent(name string) (*wfContext.ComponentManifest, error)

GetComponent Get ComponentManifest from workflow context.

func (ViewContext) GetComponents

func (c ViewContext) GetComponents() map[string]*wfContext.ComponentManifest

GetComponents Get All ComponentManifest from workflow context.

func (ViewContext) GetVar

func (c ViewContext) GetVar(paths ...string) (*value.Value, error)

GetVar get variable from workflow context.

func (ViewContext) MakeParameter

func (c ViewContext) MakeParameter(parameter interface{}) (*value.Value, error)

MakeParameter make 'value' with interface{}

func (ViewContext) PatchComponent

func (c ViewContext) PatchComponent(name string, patchValue *value.Value) error

PatchComponent patch component with value.

func (ViewContext) SetVar

func (c ViewContext) SetVar(v *value.Value, paths ...string) error

SetVar set variable to workflow context.

func (ViewContext) StoreRef

func (c ViewContext) StoreRef() *corev1.ObjectReference

StoreRef return the store reference of workflow context.

type ViewHandler

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

ViewHandler view handler

func NewViewHandler

NewViewHandler new view handler

func (*ViewHandler) QueryView

func (handler *ViewHandler) QueryView(ctx context.Context, qv QueryView) (*value.Value, error)

QueryView generate view step

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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