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 AggBuilder service. This is the medium through which the new events are distributed.
func (*EventsIO) BuildState ¶
func (e *EventsIO) BuildState( correlationID uuuid.UUID, timeoutSec int, ) (<-chan *EventResponse, error)
BuildState gets events from EventStore-service.
func (*EventsIO) Close ¶
func (e *EventsIO) Close()
Close closes any open routines associated with AggBuilder service, such as Kafka Producers and Consumers. Use this when the service is no longer required.
func (*EventsIO) Wait ¶
Wait is a wrapper for errgroup.Wait, and will wait for all AggBuilder 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 AggBuilder service.
type KafkaConfig ¶
type KafkaConfig struct { // Consumer for EventStoreQuery-response // The first topic in Consumer-Topics is used as "Topic" field for EventStoreQuery. ESQueryResCons *kafka.ConsumerConfig EOSToken string // 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.