Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventType ¶
type EventType string
const ( NewOrder EventType = `new_order` CancelOrder EventType = `cancale_order` CompleteOrder EventType = `complete_order` PaymentsConfirmed EventType = `payments_confirmed` PaymentsFailed EventType = `paymants_failed` StockConfirmed EventType = `stock_confirmed` StockFailed EventType = `stock_failed` )
func GetEventType ¶
type OrderEvent ¶
type OrderEvent struct { Event OrderID uuid.UUID `json:"order_id"` CustomerID uuid.UUID `json:"customer_id"` Price decimal.Decimal `json:"price"` PaymentID uuid.UUID `json:"payment_id,omitempty"` Items string `json:"items"` }
func ToOrderEvent ¶
func ToOrderEvent(values map[string]any) (OrderEvent, error)
func ToRolbackEvent ¶
func ToRolbackEvent(values map[string]any) (OrderEvent, error)
func (OrderEvent) Map ¶
func (e OrderEvent) Map() map[string]string
func (*OrderEvent) SetType ¶
func (e *OrderEvent) SetType(kind EventType)
type PaymentsEvent ¶
type PaymentsEvent struct { Event OrderID uuid.UUID `json:"order_id"` PaymentsID uuid.UUID `json:"payments_id"` }
func ToPaymentsEvent ¶
func ToPaymentsEvent(values map[string]any) (PaymentsEvent, error)
func (PaymentsEvent) Map ¶
func (e PaymentsEvent) Map() map[string]string
func (*PaymentsEvent) SetType ¶
func (e *PaymentsEvent) SetType(kind EventType)
type RollbackEvent ¶
func (RollbackEvent) Map ¶
func (e RollbackEvent) Map() map[string]string
type StockEvent ¶
func ToStockEvent ¶
func ToStockEvent(values map[string]any) (StockEvent, error)
func (StockEvent) Map ¶
func (e StockEvent) Map() map[string]string
func (*StockEvent) SetType ¶
func (e *StockEvent) SetType(kind EventType)
Click to show internal directories.
Click to hide internal directories.