Documentation
¶
Overview ¶
Package model provides structs (models) used commonly through services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd represents a Command. Use #NewCmd to create new instance.
func NewCmd ¶
NewCmd validates provided config and creates a new Cmd. Uses current UTC-time if time is not set.
func (Cmd) CorrelationKey ¶
CorrelationKey returns Command-CorrelationKey.
type CmdAction ¶
type CmdAction string
CmdAction represents a Command-action.
type CmdCfg ¶
type CmdCfg struct { CorrelationKey string Time time.Time Action CmdAction `validate:"nonzero"` Data interface{} }
CmdCfg is config for Cmd.
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event represents a Command. Use #NewEvent to create new instance.
func NewEvent ¶
NewEvent validates provided config and creates a new Event. Uses current UTC-time if time is not set.
func (Event) AggregateID ¶
AggregateID return Event-AggregateID.
func (Event) CorrelationKey ¶
CorrelationKey return Event-CorrelationKey.
type EventAction ¶
type EventAction string
EventAction represents an Event-action.
const ( TxnRead EventAction = "TxnRead" TxnCreated EventAction = "TxnCreated" TxnCreateFailed EventAction = "TxnCreateFailed" AccountDeposited EventAction = "AccountDeposited" AccountWithdrawn EventAction = "AccountWithdrawn" AccountLimitExceeded EventAction = "AccountLimitExceeded" DuplicateTxn EventAction = "DuplicateTxn" DataWritten EventAction = "DataWritten" )
Domain events
func (EventAction) String ¶
func (ea EventAction) String() string
String returns string-representation of a EventAction.