11 lines
250 B
Go
11 lines
250 B
Go
package pubSub
|
|
|
|
// PubSub defines the public API for a publish/subscribe system.
|
|
type PubSub interface {
|
|
Subscribe(id, topic string, cb func(any))
|
|
Unsubscribe(id, topic string)
|
|
UnsubscribeAll(id string)
|
|
Publish(topic string, data any)
|
|
Close()
|
|
}
|