Documentation ¶
Index ¶
- func MockCommand(setup func(m *coremocks.Command)) *coremocks.Command
- func MockEntity(setup func(m *coremocks.Entity)) *coremocks.Entity
- func MockEvent(setup func(m *coremocks.Event)) *coremocks.Event
- func MockReply(setup func(m *coremocks.Reply)) *coremocks.Reply
- type Command
- type Entity
- type Event
- type Reply
- type TestMarshaller
- type UnregisteredCommand
- type UnregisteredEvent
- type UnregisteredReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockCommand ¶ added in v0.0.4
func MockEntity ¶ added in v0.0.4
Types ¶
type Command ¶ added in v0.0.4
type Command struct{ Value string }
func (Command) CommandName ¶ added in v0.0.4
type Entity ¶ added in v0.0.4
type Entity struct { core.EntityBase Value string }
func (Entity) EntityName ¶ added in v0.0.4
type TestMarshaller ¶
type TestMarshaller struct {
// contains filtered or unexported fields
}
TestMarshaller returns a Marshaller for testing purposes
JSON encoding is used for the Marshal and Unmarshal methods.
The registered types may be reset using Reset() at any time while testing.
func NewTestMarshaller ¶
func NewTestMarshaller() *TestMarshaller
NewTestMarshaller constructs a new TestMarshaller
func (*TestMarshaller) GetType ¶
func (m *TestMarshaller) GetType(typeName string) reflect.Type
GetType returns the reflect.Type if it has been registered
func (*TestMarshaller) Marshal ¶
func (*TestMarshaller) Marshal(v interface{}) ([]byte, error)
Marshal returns v in byte form
func (*TestMarshaller) RegisterType ¶
func (m *TestMarshaller) RegisterType(typeName string, v reflect.Type)
RegisterType registers a new reflect.Type for the given name key
func (*TestMarshaller) Reset ¶
func (m *TestMarshaller) Reset()
Reset will remove all previously registered types
func (*TestMarshaller) Unmarshal ¶
func (*TestMarshaller) Unmarshal(data []byte, v interface{}) error
Unmarshal returns the bytes marshalled into v
type UnregisteredCommand ¶ added in v0.0.4
type UnregisteredCommand struct{ Value string }
func (UnregisteredCommand) CommandName ¶ added in v0.0.4
func (UnregisteredCommand) CommandName() string
type UnregisteredEvent ¶ added in v0.0.4
type UnregisteredEvent struct{ Value string }
func (UnregisteredEvent) EventName ¶ added in v0.0.4
func (UnregisteredEvent) EventName() string
type UnregisteredReply ¶ added in v0.0.4
type UnregisteredReply struct{ Value string }
func (UnregisteredReply) ReplyName ¶ added in v0.0.4
func (UnregisteredReply) ReplyName() string
Click to show internal directories.
Click to hide internal directories.