Documentation
¶
Index ¶
- Constants
- Variables
- func ParseParameter(parameter string) (map[string]interface{}, error)
- func ParseViewIntoConfigMap(ctx context.Context, viewStr, name string) (*v1.ConfigMap, error)
- func StoreViewFromFile(ctx context.Context, c client.Client, path, viewName string) error
- func ValidateView(ctx context.Context, viewStr string) error
- type QueryParameterKey
- type QueryView
- type ViewHandler
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" // KeyWordTemplate represents template keyword KeyWordTemplate = "template" // 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 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 (-).
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
type ViewHandler ¶
type ViewHandler struct {
// contains filtered or unexported fields
}
ViewHandler view handler
func NewViewHandler ¶
func NewViewHandler(cli client.Client, cfg *rest.Config) *ViewHandler
NewViewHandler new view handler
Click to show internal directories.
Click to hide internal directories.