Documentation
¶
Overview ¶
Package chanpubsub provides an in-process PubSub implementation backed by Go channels. It supports dot-separated topics with wildcards (* = one segment, > = rest). Ideal for development and testing — zero external deps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanPubSub ¶
type ChanPubSub struct {
// contains filtered or unexported fields
}
ChanPubSub is an in-process fan-out pub/sub with wildcard topic matching.
func (*ChanPubSub) Publish ¶
func (c *ChanPubSub) Publish(topic string, data []byte) error
Publish sends data to all subscribers whose pattern matches the topic. Handlers are called in separate goroutines.
func (*ChanPubSub) Subscribe ¶
func (c *ChanPubSub) Subscribe(topic string, handler func([]byte)) (pubsub.Subscription, error)
Subscribe registers a handler for topics matching the given pattern.
Click to show internal directories.
Click to hide internal directories.