Documentation ¶
Index ¶
- Constants
- func IsCUEParseErr(err error) bool
- type CUEParseError
- type PackageDiscover
- func (pd *PackageDiscover) Exist(gvk metav1.GroupVersionKind) bool
- func (pd *PackageDiscover) ImportBuiltinPackagesFor(bi *build.Instance)
- func (pd *PackageDiscover) ImportPackagesAndBuildInstance(bi *build.Instance) (inst *cue.Instance, err error)
- func (pd *PackageDiscover) ImportPackagesAndBuildValue(bi *build.Instance) (val cue.Value, err error)
- func (pd *PackageDiscover) ListPackageKinds() map[string][]VersionKind
- func (pd *PackageDiscover) RefreshKubePackagesFromCluster() error
- type ParseErrType
- type VersionKind
Constants ¶
const ( // BuiltinPackageDomain Specify the domain of the built-in package BuiltinPackageDomain = "kube" // K8sResourcePrefix Indicates that the definition comes from kubernetes K8sResourcePrefix = "io_k8s_api_" // ParseJSONSchemaErr describes the error that occurs when cue parses json ParseJSONSchemaErr ParseErrType = "parse json schema of k8s crds error" )
Variables ¶
This section is empty.
Functions ¶
func IsCUEParseErr ¶
IsCUEParseErr returns true if the specified error is CUEParseError type.
Types ¶
type CUEParseError ¶
type CUEParseError struct {
// contains filtered or unexported fields
}
CUEParseError describes an error when CUE parse error
func (CUEParseError) Error ¶
func (cueErr CUEParseError) Error() string
Error implements the Error interface.
type PackageDiscover ¶
type PackageDiscover struct {
// contains filtered or unexported fields
}
PackageDiscover defines the inner CUE packages loaded from K8s cluster
func NewPackageDiscover ¶
func NewPackageDiscover(config *rest.Config) (*PackageDiscover, error)
NewPackageDiscover will create a PackageDiscover client with the K8s config file.
func (*PackageDiscover) Exist ¶
func (pd *PackageDiscover) Exist(gvk metav1.GroupVersionKind) bool
Exist checks if the GVK exists in the built-in packages
func (*PackageDiscover) ImportBuiltinPackagesFor ¶
func (pd *PackageDiscover) ImportBuiltinPackagesFor(bi *build.Instance)
ImportBuiltinPackagesFor will add KubeVela built-in packages into your CUE instance
func (*PackageDiscover) ImportPackagesAndBuildInstance ¶
func (pd *PackageDiscover) ImportPackagesAndBuildInstance(bi *build.Instance) (inst *cue.Instance, err error)
ImportPackagesAndBuildInstance Combine import built-in packages and build cue template together to avoid data race nolint:staticcheck
func (*PackageDiscover) ImportPackagesAndBuildValue ¶
func (pd *PackageDiscover) ImportPackagesAndBuildValue(bi *build.Instance) (val cue.Value, err error)
ImportPackagesAndBuildValue Combine import built-in packages and build cue template together to avoid data race
func (*PackageDiscover) ListPackageKinds ¶
func (pd *PackageDiscover) ListPackageKinds() map[string][]VersionKind
ListPackageKinds list packages and their kinds
func (*PackageDiscover) RefreshKubePackagesFromCluster ¶
func (pd *PackageDiscover) RefreshKubePackagesFromCluster() error
RefreshKubePackagesFromCluster will use K8s client to load/refresh all K8s open API as a reference kube package using in template
type VersionKind ¶
VersionKind contains the resource metadata and reference name