delivery

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 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.

Documentation

Overview

Package delivery is the received context bitruntime's own carriers establish and its own helpers recognize. Bitwire 0.3 lets Go keep that association private to the runtime; this package is internal so that nothing outside bitruntime can construct or claim it. A foreign return capability therefore carries no recognized context, and a message's visible fields never do.

Index

Constants

View Source
const MetaReserved = "nightseam."

MetaReserved prefixes the keys bitwire/1 keeps for itself.

Variables

This section is empty.

Functions

func EventContext

func EventContext(message wire.Message) (context.Context, bool)

EventContext is the context a bitruntime carrier established for an event.

func IncomingMeta

func IncomingMeta(ctx context.Context) map[string]string

IncomingMeta is a copy of the meta of the frame whose handler ctx runs under, and nil where the frame carried none.

func OutgoingMeta

func OutgoingMeta(ctx context.Context) map[string]string

OutgoingMeta is what a frame sent from ctx carries, and nil where nothing said. It is read once per frame.

func WithEventContext

func WithEventContext(message wire.Message, ctx context.Context) wire.Message

WithEventContext associates ctx with an event's message.

func WithIncomingMeta

func WithIncomingMeta(ctx context.Context, meta map[string]string) context.Context

WithIncomingMeta places what a frame carried on its handler's context.

func WithOutgoingMeta

func WithOutgoingMeta(ctx context.Context, meta map[string]string) context.Context

WithOutgoingMeta says what the requests and events sent from ctx carry.

Types

type Completion

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

Completion carries the cause of a local handler's cancellation. Only a local handler can supply it; a serialized public error, even one named cancelled, keeps its ordinary error outcome.

func (*Completion) Get

func (c *Completion) Get() error

Get is the recorded cause, or nil.

func (*Completion) Set

func (c *Completion) Set(err error)

Set records the cause of a handler's cancellation.

type Context

type Context struct {
	Ctx           context.Context
	MaxFrameBytes int64
	Panic         func(any)
	Traceparent   string
	Tracestate    string
	Completion    *Completion
}

Context is what a carrier established for one admitted request: the base context its handler runs under, the frame limit its reply must fit, where a handler panic is reported, the trace members it arrived with, and how a handler's own cancellation cause reaches a forwarded reply.

func Of

func Of(message wire.Message) *Context

Of is the context a bitruntime carrier established for message, if its return capability is one of bitruntime's own.

type Event

type Event struct{ Ctx context.Context }

Event is the local capability an event carries so that the context a receiving runtime established survives queued local composition. It is not a return address: an event has no reply and no request lifetime.

func (*Event) Send

func (*Event) Send([]string, wire.Message) error

Send refuses: an event context is not a return address.

type Source

type Source interface {
	BitruntimeDelivery() *Context
}

Source is implemented by return capabilities bitruntime minted. The method returns a type only this module can name, so no other package can claim it.

Jump to

Keyboard shortcuts

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