Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateMeta ¶
type AggregateMeta struct { ID objectid.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"` AggregateID int8 `bson:"aggregateID,omitempty" json:"aggregateID,omitempty"` Version int64 `bson:"version,omitempty" json:"version,omitempty"` }
AggregateMeta contains current versions for Aggregates. This version is updated everytime an Aggregate receives an associated Event.
type EventResponse ¶
EventResponse is the response distributed over the EventsIO channels.
type EventsIO ¶
type EventsIO struct {
// contains filtered or unexported fields
}
EventsIO allows interacting with the EventsPoll service. This is the medium through which the new events are distributed.
func (*EventsIO) Close ¶
func (e *EventsIO) Close()
Close closes any open routines associated with EventsPoll service, such as Kafka Producers and Consumers. Use this when the service is no longer required.
func (*EventsIO) Events ¶
func (e *EventsIO) Events() <-chan *EventResponse
Events channel. New events from EventStoreQuery are received here.
func (*EventsIO) RoutinesGroup ¶
RoutinesGroup returns the errgroup used for EventsPoll-routines.
func (*EventsIO) Wait ¶
Wait is a wrapper for errgroup.Wait, and will wait for all EventsPoll and RoutinesGroup routines to exit, and propagate the error from errgroup.Wait. This is not meant to do FanOut, it always returns the same channel. FanOut logic must be implemented by library-user. Note: The resulting channel will get data only once, and is then closed.
type IOConfig ¶
type IOConfig struct { KafkaConfig KafkaConfig MongoConfig MongoConfig }
IOConfig is the configuration for EventPoll service.
type KafkaConfig ¶
type KafkaConfig struct { // Consumer for EventStoreQuery-response ESQueryResCons *kafka.ConsumerConfig // Consumer for Event EventCons *kafka.ConsumerConfig // Producer for making requests to ESQuery ESQueryReqProd *kafka.ProducerConfig // Topic on which requests to EventStoreQuery should be sent. ESQueryReqTopic string }
KafkaConfig is the configuration for Kafka, such as brokers and topics.
type MongoConfig ¶
type MongoConfig struct { AggregateID int8 AggCollection *mongo.Collection // Collection/Database in which Aggregate metadata is stored. Connection *mongo.ConnectionConfig MetaDatabaseName string MetaCollectionName string }
MongoConfig is the configuration for MongoDB client.
type ReadConfig ¶
ReadConfig allows choosing what type of events should be processed. Warning: Be sure to read the associated EventsIO channel if it is enabled here. Otherwise it will result in a deadlock!