mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-12 04:55:39 +08:00
22 lines
346 B
Go
22 lines
346 B
Go
package pubsub
|
|
|
|
import "context"
|
|
|
|
type Event struct {
|
|
Topic string
|
|
Message []byte
|
|
}
|
|
|
|
type Publisher interface {
|
|
Publish(ctx context.Context, topic string, msg []byte) error
|
|
}
|
|
|
|
type Subscriber interface {
|
|
Subscribe(ctx context.Context, name, topic string) (<-chan Event, error)
|
|
}
|
|
|
|
type PublishSubscriber interface {
|
|
Publisher
|
|
Subscriber
|
|
}
|