package blueprint
import "github.com/input-output-hk/catalyst-forge/lib/blueprint/pkg/blueprint"
Index ¶
- type BlueprintFile
- type BlueprintFiles
- func (b BlueprintFiles) Unify(ctx *cue.Context) (cue.Value, error)
- func (b BlueprintFiles) ValidateMajorVersions() error
- func (b BlueprintFiles) Version() *semver.Version
- type RawBlueprint
- func NewRawBlueprint(v cue.Value) RawBlueprint
- func (r *RawBlueprint) Decode() (schema.Blueprint, error)
- func (r RawBlueprint) DecodePath(path string, x interface{}) error
- func (r RawBlueprint) Get(path string) cue.Value
- func (r RawBlueprint) MarshalJSON() ([]byte, error)
- func (r RawBlueprint) Value() cue.Value
Types ¶
type BlueprintFile ¶
BlueprintFile represents a single blueprint file.
func NewBlueprintFile ¶
func NewBlueprintFile(ctx *cue.Context, path string, contents []byte, inj injector.Injector) (BlueprintFile, error)
NewBlueprintFile creates a new BlueprintFile from the given CUE context, path, and contents. The contents are compiled and validated, including injecting any necessary environment variables. Additionally, the version is extracted from the CUE value. If the version is not found or invalid, or the final CUE value is invalid, an error is returned.
type BlueprintFiles ¶
type BlueprintFiles []BlueprintFile
BlueprintFiles represents a collection of blueprint files.
func (BlueprintFiles) Unify ¶
Unify unifies the blueprints into a single CUE value. If the unification fails, an error is returned.
func (BlueprintFiles) ValidateMajorVersions ¶
func (b BlueprintFiles) ValidateMajorVersions() error
validateMajors validates the major versions of the blueprints. If the blueprints have different major versions, an error is returned.
func (BlueprintFiles) Version ¶
func (b BlueprintFiles) Version() *semver.Version
Version returns the highest version number from the blueprints. If there are no blueprints, nil is returned.
type RawBlueprint ¶
type RawBlueprint struct {
// contains filtered or unexported fields
}
RawBlueprint represents a raw (undecoded) blueprint.
func NewRawBlueprint ¶
func NewRawBlueprint(v cue.Value) RawBlueprint
NewRawBlueprint creates a new raw blueprint.
func (*RawBlueprint) Decode ¶
func (r *RawBlueprint) Decode() (schema.Blueprint, error)
Decode decodes the raw blueprint into a schema.Blueprint.
func (RawBlueprint) DecodePath ¶
func (r RawBlueprint) DecodePath(path string, x interface{}) error
DecodePath decodes a path from the raw blueprint to the given interface.
func (RawBlueprint) Get ¶
func (r RawBlueprint) Get(path string) cue.Value
Get returns a value from the raw blueprint.
func (RawBlueprint) MarshalJSON ¶
func (r RawBlueprint) MarshalJSON() ([]byte, error)
MarshalJSON marshals the raw blueprint into JSON.
func (RawBlueprint) Value ¶
func (r RawBlueprint) Value() cue.Value
Value returns the raw blueprint value.
Source Files ¶
- Version
- v0.0.0-20240928203643-c3373f0052b9 (latest)
- Published
- Sep 28, 2024
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 2 days ago –
Tools for package owners.