Documentation
¶
Index ¶
- Constants
- Variables
- func GetDefault(val cue.Value) interface{}
- func GetParameters(templateStr string) ([]types.Parameter, error)
- func GetParametersWithCuex(ctx context.Context, templateStr string) ([]types.Parameter, error)
- func GetSelectorLabel(selector cue.Selector) string
- func IsFieldNotExist(err error) bool
- func RetrieveComments(value cue.Value) (string, string, string, bool)
Constants ¶
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" )
const BaseTemplate = `
context: {
name: string
config?: [...{
name: string
value: string
}]
...
}
`
BaseTemplate include base info provided by KubeVela for CUE template
Variables ¶
var ErrParameterNotExist = errors.New("parameter not exist")
ErrParameterNotExist represents the parameter field is not exist in CUE template
Functions ¶
func GetDefault ¶
GetDefault evaluate default Go value from CUE
func GetParameters ¶
GetParameters get parameter from cue template Deprecated: Use GetParametersWithCuex for templates with cuex imports
func GetParametersWithCuex ¶
GetParametersWithCuex get parameter from cue template with cuex support for package imports
func GetSelectorLabel ¶
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
IsFieldNotExist check whether the error type is the field not found
Types ¶
This section is empty.