Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CreateRestaurantCommandType CreateRestaurantCommand type CreateRestaurantCommandType = eh.CommandType("restaurant:create") // ChangeRestaurantNameCommandType ChangeRestaurantNameCommand type ChangeRestaurantNameCommandType = eh.CommandType("restaurant:change_name") )
View Source
const ( // Created is the event after a restaurant is created Created = eh.EventType("restaurant:created") // Deleted is the event after a restaurant is deleted Deleted = eh.EventType("restaurant:deleted") // NameChanged is the event after a restaurant name is changed NameChanged = eh.EventType("restaurant:name_changed") )
View Source
const RestaurantAggregateType = eh.AggregateType("restaurant")
RestaurantAggregateType is the type for the restaurant aggregate
Variables ¶
View Source
var TimeNow = time.Now
TimeNow is a mockable version of time.Now.
Functions ¶
func Setup ¶
func Setup( eventStore eh.EventStore, eventBus eh.EventBus, commandBus *bus.CommandHandler)
Setup configures the domain.
Types ¶
type ChangeRestaurantNameCommand ¶
ChangeRestaurantNameCommand creates a restaurant
func (*ChangeRestaurantNameCommand) AggregateID ¶
func (c *ChangeRestaurantNameCommand) AggregateID() uuid.UUID
AggregateID stub
func (*ChangeRestaurantNameCommand) AggregateType ¶
func (c *ChangeRestaurantNameCommand) AggregateType() eh.AggregateType
AggregateType stub
func (*ChangeRestaurantNameCommand) CommandType ¶
func (c *ChangeRestaurantNameCommand) CommandType() eh.CommandType
CommandType stub
type CreateRestaurantCommand ¶
CreateRestaurantCommand creates a restaurant
func (*CreateRestaurantCommand) AggregateID ¶
func (c *CreateRestaurantCommand) AggregateID() uuid.UUID
AggregateID stub
func (*CreateRestaurantCommand) AggregateType ¶
func (c *CreateRestaurantCommand) AggregateType() eh.AggregateType
AggregateType stub
func (*CreateRestaurantCommand) CommandType ¶
func (c *CreateRestaurantCommand) CommandType() eh.CommandType
CommandType stub
type NameChangedData ¶
type NameChangedData struct {
Name string `json:"name" bson:"name"`
}
NameChangedData contains the data for NameChanged event
type RestaurantAggregate ¶
type RestaurantAggregate struct { *events.AggregateBase // contains filtered or unexported fields }
RestaurantAggregate is the aggregate for restaurant
func (*RestaurantAggregate) ApplyEvent ¶
ApplyEvent implements the ApplyEvent method of the eventhorizon.Aggregate interface.
func (*RestaurantAggregate) HandleCommand ¶
HandleCommand implements the HandleCommand method of the eventhorizon.CommandHandler interface.
Click to show internal directories.
Click to hide internal directories.