composition

package
v0.2.0-rc11 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package composition provides loading, analysis and archive creation of a function-hcl composition module. It also processes a composition.yaml metadata file that is optionally present in the composition directory.

Index

Constants

View Source
const ConfigFile = "composition.yaml"

Variables

This section is empty.

Functions

func Analyze

func Analyze(dir string) error

Analyze analyzes all HCL files and any additional library files and returns an error on a failed analysis.

func Package

func Package(dir string, skipAnalysis bool) ([]byte, error)

Package combines all HCL files and any additional library files and returns a byte array that contains the entire package in txtar format.

Types

type Config

type Config struct {
	XRD          XRD      `json:"xrd"`
	LibraryFiles []string `json:"libraryFiles"`
}

Config represents the configuration for the composition in terms of library file requirements and XRD type information.

func Load

func Load(fs FS, dir string, ignoreMetadataErrors bool) (*Config, []string, error)

Load returns composition information and a list of files to process from a specific directory. File paths in the list are relative to the directory that was loaded.

type FS

type FS interface {
	Stat(name string) (fs.FileInfo, error)
	ReadDir(name string) ([]fs.DirEntry, error)
	ReadFile(name string) ([]byte, error)
}

FS is the minimal filesystem interface needed to load files for a module.

type XRD

type XRD struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
}

Jump to

Keyboard shortcuts

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