Documentation
¶
Index ¶
Constants ¶
View Source
const ( // EventType is a the type for Event. EventType eh.EventType = "CodecEvent" // AggregateType is the type for Aggregate. AggregateType eh.AggregateType = "CodecAggregate" // CommandType is the type for Command. CommandType eh.CommandType = "CodecCommand" )
Variables ¶
This section is empty.
Functions ¶
func CommandCodecAcceptanceTest ¶
func CommandCodecAcceptanceTest(t *testing.T, c eh.CommandCodec, expectedBytes []byte)
CommandCodecAcceptanceTest is the acceptance test that all implementations of CommandCodec should pass. It should manually be called from a test case in each implementation:
func TestCommandCodec(t *testing.T) {
c := CommandCodec{}
expectedBytes = []byte("")
codec.CommandCodecAcceptanceTest(t, c, expectedBytes)
}
func EventCodecAcceptanceTest ¶
func EventCodecAcceptanceTest(t *testing.T, c eh.EventCodec, expectedBytes []byte)
EventCodecAcceptanceTest is the acceptance test that all implementations of EventCodec should pass. It should manually be called from a test case in each implementation:
func TestEventCodec(t *testing.T) {
c := EventCodec{}
expectedBytes = []byte("")
codec.EventCodecAcceptanceTest(t, c, expectedBytes)
}
Types ¶
type Command ¶
type Command struct {
ID uuid.UUID
Bool bool
String string
Number float64
Slice []string
Map map[string]interface{}
Time time.Time
TimeRef *time.Time
NullTime *time.Time
Struct Nested
StructRef *Nested
NullStruct *Nested
}
Command is a mocked eventhorizon.Command, useful in testing.
func (*Command) AggregateID ¶
func (*Command) AggregateType ¶
func (t *Command) AggregateType() eh.AggregateType
func (*Command) CommandType ¶
func (t *Command) CommandType() eh.CommandType
Click to show internal directories.
Click to hide internal directories.