config

package
v0.0.0-...-157f73e Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

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 of configuration.

func New

func NewWithOutput

func NewWithOutput(t framework.TestContext, out config.Plan) *Builder

NewWithOutput creates a new Builder that targets the given config as output.

func (*Builder) Apply

func (b *Builder) Apply(opts ...apply.Option)

func (*Builder) BuildAll

func (b *Builder) BuildAll(fromAll echo.Callers, toAll echo.Services) *Builder

BuildAll builds the config for all sources.

func (*Builder) BuildCompleteSources

func (b *Builder) BuildCompleteSources() *Builder

BuildCompleteSources builds only those sources that already contain all parameters needed by their templates. Specifically, they are not missing any of the well-known parameters: "From", "To", or "Namespace".

func (*Builder) BuildFrom

func (b *Builder) BuildFrom(fromAll ...echo.Caller) *Builder

BuildFrom builds only those sources that require only the "From" parameter.

func (*Builder) BuildFromAndTo

func (b *Builder) BuildFromAndTo(fromAll echo.Callers, toAll echo.Services) *Builder

BuildFromAndTo builds only those sources that require both the "From" and "To" parameters.

func (*Builder) Context

func (b *Builder) Context(t framework.TestContext) *Builder

Context returns a copy of this Builder with the given context set.

func (*Builder) Copy

func (b *Builder) Copy() *Builder

func (*Builder) Output

func (b *Builder) Output(out config.Plan) *Builder

Output returns a copy of this Builder with the given output set.

func (*Builder) Source

func (b *Builder) Source(sources ...Source) *Builder

Source returns a copy of this Builder with the given Source objects added.

type Source

type Source interface {
	// Template reads the raw input and creates a Template from this source.
	Template() (*param.Template, error)

	// TemplateOrFail calls Template and fails if an error occurs.
	TemplateOrFail(t test.Failer) *param.Template

	// MustTemplate calls Template and panics if an error occurs.
	MustTemplate() *param.Template

	// YAML reads the yaml from this Source. If this source contains parameters,
	// it is evaluated as a template.
	YAML() (string, error)

	// YAMLOrFail calls GetYAML and fails if an error occurs.
	YAMLOrFail(t test.Failer) string

	// MustYAML calls GetYAML and panics if an error occurs.
	MustYAML() string

	// Split this source into individual CRDs.
	Split() ([]Source, error)

	// SplitOrFail calls Split and fails if an error occurs.
	SplitOrFail(t test.Failer) []Source

	// MustSplit calls Split and panics if an error occurs.
	MustSplit() []Source

	// Params returns a copy of the parameters for this Source.
	Params() param.Params

	// WithParams creates a new Source with the given template parameters.
	// If a Source contains params, it will be evaluated as a template by GetYAML.
	// If this source already has parameters, the returned Source will contain
	// a union of the two sets. If the same entry appears in the existing params,
	// the new value overwrites the existing.
	WithParams(params param.Params) Source

	// WithNamespace calls WithParams with the given namespace set.
	WithNamespace(namespace.Instance) Source
}

Source of YAML text.

func File

func File(filePath string) Source

File returns a Source of YAML text stored in files.

func YAML

func YAML(text string) Source

YAML returns a Source of raw YAML text.

type Sources

type Sources []Source

Sources provides common operations that can be performed on a list of Source objects.

func (Sources) WithNamespace

func (s Sources) WithNamespace(ns namespace.Instance) Sources

WithNamespace creates a new Sources with the given namespace parameter set. See Source.WithNamespace.

func (Sources) WithParams

func (s Sources) WithParams(params param.Params) Sources

WithParams creates a new Sources with the given template parameters. See Source.WithParams.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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