bundlegen

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Overview

Package bundlegen is the OpenAPI → bundle generator. It is deliberately a constrained, fail-loud subset: exactly one operation (single-version passthrough), request/response must be $ref'd component object schemas, scalars + arrays + $ref + nullable→proto3-optional are supported, and any unsupported construct (allOf/oneOf/anyOf/additionalProperties/untyped/ inline) is a hard error rather than a lossy bundle. Output is byte-reproducible (sorted, deterministic marshal) for the consumer's buf-breaking story.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add added in v0.3.0

func Add(openapiSrc, bundleDir string) error

Add reads the OpenAPI doc from openapiSrc — a local file path or an http(s):// URL (fetched at build time; the bytes are passed through into the committed bundle, so a URL fetch stays point-in-time) — and emits a new immutable layer into bundleDir/<version>/, where <version> is the doc's info.version. It refuses to overwrite an existing layer: a frozen version is never rewritten.

func Remove added in v0.3.0

func Remove(bundleDir, version string) error

Remove hard-deletes a version's layer from bundleDir. It is oldest-only: version must be the lexically-oldest layer present, and at least one other layer must remain — the bundle is never emptied and the current version is never removed. Any other request is a hard error.

func Retire added in v0.3.0

func Retire(bundleDir, version string) error

Retire scaffolds a transform-shim override for version in bundleDir. It converts version from the default (direct-route) behaviour to a transform that chains to its immediate newer neighbour, leaving the request and response stanza arrays empty for a human to fill.

Hard errors:

  • version is not a layer in bundleDir
  • version is the newest layer (the current version is never retired)
  • version already has an override in resolution.yaml

Any existing overrides for other versions are preserved verbatim. Operator comments in resolution.yaml are not preserved across the rewrite.

func Verify added in v0.3.0

func Verify(bundleDir string) error

Verify loads the bundle at bundleDir via bundle.Load and returns the typed error on any inconsistency, or nil on success. It is the thin command-facing wrapper that gives a CI consumer a single pass/fail over layers, resolution.yaml, and the transform chains.

Types

This section is empty.

Jump to

Keyboard shortcuts

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