caffeine_lang/compiler

Types

Output of the compilation process containing Terraform, optional dependency graph, and warnings.

pub type CompilationOutput {
  CompilationOutput(
    terraform: String,
    dependency_graph: option.Option(String),
    warnings: List(String),
  )
}

Constructors

  • CompilationOutput(
      terraform: String,
      dependency_graph: option.Option(String),
      warnings: List(String),
    )

Values

pub fn compile(
  measurements: List(source_file.VendorMeasurementSource),
  expectations: List(
    source_file.SourceFile(source_file.ExpectationSource),
  ),
) -> Result(CompilationOutput, errors.CompilationError)

Compiles measurement sources and expectation sources into Terraform configuration. Pure function — all file reading happens before this function is called.

pub fn compile_from_strings(
  measurements_source: String,
  expectations_source: String,
  expectations_path: String,
  vendor vendor_string: String,
) -> Result(CompilationOutput, errors.CompilationError)

Compiles from source strings directly (no file I/O). Used for browser-based compilation. The vendor parameter specifies which vendor the measurements belong to.

Search Document