Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MainQueueName is the name of the main queue // All events will go through here as they are forwarded to the consumer via the // group name // TODO: "fan-out" so not all events go through the same queue? requires investigation. MainQueueName = "main-queue" // MetadatakeyEventType is the key used for the eventtype in the metadata map of the event. MetadatakeyEventType = "eventtype" )
Functions ¶
func Consume ¶
func Consume(s Consumer, group string, evs ...Unmarshaller) (<-chan interface{}, error)
Consume returns a channel that will get all events that match the given evs group defines the service type: One group will get exactly one copy of a event that is emitted NOTE: uses reflect on initialization.
Types ¶
type Publisher ¶
type Publisher interface {
Publish(string, interface{}, ...events.PublishOption) error
}
Publisher is the interface publishers need to fulfill.
type ShareCreated ¶
type ShareCreated struct { // split the protobuf Grantee oneof so we can use stdlib encoding/json }
ShareCreated is emitted when a share is created.
func (ShareCreated) Unmarshal ¶
func (ShareCreated) Unmarshal(v []byte) (interface{}, error)
Unmarshal to fulfill umarshaller interface.
type Stream ¶
type Stream interface { Publish(string, interface{}, ...events.PublishOption) error Consume(string, ...events.ConsumeOption) (<-chan events.Event, error) }
Stream is the interface common to Publisher and Consumer.
type Unmarshaller ¶
Unmarshaller is the interface events need to fulfill.
Directories ¶
Path | Synopsis |
---|---|
consumer
Package consumer contains an example implementation of an event consumer
|
Package consumer contains an example implementation of an event consumer |
publisher
Package publisher contains an example implementation for a publisher
|
Package publisher contains an example implementation for a publisher |
Click to show internal directories.
Click to hide internal directories.