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
- func EventContext(message wire.Message) (context.Context, bool)
- func IncomingMeta(ctx context.Context) map[string]string
- func OutgoingMeta(ctx context.Context) map[string]string
- func WithEventContext(message wire.Message, ctx context.Context) wire.Message
- func WithIncomingMeta(ctx context.Context, meta map[string]string) context.Context
- func WithOutgoingMeta(ctx context.Context, meta map[string]string) context.Context
- type Completion
- type Context
- type Event
- type Source
Constants ¶
const MetaReserved = "nightseam."
MetaReserved prefixes the keys bitwire/1 keeps for itself.
Variables ¶
This section is empty.
Functions ¶
func EventContext ¶
EventContext is the context a bitruntime carrier established for an event.
func IncomingMeta ¶
IncomingMeta is a copy of the meta of the frame whose handler ctx runs under, and nil where the frame carried none.
func OutgoingMeta ¶
OutgoingMeta is what a frame sent from ctx carries, and nil where nothing said. It is read once per frame.
func WithEventContext ¶
WithEventContext associates ctx with an event's message.
func WithIncomingMeta ¶
WithIncomingMeta places what a frame carried on its handler's context.
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) 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.