eval

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package eval encapsulates the manner in which components and parameters are evaluated for qbec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code added in v0.14.0

func Code(diagnosticFile string, code vm.Code, ctx BaseContext) (jsonData string, err error)

Code evaluates the supplied file using the base context.

func Components

func Components(components []model.Component, ctx Context, lop LocalObjectProducer) (_ []model.K8sLocalObject, finalErr error)

Components evaluates the specified components using the specific runtime parameters file and returns the result.

func File added in v0.14.0

func File(file string, ctx BaseContext) (jsonData string, err error)

File evaluates the supplied file using the base context.

func Params

func Params(file string, ctx Context) (map[string]interface{}, error)

Params evaluates the supplied parameters file in the supplied VM and returns it as a JSON object.

Types

type BaseContext added in v0.14.0

type BaseContext struct {
	LibPaths    []string                // library paths
	DataSources []datasource.DataSource // data sources
	Vars        vm.VariableSet          // variables for the VM
	Verbose     bool                    // show generated code
	// contains filtered or unexported fields
}

BaseContext is the context required to evaluate a single file

type Context

type Context struct {
	BaseContext
	Concurrency      int      // concurrent components to evaluate, default 5
	PostProcessFiles []string // files that contains post-processing code for all objects
	// contains filtered or unexported fields
}

Context is the evaluation context

type LocalObjectProducer added in v0.13.4

type LocalObjectProducer func(component string, data map[string]interface{}) model.K8sLocalObject

LocalObjectProducer converts a data object that has basic Kubernetes attributes to a local model object.

Jump to

Keyboard shortcuts

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