Go bindings for the Open Component Model.
| Module | Purpose |
|---|---|
| runtime | Core type system, JSON/YAML encoding, type registration |
| dag | Directed acyclic graph utilities for dependency handling |
| cel | CEL (Common Expression Language) evaluation |
| blob | Blob abstraction for artifact content |
| configuration | Configuration management and merging |
| credentials | Credential resolution and storage |
| descriptor/v2 | OCM v2 component descriptor schema |
| descriptor/runtime | Runtime descriptor type handling |
| descriptor/normalisation | Canonical descriptor format for signing |
| signing | Component version signing and verification |
| rsa | RSA key handling |
| repository | Abstract repository interface |
| ctf | Common Transport Format (filesystem-based) |
| oci | OCI registry repository implementation |
| constructor | Build and assemble component versions |
| plugin | Plugin system for extensibility |
| transform | Transformation/localization of component versions |
| helm | Helm chart resource handling |
| input | Input sources (file, directory, utf8) |
| generator | Code generation tools |
Import the modules you need:
import (
"ocm.software/open-component-model/bindings/go/oci"
"ocm.software/open-component-model/bindings/go/descriptor/v2"
)The examples/ directory contains runnable, tested examples for the most common OCM operations:
- Blobs — creating in-memory and filesystem blobs, copying with digest verification
- Descriptors — building component descriptors with resources, sources, references, and labels
- Credentials — resolving credentials by identity using the static resolver
- Signing — generating and verifying digests, RSA signing (plain and PEM), tamper detection
- Repository — creating CTF-backed repositories, storing and retrieving component versions, resources, and sources
- OCI Registry — full round-trip against a real OCI registry using testcontainers (skipped with
-short) - Transfer — transferring component versions between CTF repositories using the transfer graph API
All examples are self-contained and run as part of CI, except OCI Registry which requires a real OCI registry via testcontainers and is skipped with -short:
task bindings/go/examples:test# Run all library tests
task test
# Run specific tests
go test ./...# Run from repository root
task -a