wire

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go wire presentation

Addressless Wire sends a ground ontos value. Endpoint adds receive ownership and closure. AddressedWire adds an exact byte-path argument; AddressedEndpoint carries that layer over one endpoint. WireNode is the complete deixis structure over Wire values (a nominal interface in Java), not opaque route access.

See the repository's docs/wire/contract.md and docs/wire/carriers.md. Version 0.5.0 is a clean breaking replacement; compilation and packaged consumers check the native surface, while bitruntime supplies independently tested implementations.

The public hydrated declarations add recursive atoms, tuples and send-only live wires above the ground boundary. HydratedEndpoint retains receive/lifetime ownership; its wire view conveys only sending. Arrival context is established by composition outside the message. Runtime construction and recognition enforce finite immutable tuples, ground canonicalization and owned capability identity; implementing a native interface alone does not make a foreign object exportable. See hydrated native contracts and decision 0019.

Documentation

Overview

Package wire declares addressless interaction and addressed access.

Index

Constants

View Source
const DefaultMaxMessageBytes = 16 * 1024 * 1024
View Source
const MaxMessageDepth = 4096
View Source
const WebSocketProtocol = "bitwire.ontos.v2"

Variables

View Source
var (
	ErrHydratedMalformed = errors.New("hydrated codec: malformed")
	ErrHydratedLimit     = errors.New("hydrated codec: limit")
	ErrHydratedOptions   = errors.New("hydrated codec limits must be positive")
)

Functions

func DecodeMessage added in v0.5.0

func DecodeMessage(bytes []byte, maxBytes int) (core.Value, error)

func EncodeMessage added in v0.5.0

func EncodeMessage(message core.Value, maxBytes int) ([]byte, error)

func HydratedDataToGround added in v0.6.0

func HydratedDataToGround(value HydratedData, limits HydratedCodecLimits) (core.Value, error)

func PackAddressed added in v0.5.0

func PackAddressed(path Path, message core.Value) (core.Value, error)

func PackHydratedBody added in v0.6.0

func PackHydratedBody(value HydratedData, limits HydratedCodecLimits) (core.Value, error)

func PackHydratedFrame added in v0.6.0

func PackHydratedFrame(frame HydratedFrame, limits HydratedCodecLimits) (core.Value, error)

func PackHydratedReference added in v0.6.0

func PackHydratedReference(value HydratedReference, limits HydratedCodecLimits) (core.Value, error)

func PathEqual added in v0.4.0

func PathEqual(a, b Path) bool

func PathStartsWith added in v0.4.0

func PathStartsWith(a, prefix Path) bool

Types

type AddressedEndpoint added in v0.5.0

type AddressedEndpoint interface {
	AddressedWire
	Receive(func(Path, core.Value)) (func(), error)
	Closed() <-chan struct{}
	Termination() Termination
	Close() error
}

type AddressedWire added in v0.3.0

type AddressedWire interface {
	Send(Path, core.Value) error
}

type Child added in v0.3.0

type Child[T any] struct {
	Key  core.Atom
	Node DeixisNode[T]
}

type DeixisNode added in v0.3.0

type DeixisNode[T any] interface {
	Own() T
	Children() []Child[T]
	At(Path) (DeixisNode[T], bool)
	Decompose() Parts[T]
}

type Endpoint added in v0.2.0

type Endpoint interface {
	Wire
	Receive(func(core.Value)) (func(), error)
	Closed() <-chan struct{}
	Termination() Termination
	Close() error
}

type HydratedCodecLimits added in v0.6.0

type HydratedCodecLimits struct{ Nodes, Depth, Bytes int }

HydratedCodecLimits bounds semantic nodes, tuple depth (root zero), and both semantic payload bytes and encoded bytes. All three bounds are inclusive and positive.

type HydratedData added in v0.6.0

type HydratedData interface {
	// contains filtered or unexported methods
}

HydratedData is pure structural data, never a live Wire or an export registry.

func HydratedDataFromGround added in v0.6.0

func HydratedDataFromGround(value core.Value, limits HydratedCodecLimits) (HydratedData, error)

func UnpackHydratedBody added in v0.6.0

func UnpackHydratedBody(value core.Value, limits HydratedCodecLimits) (HydratedData, error)

type HydratedDataAtom added in v0.6.0

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

func NewHydratedDataAtom added in v0.6.0

func NewHydratedDataAtom(value core.Atom) HydratedDataAtom

func (HydratedDataAtom) Value added in v0.6.0

func (a HydratedDataAtom) Value() core.Atom

type HydratedDataTuple added in v0.6.0

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

func NewHydratedDataTuple added in v0.6.0

func NewHydratedDataTuple(items ...HydratedData) (HydratedDataTuple, error)

func (HydratedDataTuple) At added in v0.6.0

func (t HydratedDataTuple) At(index int) HydratedData

func (HydratedDataTuple) Items added in v0.6.0

func (t HydratedDataTuple) Items() []HydratedData

func (HydratedDataTuple) Len added in v0.6.0

func (t HydratedDataTuple) Len() int

type HydratedEndpoint added in v0.6.0

type HydratedEndpoint interface {
	HydratedWire
	Wire() HydratedWire
	Receive(func(HydratedValue, ReceivedContext)) (func(), error)
	Closed() <-chan struct{}
	Termination() Termination
	Close() error
}

HydratedEndpoint owns receiving and closure. Convey only Wire(), on every path.

type HydratedFrame added in v0.6.0

type HydratedFrame struct {
	Scope, ID core.Atom
	Body      HydratedData
}

func UnpackHydratedFrame added in v0.6.0

func UnpackHydratedFrame(value core.Value, limits HydratedCodecLimits) (HydratedFrame, error)

type HydratedReference added in v0.6.0

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

HydratedReference describes a reference. Valid shape implies no liveness or authority.

func NewHydratedReference added in v0.6.0

func NewHydratedReference(path Path, scope, id core.Atom) (HydratedReference, error)

func UnpackHydratedReference added in v0.6.0

func UnpackHydratedReference(value core.Value, limits HydratedCodecLimits) (HydratedReference, error)

func (HydratedReference) ID added in v0.6.0

func (r HydratedReference) ID() core.Atom

func (HydratedReference) Path added in v0.6.0

func (r HydratedReference) Path() Path

func (HydratedReference) Scope added in v0.6.0

func (r HydratedReference) Scope() core.Atom

type HydratedTuple added in v0.6.0

type HydratedTuple = ontoswire.NativeTuple[HydratedWire]

HydratedTuple returns captured children, without exposing mutable storage. Runtime construction collapses a wholly ground tuple to ontos.Tuple.

type HydratedValue added in v0.6.0

type HydratedValue = ontoswire.NativeValue

HydratedValue admits only an ontos Atom/Tuple, a finite immutable HydratedTuple, or a runtime-recognized HydratedWire. An arbitrary Go value is invalid. This open union lets runtimes own recognition without extending ontos.Value.

type HydratedWire added in v0.6.0

type HydratedWire interface{ Send(HydratedValue) error }

HydratedWire grants sending only; success means local admission.

type Parts added in v0.4.0

type Parts[T any] struct {
	Own      T
	Children []Child[T]
}

type Path added in v0.4.0

type Path []core.Atom

func UnpackAddressed added in v0.5.0

func UnpackAddressed(value core.Value) (Path, core.Value, error)

type ReceivedContext added in v0.6.0

type ReceivedContext = any

ReceivedContext is established by composition, never supplied by message data.

type Termination added in v0.4.0

type Termination struct {
	Kind    string
	Message string
}

type Wire

type Wire interface {
	Send(core.Value) error
}

Closed broadcasts resource release. Termination is stable after Closed closes. Send returns local admission only. Receive has one detachable owner.

type WireNode added in v0.5.0

type WireNode = DeixisNode[Wire]

Jump to

Keyboard shortcuts

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