cue

package
v1.12.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// UsagePrefix defines the usage display for KubeVela CLI
	UsagePrefix = "+usage="
	// ShortPrefix defines the short argument for KubeVela CLI
	ShortPrefix = "+short="
	// AliasPrefix is an alias of the name of a parameter element, in order to making it more friendly to Cli users
	AliasPrefix = "+alias="
	// IgnorePrefix defines parameter in system level which we don't want our end user to see for KubeVela CLI
	IgnorePrefix = "+ignore"
	// ImmutablePrefix marks a parameter field as immutable after initial set
	ImmutablePrefix = "+immutable"
)
View Source
const BaseTemplate = `
context: {
  name: string
  config?: [...{
    name: string
    value: string
  }]
  ...
}
`

BaseTemplate include base info provided by KubeVela for CUE template

Variables

View Source
var ErrParameterNotExist = errors.New("parameter not exist")

ErrParameterNotExist represents the parameter field is not exist in CUE template

Functions

func GetDefault

func GetDefault(val cue.Value) interface{}

GetDefault evaluate default Go value from CUE

func GetParameters

func GetParameters(templateStr string) ([]types.Parameter, error)

GetParameters get parameter from cue template Deprecated: Use GetParametersWithCuex for templates with cuex imports

func GetParametersWithCuex added in v1.10.10

func GetParametersWithCuex(ctx context.Context, templateStr string) ([]types.Parameter, error)

GetParametersWithCuex get parameter from cue template with cuex support for package imports

func GetSelectorLabel added in v1.11.0

func GetSelectorLabel(selector cue.Selector) string

GetSelectorLabel safely extracts a label from a CUE selector. It uses String() by default to avoid panics on pattern parameter selectors, and only uses Unquoted() when it's safe (i.e., for StringLabel with concrete names). This prevents panics that would occur when calling Unquoted() on pattern constraints like [string]: T.

func IsFieldNotExist added in v1.6.0

func IsFieldNotExist(err error) bool

IsFieldNotExist check whether the error type is the field not found

func RetrieveComments

func RetrieveComments(value cue.Value) (short, usage, alias string, ignore, immutable bool)

RetrieveComments will retrieve Usage, Short, Alias, Ignore and Immutable from CUE Value

Types

This section is empty.

Directories

Path Synopsis
providers/addon
Package addon provides the CueX `addon.#Render` provider, which resolves and renders an addon via the injected render-only service.
Package addon provides the CueX `addon.#Render` provider, which resolves and renders an addon via the injected render-only service.
providers/guardedhttp
Package guardedhttp is the vela/http CueX package with the outbound HTTP guard applied.
Package guardedhttp is the vela/http CueX package with the outbound HTTP guard applied.
providers/kuberead
Package kuberead serves `vela/kube` to SourceDefinitions with the writes removed.
Package kuberead serves `vela/kube` to SourceDefinitions with the writes removed.
providers/module
Package module provides the CueX `module.#Render` provider, which fetches a module and renders its owned Application via the injected render service.
Package module provides the CueX `module.#Render` provider, which fetches a module and renders its owned Application via the injected render service.
providers/registry
Package registry provides a CueX provider that reads a file out of a configured addon registry.
Package registry provides a CueX provider that reads a file out of a configured addon registry.
providers/validation
Package validation carries the marker that tells CueX providers they are evaluating an Application for admission rather than rendering it for real.
Package validation carries the marker that tells CueX providers they are evaluating an Application for admission rather than rendering it for real.
providers/velaconfig
Package velaconfig provides a CueX provider that reads a KubeVela Config's properties.
Package velaconfig provides a CueX provider that reads a KubeVela Config's properties.
providers/velaconfig/reader
Package reader implements vela/velaconfig's Reader over pkg/config.
Package reader implements vela/velaconfig's Reader over pkg/config.
Package nesting measures how deeply CUE source nests before it is parsed.
Package nesting measures how deeply CUE source nests before it is parsed.
Package render holds the CUE template helpers shared by the workload/trait render engine and by source resolution.
Package render holds the CUE template helpers shared by the workload/trait render engine and by source resolution.
Package upgrade provides CUE version-compatibility helpers for KubeVela.
Package upgrade provides CUE version-compatibility helpers for KubeVela.

Jump to

Keyboard shortcuts

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