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 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.