Documentation ¶
Overview ¶
Package engine manages the acquisition and compilation of Timoni's CUE modules.
Index ¶
- Constants
- func CopyModule(src string, dst string) (err error)
- func CopyModuleFile(src, dst string) (err error)
- func ExtractValueFromFile(ctx *cue.Context, filePath, expr string) (cue.Value, error)
- func MergeValue(overlay, base cue.Value) (cue.Value, error)
- type Fetcher
- type ModuleBuilder
- func (b *ModuleBuilder) Build() (cue.Value, error)
- func (b *ModuleBuilder) GetDefaultValues() (string, error)
- func (b *ModuleBuilder) GetModuleName() (string, error)
- func (b *ModuleBuilder) GetObjects(value cue.Value) ([]*unstructured.Unstructured, error)
- func (b *ModuleBuilder) GetValues(value cue.Value) (string, error)
- func (b *ModuleBuilder) MergeValuesFile(overlays []string) error
- type ValuesBuilder
Constants ¶
const LatestTag = "latest"
LatestTag is the OCI tag name used to denote the latest stable version of a module.
Variables ¶
This section is empty.
Functions ¶
func CopyModule ¶ added in v0.0.4
CopyModule copies the given module to the destination directory, while excluding symlinks. The destination directory must not exit.
func CopyModuleFile ¶ added in v0.0.4
CopyModuleFile copies a file from source to destination while preserving permissions.
func ExtractValueFromFile ¶ added in v0.0.4
ExtractValueFromFile compiles the given file and returns the CUE value that matches the given expression.
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher downloads a module and extracts it locally.
func NewFetcher ¶
NewFetcher creates a Fetcher for the given module.
func (*Fetcher) Fetch ¶
func (f *Fetcher) Fetch() (*apiv1.ModuleReference, error)
Fetch downloads a remote module locally into tmp.
func (*Fetcher) GetModuleRoot ¶
type ModuleBuilder ¶ added in v0.0.4
type ModuleBuilder struct {
// contains filtered or unexported fields
}
ModuleBuilder compiles CUE definitions to Kubernetes objects.
func NewModuleBuilder ¶ added in v0.0.4
func NewModuleBuilder(ctx *cue.Context, name, namespace, moduleRoot, pkgName string) *ModuleBuilder
NewModuleBuilder creates a ModuleBuilder for the given module and package.
func (*ModuleBuilder) Build ¶ added in v0.0.4
func (b *ModuleBuilder) Build() (cue.Value, error)
Build builds a CUE instances for the specified package and returns the CUE value.
func (*ModuleBuilder) GetDefaultValues ¶ added in v0.0.4
func (b *ModuleBuilder) GetDefaultValues() (string, error)
GetDefaultValues extracts the default values from the module.
func (*ModuleBuilder) GetModuleName ¶ added in v0.0.4
func (b *ModuleBuilder) GetModuleName() (string, error)
GetModuleName returns the module name as defined in 'cue.mod/module.cue'.
func (*ModuleBuilder) GetObjects ¶ added in v0.0.4
func (b *ModuleBuilder) GetObjects(value cue.Value) ([]*unstructured.Unstructured, error)
GetObjects coverts the CUE value to Kubernetes unstructured objects.
func (*ModuleBuilder) GetValues ¶ added in v0.0.4
func (b *ModuleBuilder) GetValues(value cue.Value) (string, error)
GetValues extracts the values from the build result.
func (*ModuleBuilder) MergeValuesFile ¶ added in v0.0.4
func (b *ModuleBuilder) MergeValuesFile(overlays []string) error
MergeValuesFile merges the given values overlays into the module's root values.cue.
type ValuesBuilder ¶ added in v0.0.4
type ValuesBuilder struct {
// contains filtered or unexported fields
}
ValuesBuilder compiles and merges values files.
func NewValuesBuilder ¶ added in v0.0.4
func NewValuesBuilder(ctx *cue.Context) *ValuesBuilder
NewValuesBuilder creates a ValuesBuilder for the given context.
func (*ValuesBuilder) MergeValues ¶ added in v0.0.4
MergeValues merges the given overlays in order using the base as the starting point.