engine

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package engine manages the acquisition and compilation of Timoni's CUE modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder compiles CUE definitions to Kubernetes objects.

func NewBuilder

func NewBuilder(ctx *cue.Context, name, namespace, moduleRoot, pkgName string) *Builder

NewBuilder creates a Builder for the given module and package.

func (*Builder) Build

func (b *Builder) Build() (cue.Value, error)

Build builds a CUE instances for the specified package and returns the CUE value.

func (*Builder) GetDefaultValues

func (b *Builder) GetDefaultValues() (string, error)

GetDefaultValues extracts the default values from the module.

func (*Builder) GetModuleName

func (b *Builder) GetModuleName() (string, error)

GetModuleName returns the module name as defined in 'cue.mod/module.cue'.

func (*Builder) GetObjects

func (b *Builder) GetObjects(value cue.Value) ([]*unstructured.Unstructured, error)

GetObjects coverts the CUE value to Kubernetes unstructured objects.

func (*Builder) GetValues

func (b *Builder) GetValues(value cue.Value) (string, error)

GetValues extracts the values from the build result.

func (*Builder) MergeValuesFile

func (b *Builder) MergeValuesFile(overlays []string) error

MergeValuesFile merges the given values overlays into values.cue.

type Fetcher

type Fetcher struct {
	// contains filtered or unexported fields
}

Fetcher downloads a module and extracts it locally.

func NewFetcher

func NewFetcher(ctx context.Context, src, version, dst, creds string) *Fetcher

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

func (f *Fetcher) GetModuleRoot() string

Jump to

Keyboard shortcuts

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