bundle

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: 16 Imported by: 0

Documentation

Overview

Package bundle loads and validates the read-only descriptor bundle (descriptors.binpb + openapi.json + versions.yaml) at boot, fail-fast. The route → message binding is read verbatim (zero inference); every binding is resolved against the FileDescriptorSet here so the runtime never has to. Transform stanzas live in the operator-owned resolution.yaml at the bundle root; the per-version layer manifests are binding-only. Unknown keys are refused by strict decode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	// contains filtered or unexported fields
}

func Load

func Load(dir string) (*Bundle, error)

Load reads, parses, validates, and resolves the bundle in dir. The bundle is a directory of layer subdirectories, each holding descriptors.binpb, openapi.json, and versions.yaml. Any failure is fatal (a typed error); the caller refuses to start.

func (*Bundle) Contract

func (b *Bundle) Contract(version string) (*Contract, bool)

func (*Bundle) Message

func (b *Bundle) Message(fullName string) (protoreflect.MessageDescriptor, error)

Message resolves a fully-qualified proto message name against the bundle's FileDescriptorSet.

type Contract

type Contract struct {
	// contains filtered or unexported fields
}

Contract is one resolved binding. Fields are unexported with accessors so it satisfies an adapter Binding interface (RequestMessage/ResponseMessage) structurally, with no import cycle.

func (*Contract) Chain added in v0.3.0

func (c *Contract) Chain() []*Contract

func (*Contract) ContractVersion

func (c *Contract) ContractVersion() string

func (*Contract) Method

func (c *Contract) Method() string

func (*Contract) RequestMessage

func (c *Contract) RequestMessage() string

func (*Contract) RequestOps added in v0.2.0

func (c *Contract) RequestOps() []transform.Op

func (*Contract) ResponseMessage

func (c *Contract) ResponseMessage() string

func (*Contract) ResponseOps added in v0.2.0

func (c *Contract) ResponseOps() []transform.Op

func (*Contract) Route

func (c *Contract) Route() string

func (*Contract) Target added in v0.3.0

func (c *Contract) Target() string

func (*Contract) TransformTarget added in v0.3.0

func (c *Contract) TransformTarget() string

type MessageNotFoundError

type MessageNotFoundError struct {
	Contract string
	Message  string
}

func (*MessageNotFoundError) Error

func (e *MessageNotFoundError) Error() string

type ParseError

type ParseError struct {
	File string
	Err  error
}

func (*ParseError) Error

func (e *ParseError) Error() string

func (*ParseError) Unwrap

func (e *ParseError) Unwrap() error

type ReadError

type ReadError struct {
	File string
	Err  error
}

func (*ReadError) Error

func (e *ReadError) Error() string

func (*ReadError) Unwrap

func (e *ReadError) Unwrap() error

type UnsupportedVersionError

type UnsupportedVersionError struct{ Version int }

func (*UnsupportedVersionError) Error

func (e *UnsupportedVersionError) Error() string

type ValidationError

type ValidationError struct {
	Contract string
	Field    string
	Reason   string
}

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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