bundle

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0, MIT Imports: 13 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. A v0.2 bundle (transform stanzas) is refused by strict decode, not half-applied. SIGHUP hot-reload is v0.3; v0.1 loads once.

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. Any failure is fatal (returned as 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 v0.1 binding. Fields are unexported with accessors so it satisfies an adapter Binding interface (RequestMessage/ResponseMessage) structurally, with no import cycle.

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) ResponseMessage

func (c *Contract) ResponseMessage() string

func (*Contract) Route

func (c *Contract) Route() 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