Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEventListener ¶
CreateEventListener starts a goroutine that listens for event notifications from the database. It parses those events and sends them to the state to be processed.
Types ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is the projection of the events into the state of the application.
func NewState ¶
func NewState() *State
NewState returns a new state object to keep track of all aggregates.
type Ticket ¶
type Ticket struct { ID TicketID Status TicketStatus IssuedAt time.Time }
Ticket is an issued ticket for a car in a carpark
type TicketStatus ¶
type TicketStatus int
TicketStatus is an enum for tracking state of a ticket. A stringer is generated for this type.
const ( // TicketStatusIssued is the initial state of a new ticket TicketStatusIssued TicketStatus = iota // TicketStatusPaid means that the ticket has been paid for TicketStatusPaid )
func (TicketStatus) String ¶
func (i TicketStatus) String() string
Click to show internal directories.
Click to hide internal directories.