Documentation
¶
Index ¶
- type Bus
- func (b *Bus) ActorSystem() *actor.ActorSystem
- func (b *Bus) AgentKV() nats.KeyValue
- func (b *Bus) ClientPort() int
- func (b *Bus) Close()
- func (b *Bus) Codecs() *msg.CodecRegistry
- func (b *Bus) Conn() *nats.Conn
- func (b *Bus) JS() nats.JetStreamContext
- func (b *Bus) PaneKV() nats.KeyValue
- func (b *Bus) PipelineKV() nats.KeyValue
- func (b *Bus) Publisher() *msg.NATSPublisher
- func (b *Bus) SecretKV() nats.KeyValue
- func (b *Bus) VariableKV() nats.KeyValue
- func (b *Bus) WorkspaceKV() nats.KeyValue
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus wraps either an embedded NATS server or an external connection. It exposes a plain *nats.Conn, two JetStream KV buckets, a proto.actor ActorSystem, a CodecRegistry, and a NATSPublisher.
func (*Bus) ActorSystem ¶
func (b *Bus) ActorSystem() *actor.ActorSystem
ActorSystem returns the proto.actor ActorSystem.
func (*Bus) ClientPort ¶
ClientPort returns the TCP port external CLI clients can connect to. Returns 0 if no TCP listener is available (e.g. external NATS mode).
func (*Bus) Close ¶
func (b *Bus) Close()
Close shuts down the ActorSystem, drains the connection, and shuts down the embedded server (if any).
func (*Bus) PipelineKV ¶
PipelineKV returns the KV bucket for pipeline prompt persistence.
func (*Bus) Publisher ¶
func (b *Bus) Publisher() *msg.NATSPublisher
Publisher returns the NATSPublisher for sending typed messages.
func (*Bus) SecretKV ¶
SecretKV returns the per-session secret store bucket. It may be nil when JetStream is unavailable, in which case secret resolution falls back to config + environment only.
func (*Bus) VariableKV ¶
VariableKV returns the per-session variable store bucket. It may be nil when JetStream is unavailable, in which case variable resolution falls back to config + environment only.
func (*Bus) WorkspaceKV ¶
WorkspaceKV returns the KV bucket for workspace state.
type Config ¶
type Config struct {
Mode string // "embedded" or "external"
URL string // NATS URL, used when Mode == "external"
DataDir string // JetStream storage directory (empty = auto)
SessionName string // used to isolate data dirs per session
Port int // TCP port for embedded NATS server (0 = auto)
}
Config holds the settings needed to initialise a Bus.