amalgam-core

Crates.ioamalgam-core
lib.rsamalgam-core
version0.6.4
created_at2025-08-28 10:46:54.479603+00
updated_at2025-09-01 23:46:26.501435+00
descriptionCore IR and type system for amalgam configuration generator
homepagehttps://github.com/seryl/amalgam
repositoryhttps://github.com/seryl/amalgam
max_upload_size
id1813997
size59,783
Josh Toft (seryl)

documentation

https://docs.rs/amalgam-core

README

amalgam-core

Core intermediate representation (IR) and type system for the amalgam configuration generator.

Overview

amalgam-core provides the foundational type system and intermediate representation used by all amalgam components to translate between different schema and configuration languages.

Features

  • Unified Type System: Algebraic data types that can represent concepts from multiple languages
  • Schema IR: Intermediate representation for schemas from OpenAPI, Kubernetes CRDs, Go types, etc.
  • Type Mapping: Bidirectional mappings between different type systems
  • Validation Rules: Contract and refinement type support

Usage

use amalgam_core::{Type, Schema, TypeSystem};

// Create a schema from various sources
let schema = Schema::new("MyConfig");

// Add types and constraints
schema.add_type(Type::String)
    .with_constraint(Constraint::MinLength(1))
    .with_constraint(Constraint::Pattern(r"^[a-z]+$"));
Commit count: 37

cargo fmt