Documentation
¶
Overview ¶
Package bus is the messaging port (ADR-0008): core pub/sub plus durable JetStream streams/consumers, behind the bus.Bus port. It is the internal-plane messaging substrate — never handed to functions (the raw JetStream API is not exposed beyond this port; blueprint security note).
This package imports no nats library; the embedded-NATS driver (memory / file storage, pure-Go) lives in internal/bus/nats.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus interface {
Publish(ctx context.Context, subject Subject, data []byte) error
Subscribe(ctx context.Context, subject Subject) (Subscription, error)
EnsureStream(ctx context.Context, cfg StreamConfig) error
Consume(ctx context.Context, cfg ConsumeConfig) (Consumer, error)
Close() error
}
Bus is the messaging port: core pub/sub plus durable JetStream streams/consumers. Errors are api/fault kinds; every method is ctx-first. The port imports no nats library.
type ConsumeConfig ¶
ConsumeConfig declares a durable consumer on a stream for a subject filter.
type Consumer ¶
Consumer is a durable JetStream consumer. Close releases it (the stream persists) and stops the delivery goroutine (no leak); C() is closed on Close.
type Message ¶
Message is one delivered message. Ack acknowledges a durable (JetStream) message; for a core Subscription it is a no-op. Drivers construct it via NewMessage.
func NewMessage ¶
NewMessage builds a Message — the driver-facing constructor (the ack closure is unexported, so a driver in another package sets it through here).
type StreamConfig ¶
StreamConfig declares a durable JetStream stream capturing the given subjects.
type Subject ¶
type Subject string
Subject is a typed NATS subject (dot-delimited; namespaced as ns.<namespace>.…).
type Subscription ¶
Subscription is an ephemeral core subscription. Unsubscribe releases it and stops the delivery goroutine (no leak); C() is closed on Unsubscribe.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package buscontract is the shared conformance suite for the bus.Bus port (ADR-0008).
|
Package buscontract is the shared conformance suite for the bus.Bus port (ADR-0008). |
|
Package nats is the embedded-NATS driver for the bus.Bus port (ADR-0008): an in-process nats-server with JetStream (memory or file storage), all pure-Go (no cgo).
|
Package nats is the embedded-NATS driver for the bus.Bus port (ADR-0008): an in-process nats-server with JetStream (memory or file storage), all pure-Go (no cgo). |