mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-06 09:16:24 +08:00
Add more logic to the way code is organized. /pkg -- library code not directly connected to micromdm /mdm -- packages meant for the services devices interract with. The MDM protocol. /dep -- DEP API and related packages. /platform -- Core APIs the server provides. Commands API, Devices API, queue, pubsub etc. /workflow -- Packages/API that build on top of platform. Today that's the webhook package. Depending on what ends up here, the workflow folder might become its own repository.
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
|
|
}
|