builder

package
v0.102.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractYAML added in v0.101.7

func ExtractYAML(ctxt *cue.Context, filepaths []string) (cue.Value, error)

ExtractYAML extracts yaml encoded data from file paths. The data is unified into one cue.Value. If a path element is a directory, all files in the directory are loaded non-recursively.

Attribution: https://github.com/cue-lang/cue/issues/3504

Types

type BuildPlan added in v0.100.0

type BuildPlan struct {
	holos.BuildPlan
}

func LoadBuildPlan added in v0.100.0

func LoadBuildPlan(i *Instance, opts holos.BuildOpts) (bp BuildPlan, err error)

type Instance added in v0.100.0

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

Instance represents a cue instance to build. Use LoadInstance to create a new Instance.

func LoadInstance added in v0.100.0

func LoadInstance(path string, filepaths []string, tags []string) (*Instance, error)

LoadInstance loads the cue configuration instance at path. External data file paths are loaded by calling ExtractYAML providing filepaths. The extracted data values are unified with the platform configuration cue.Value in the returned Instance.

func (*Instance) Decoder added in v0.100.0

func (i *Instance) Decoder() (*json.Decoder, error)

func (*Instance) Discriminate added in v0.100.0

func (i *Instance) Discriminate(discriminate func(tm holos.TypeMeta) error) error

Discriminate calls the discriminate func for side effects. Useful to switch over the instance kind and apiVersion.

func (*Instance) Export added in v0.100.0

func (i *Instance) Export(enc holos.Encoder) error

func (*Instance) HolosValue added in v0.100.0

func (i *Instance) HolosValue() (v cue.Value, err error)

HolosValue returns the value of the holos field of the exported CUE instance.

type Platform added in v0.100.0

type Platform struct {
	holos.Platform
}

Platform represents a common abstraction over different platform schema versions.

func LoadPlatform added in v0.100.0

func LoadPlatform(i *Instance) (platform Platform, err error)

func (*Platform) Build added in v0.100.0

func (p *Platform) Build(ctx context.Context, opts PlatformOpts) error

Build calls PlatformOpts Fn(ctx, component) concurrently.

type PlatformOpts added in v0.100.0

type PlatformOpts struct {
	Fn          func(context.Context, int, holos.Component) error
	Selector    holos.Selector
	Concurrency int
	InfoEnabled bool
}

PlatformOpts represents build options when processing the components in a platform.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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