pubsub

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package pubsub defines the interface for publish/subscribe messaging used by the stream package. Adapters for NATS, Redis, and in-process channels are provided in sub-packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PubSub

type PubSub interface {
	Publish(topic string, data []byte) error
	Subscribe(topic string, handler func(data []byte)) (Subscription, error)
	Close() error
}

PubSub is the minimal publish/subscribe interface required by the stream Broker. Topics use dot-separated segments with optional wildcards: * matches one segment, > matches the rest.

type Subscription

type Subscription interface {
	Unsubscribe() error
}

Subscription represents an active topic subscription.

Directories

Path Synopsis
Package chanpubsub provides an in-process PubSub implementation backed by Go channels.
Package chanpubsub provides an in-process PubSub implementation backed by Go channels.
Package natspubsub adapts a *nats.Conn to the pubsub.PubSub interface.
Package natspubsub adapts a *nats.Conn to the pubsub.PubSub interface.
Package pubsubtest provides a conformance test suite for PubSub implementations.
Package pubsubtest provides a conformance test suite for PubSub implementations.
Package redispubsub adapts a Redis client to the pubsub.PubSub interface using PUBLISH / SUBSCRIBE / PSUBSCRIBE.
Package redispubsub adapts a Redis client to the pubsub.PubSub interface using PUBLISH / SUBSCRIBE / PSUBSCRIBE.

Jump to

Keyboard shortcuts

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