Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { // Action is the action being performed by event. // Examples: register_user, new_item_inventory etc. Action string `json:"action"` // AggregateID is the ID of aggregate responsible for consuming event. AggregateID int `json:"aggregate_id"` // Data is the data contained by event, Data string `json:"data"` // Timestamp is the time when the event was generated. Timestamp time.Time `json:"timestamp"` // UserID is the associated user's id who generated the event. UserID int `json:"user_id"` // UUID is the unique-indentifier for event. UUID gocql.UUID `json:"uuid"` // Version is the version for events as processed for aggregate-projection. // This is incremented by the aggregate itself each time an aggregate // projection is updated. Version int `json:"version"` // Year bucket is the year in which the event was generated. // This is used as the partitioning key. YearBucket int `json:"year_bucket"` }
Event is an event to be stored in event-store.
type EventMeta ¶
type EventMeta struct { // AggregateVersion tracks the version to be used // by new events for that aggregate. AggregateVersion int64 `json:"aggregate_version"` // AggregateID corresponds to AggregateID in // event-store and ID in aggregate-projection. AggregateID int8 `json:"aggregate_id"` // Year bucket is the year in which the event was generated. // This is used as the partitioning key. YearBucket int16 `json:"year_bucket"` }
EventMeta contains the information about hydrating Aggregate-Projections. The AggregateVersion tracks the version to be used by new events for that aggregate. This difference between the aggregate-projection version and AggregateVersion gives us the versions of the events yet to be applied to the aggregate projection.
type EventStoreQuery ¶ added in v1.2.1
type EventStoreQuery struct { // AggregateID is the id for aggregate whose events are to be fetched AggregateID string `json:"aggregate_id"` // AggregateVersion is the highest version of events that have been // already fetched by the aggregate. The event-store will be queried // for events greater than this version. AggregateVersion int64 `json:"aggregate_version"` }
EventStoreQuery can be used to fetch later events than the specified version.
type KafkaResponse ¶
type KafkaResponse struct { // Input is the message-input received by Consumer. Input string `json:"input"` // Error is the error occurred while processing the Input. // Convert errors to strings, this is just an indication that // something went wrong, so we can signal/display-error to end- // user. Blank Error-string means everything was fine. Error string `json:"error"` }
KafkaResponse is the response from consuming a Kafka message and operating on it. This can be used to as a "response-back" to indicate if the operation was successful or not.
Click to show internal directories.
Click to hide internal directories.