Files
micromdm/platform/pubsub/pubsub.go
Victor Vrantchan 91c236c8c3 organize essential APIs into platform, workflow and pkg folders (#337)
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.
2017-11-23 22:07:57 -05:00

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
}