Documentation ¶
Index ¶
- Constants
- Variables
- func NewViewContext() (wfContext.Context, error)
- func ParseParameter(parameter string) (map[string]interface{}, error)
- func ParseViewIntoConfigMap(viewStr, name string) (*v1.ConfigMap, error)
- func StoreViewFromFile(ctx context.Context, c client.Client, path, viewName string) error
- func ValidateView(viewStr string) error
- type QueryParameterKey
- type QueryView
- type ViewContext
- func (c ViewContext) Commit() error
- func (c ViewContext) DeleteMutableValue(paths ...string)
- func (c ViewContext) DeleteValueInMemory(paths ...string)
- func (c ViewContext) GetComponent(name string) (*wfContext.ComponentManifest, error)
- func (c ViewContext) GetComponents() map[string]*wfContext.ComponentManifest
- func (c ViewContext) GetMutableValue(paths ...string) string
- func (c ViewContext) GetStore() *corev1.ConfigMap
- func (c ViewContext) GetValueInMemory(paths ...string) (interface{}, bool)
- func (c ViewContext) GetVar(paths ...string) (*value.Value, error)
- func (c ViewContext) IncreaseCountValueInMemory(paths ...string) int
- func (c ViewContext) MakeParameter(parameter interface{}) (*value.Value, error)
- func (c ViewContext) PatchComponent(name string, patchValue *value.Value) error
- func (c ViewContext) SetMutableValue(data string, paths ...string)
- func (c ViewContext) SetValueInMemory(data interface{}, paths ...string)
- func (c ViewContext) SetVar(v *value.Value, paths ...string) error
- func (c ViewContext) StoreRef() *corev1.ObjectReference
- type ViewHandler
Constants ¶
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" // KeyWordTemplate represents template keyword KeyWordTemplate = "template" // KeyWordExport represent export keyword KeyWordExport = "export" // DefaultExportValue is the default Export value DefaultExportValue = "status" )
const (
// ViewTaskPhaseSucceeded means view task run succeeded.
ViewTaskPhaseSucceeded = "succeeded"
)
Variables ¶
var OutputsTemplate = `
{
"outputs": [
{
"valueFrom": "%s",
"name": "%s"
}
]
}
`
OutputsTemplate output template
Functions ¶
func NewViewContext ¶
NewViewContext new view context
func ParseParameter ¶
ParseParameter parse parameter to map[string]interface{}
func ParseViewIntoConfigMap ¶ added in v1.5.0
ParseViewIntoConfigMap parses a CUE string (representing a view) into a ConfigMap ready to be stored into etcd.
func StoreViewFromFile ¶ added in v1.5.0
StoreViewFromFile reads a view from the specified CUE file, and stores into a ConfigMap in vela-system namespace. So the user can use the view in VelaQL later.
By saying file, it can actually be a file, URL, or stdin (-).
func ValidateView ¶ added in v1.5.0
ValidateView makes sure the cue provided can use as view.
For now, we only check 1. cue is valid 2. `status` or `view` field exists
Types ¶
type QueryParameterKey ¶
type QueryParameterKey struct {
Outputs workflowv1alpha1.StepOutputs `json:"outputs"`
}
QueryParameterKey query parameter key
type QueryView ¶
QueryView contains query data
func ParseVelaQL ¶
ParseVelaQL parse velaQL to QueryView
func ParseVelaQLFromPath ¶ added in v1.4.4
ParseVelaQLFromPath will parse a velaQL file path 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) DeleteMutableValue ¶
func (c ViewContext) DeleteMutableValue(paths ...string)
DeleteMutableValue delete mutable data in workflow context.
func (ViewContext) DeleteValueInMemory ¶ added in v1.2.2
func (c ViewContext) DeleteValueInMemory(paths ...string)
DeleteValueInMemory delete data in workflow context memory store.
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) GetMutableValue ¶
func (c ViewContext) GetMutableValue(paths ...string) string
GetMutableValue get mutable data from workflow context.
func (ViewContext) GetStore ¶
func (c ViewContext) GetStore() *corev1.ConfigMap
GetStore get configmap of workflow context.
func (ViewContext) GetValueInMemory ¶ added in v1.2.2
func (c ViewContext) GetValueInMemory(paths ...string) (interface{}, bool)
GetValueInMemory get data in workflow context memory store.
func (ViewContext) GetVar ¶
func (c ViewContext) GetVar(paths ...string) (*value.Value, error)
GetVar get variable from workflow context.
func (ViewContext) IncreaseCountValueInMemory ¶ added in v1.2.2
func (c ViewContext) IncreaseCountValueInMemory(paths ...string) int
IncreaseCountValueInMemory increase count in workflow context memory store.
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) SetMutableValue ¶
func (c ViewContext) SetMutableValue(data string, paths ...string)
SetMutableValue set mutable data in workflow context config map.
func (ViewContext) SetValueInMemory ¶ added in v1.2.2
func (c ViewContext) SetValueInMemory(data interface{}, paths ...string)
SetValueInMemory set data in workflow context memory store.
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 ¶
func NewViewHandler(cli client.Client, cfg *rest.Config, dm discoverymapper.DiscoveryMapper, pd *packages.PackageDiscover) *ViewHandler
NewViewHandler new view handler