fixtures

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package fixtures contains test implementations of Dogma entities.

Index

Constants

This section is empty.

Variables

View Source
var (
	// MessageA1Packet is a packet containing MessageA1 in JSON format.
	MessageA1Packet marshaling.Packet

	// MessageA2Packet is a packet containing MessageA2 in JSON format.
	MessageA2Packet marshaling.Packet

	// MessageA3Packet is a packet containing MessageA3 in JSON format.
	MessageA3Packet marshaling.Packet
)
View Source
var (
	// MessageB1Packet is a packet containing MessageB1 in JSON format.
	MessageB1Packet marshaling.Packet

	// MessageB2Packet is a packet containing MessageB2 in JSON format.
	MessageB2Packet marshaling.Packet

	// MessageB3Packet is a packet containing MessageB3 in JSON format.
	MessageB3Packet marshaling.Packet
)
View Source
var (
	// MessageC1Packet is a packet containing MessageC1 in JSON format.
	MessageC1Packet marshaling.Packet

	// MessageC2Packet is a packet containing MessageC2 in JSON format.
	MessageC2Packet marshaling.Packet

	// MessageC3Packet is a packet containing MessageC3 in JSON format.
	MessageC3Packet marshaling.Packet
)
View Source
var (
	// MessageD1Packet is a packet containing MessageD1 in JSON format.
	MessageD1Packet marshaling.Packet

	// MessageD2Packet is a packet containing MessageD2 in JSON format.
	MessageD2Packet marshaling.Packet

	// MessageD3Packet is a packet containing MessageD3 in JSON format.
	MessageD3Packet marshaling.Packet
)
View Source
var (
	// MessageE1Packet is a packet containing MessageE1 in JSON format.
	MessageE1Packet marshaling.Packet

	// MessageE2Packet is a packet containing MessageE2 in JSON format.
	MessageE2Packet marshaling.Packet

	// MessageE3Packet is a packet containing MessageE3 in JSON format.
	MessageE3Packet marshaling.Packet
)
View Source
var (
	// MessageF1Packet is a packet containing MessageF1 in JSON format.
	MessageF1Packet marshaling.Packet

	// MessageF2Packet is a packet containing MessageF2 in JSON format.
	MessageF2Packet marshaling.Packet

	// MessageF3Packet is a packet containing MessageF3 in JSON format.
	MessageF3Packet marshaling.Packet
)
View Source
var (
	// MessageG1Packet is a packet containing MessageG1 in JSON format.
	MessageG1Packet marshaling.Packet

	// MessageG2Packet is a packet containing MessageG2 in JSON format.
	MessageG2Packet marshaling.Packet

	// MessageG3Packet is a packet containing MessageG3 in JSON format.
	MessageG3Packet marshaling.Packet
)
View Source
var (
	// MessageH1Packet is a packet containing MessageH1 in JSON format.
	MessageH1Packet marshaling.Packet

	// MessageH2Packet is a packet containing MessageH2 in JSON format.
	MessageH2Packet marshaling.Packet

	// MessageH3Packet is a packet containing MessageH3 in JSON format.
	MessageH3Packet marshaling.Packet
)
View Source
var (
	// MessageI1Packet is a packet containing MessageI1 in JSON format.
	MessageI1Packet marshaling.Packet

	// MessageI2Packet is a packet containing MessageI2 in JSON format.
	MessageI2Packet marshaling.Packet

	// MessageI3Packet is a packet containing MessageI3 in JSON format.
	MessageI3Packet marshaling.Packet
)
View Source
var (
	// MessageJ1Packet is a packet containing MessageJ1 in JSON format.
	MessageJ1Packet marshaling.Packet

	// MessageJ2Packet is a packet containing MessageJ2 in JSON format.
	MessageJ2Packet marshaling.Packet

	// MessageJ3Packet is a packet containing MessageJ3 in JSON format.
	MessageJ3Packet marshaling.Packet
)
View Source
var (
	// MessageK1Packet is a packet containing MessageK1 in JSON format.
	MessageK1Packet marshaling.Packet

	// MessageK2Packet is a packet containing MessageK2 in JSON format.
	MessageK2Packet marshaling.Packet

	// MessageK3Packet is a packet containing MessageK3 in JSON format.
	MessageK3Packet marshaling.Packet
)
View Source
var (
	// MessageL1Packet is a packet containing MessageL1 in JSON format.
	MessageL1Packet marshaling.Packet

	// MessageL2Packet is a packet containing MessageL2 in JSON format.
	MessageL2Packet marshaling.Packet

	// MessageL3Packet is a packet containing MessageL3 in JSON format.
	MessageL3Packet marshaling.Packet
)
View Source
var (
	// MessageM1Packet is a packet containing MessageM1 in JSON format.
	MessageM1Packet marshaling.Packet

	// MessageM2Packet is a packet containing MessageM2 in JSON format.
	MessageM2Packet marshaling.Packet

	// MessageM3Packet is a packet containing MessageM3 in JSON format.
	MessageM3Packet marshaling.Packet
)
View Source
var (
	// MessageN1Packet is a packet containing MessageN1 in JSON format.
	MessageN1Packet marshaling.Packet

	// MessageN2Packet is a packet containing MessageN2 in JSON format.
	MessageN2Packet marshaling.Packet

	// MessageN3Packet is a packet containing MessageN3 in JSON format.
	MessageN3Packet marshaling.Packet
)
View Source
var (
	// MessageO1Packet is a packet containing MessageO1 in JSON format.
	MessageO1Packet marshaling.Packet

	// MessageO2Packet is a packet containing MessageO2 in JSON format.
	MessageO2Packet marshaling.Packet

	// MessageO3Packet is a packet containing MessageO3 in JSON format.
	MessageO3Packet marshaling.Packet
)
View Source
var (
	// MessageP1Packet is a packet containing MessageP1 in JSON format.
	MessageP1Packet marshaling.Packet

	// MessageP2Packet is a packet containing MessageP2 in JSON format.
	MessageP2Packet marshaling.Packet

	// MessageP3Packet is a packet containing MessageP3 in JSON format.
	MessageP3Packet marshaling.Packet
)
View Source
var (
	// MessageQ1Packet is a packet containing MessageQ1 in JSON format.
	MessageQ1Packet marshaling.Packet

	// MessageQ2Packet is a packet containing MessageQ2 in JSON format.
	MessageQ2Packet marshaling.Packet

	// MessageQ3Packet is a packet containing MessageQ3 in JSON format.
	MessageQ3Packet marshaling.Packet
)
View Source
var (
	// MessageR1Packet is a packet containing MessageR1 in JSON format.
	MessageR1Packet marshaling.Packet

	// MessageR2Packet is a packet containing MessageR2 in JSON format.
	MessageR2Packet marshaling.Packet

	// MessageR3Packet is a packet containing MessageR3 in JSON format.
	MessageR3Packet marshaling.Packet
)
View Source
var (
	// MessageS1Packet is a packet containing MessageS1 in JSON format.
	MessageS1Packet marshaling.Packet

	// MessageS2Packet is a packet containing MessageS2 in JSON format.
	MessageS2Packet marshaling.Packet

	// MessageS3Packet is a packet containing MessageS3 in JSON format.
	MessageS3Packet marshaling.Packet
)
View Source
var (
	// MessageT1Packet is a packet containing MessageT1 in JSON format.
	MessageT1Packet marshaling.Packet

	// MessageT2Packet is a packet containing MessageT2 in JSON format.
	MessageT2Packet marshaling.Packet

	// MessageT3Packet is a packet containing MessageT3 in JSON format.
	MessageT3Packet marshaling.Packet
)
View Source
var (
	// MessageU1Packet is a packet containing MessageU1 in JSON format.
	MessageU1Packet marshaling.Packet

	// MessageU2Packet is a packet containing MessageU2 in JSON format.
	MessageU2Packet marshaling.Packet

	// MessageU3Packet is a packet containing MessageU3 in JSON format.
	MessageU3Packet marshaling.Packet
)
View Source
var (
	// MessageV1Packet is a packet containing MessageV1 in JSON format.
	MessageV1Packet marshaling.Packet

	// MessageV2Packet is a packet containing MessageV2 in JSON format.
	MessageV2Packet marshaling.Packet

	// MessageV3Packet is a packet containing MessageV3 in JSON format.
	MessageV3Packet marshaling.Packet
)
View Source
var (
	// MessageW1Packet is a packet containing MessageW1 in JSON format.
	MessageW1Packet marshaling.Packet

	// MessageW2Packet is a packet containing MessageW2 in JSON format.
	MessageW2Packet marshaling.Packet

	// MessageW3Packet is a packet containing MessageW3 in JSON format.
	MessageW3Packet marshaling.Packet
)
View Source
var (
	// MessageX1Packet is a packet containing MessageX1 in JSON format.
	MessageX1Packet marshaling.Packet

	// MessageX2Packet is a packet containing MessageX2 in JSON format.
	MessageX2Packet marshaling.Packet

	// MessageX3Packet is a packet containing MessageX3 in JSON format.
	MessageX3Packet marshaling.Packet
)
View Source
var (
	// MessageY1Packet is a packet containing MessageY1 in JSON format.
	MessageY1Packet marshaling.Packet

	// MessageY2Packet is a packet containing MessageY2 in JSON format.
	MessageY2Packet marshaling.Packet

	// MessageY3Packet is a packet containing MessageY3 in JSON format.
	MessageY3Packet marshaling.Packet
)
View Source
var (
	// MessageZ1Packet is a packet containing MessageZ1 in JSON format.
	MessageZ1Packet marshaling.Packet

	// MessageZ2Packet is a packet containing MessageZ2 in JSON format.
	MessageZ2Packet marshaling.Packet

	// MessageZ3Packet is a packet containing MessageZ3 in JSON format.
	MessageZ3Packet marshaling.Packet
)
View Source
var (
	// MessageAType is the message.Type for the MessageA struct.
	MessageAType = message.TypeOf(MessageA{})

	// MessageA1 is an instance of MessageA with a distinct value to be used in tests.
	MessageA1 = MessageA{"A1"}
	// MessageA2 is an instance of MessageA with a distinct value to be used in tests.
	MessageA2 = MessageA{"A2"}
	// MessageA3 is an instance of MessageA with a distinct value to be used in tests.
	MessageA3 = MessageA{"A3"}
)
View Source
var (
	// MessageBType is the message.Type for the MessageB struct.
	MessageBType = message.TypeOf(MessageB{})

	// MessageB1 is an instance of MessageB with a distinct value to be used in tests.
	MessageB1 = MessageB{"B1"}
	// MessageB2 is an instance of MessageB with a distinct value to be used in tests.
	MessageB2 = MessageB{"B2"}
	// MessageB3 is an instance of MessageB with a distinct value to be used in tests.
	MessageB3 = MessageB{"B3"}
)
View Source
var (
	// MessageCType is the message.Type for the MessageC struct.
	MessageCType = message.TypeOf(MessageC{})

	// MessageC1 is an instance of MessageC with a distinct value to be used in tests.
	MessageC1 = MessageC{"C1"}
	// MessageC2 is an instance of MessageC with a distinct value to be used in tests.
	MessageC2 = MessageC{"C2"}
	// MessageC3 is an instance of MessageC with a distinct value to be used in tests.
	MessageC3 = MessageC{"C3"}
)
View Source
var (
	// MessageDType is the message.Type for the MessageD struct.
	MessageDType = message.TypeOf(MessageD{})

	// MessageD1 is an instance of MessageD with a distinct value to be used in tests.
	MessageD1 = MessageD{"D1"}
	// MessageD2 is an instance of MessageD with a distinct value to be used in tests.
	MessageD2 = MessageD{"D2"}
	// MessageD3 is an instance of MessageD with a distinct value to be used in tests.
	MessageD3 = MessageD{"D3"}
)
View Source
var (
	// MessageEType is the message.Type for the MessageE struct.
	MessageEType = message.TypeOf(MessageE{})

	// MessageE1 is an instance of MessageE with a distinct value to be used in tests.
	MessageE1 = MessageE{"E1"}
	// MessageE2 is an instance of MessageE with a distinct value to be used in tests.
	MessageE2 = MessageE{"E2"}
	// MessageE3 is an instance of MessageE with a distinct value to be used in tests.
	MessageE3 = MessageE{"E3"}
)
View Source
var (
	// MessageFType is the message.Type for the MessageF struct.
	MessageFType = message.TypeOf(MessageF{})

	// MessageF1 is an instance of MessageF with a distinct value to be used in tests.
	MessageF1 = MessageF{"F1"}
	// MessageF2 is an instance of MessageF with a distinct value to be used in tests.
	MessageF2 = MessageF{"F2"}
	// MessageF3 is an instance of MessageF with a distinct value to be used in tests.
	MessageF3 = MessageF{"F3"}
)
View Source
var (
	// MessageGType is the message.Type for the MessageG struct.
	MessageGType = message.TypeOf(MessageG{})

	// MessageG1 is an instance of MessageG with a distinct value to be used in tests.
	MessageG1 = MessageG{"G1"}
	// MessageG2 is an instance of MessageG with a distinct value to be used in tests.
	MessageG2 = MessageG{"G2"}
	// MessageG3 is an instance of MessageG with a distinct value to be used in tests.
	MessageG3 = MessageG{"G3"}
)
View Source
var (
	// MessageHType is the message.Type for the MessageH struct.
	MessageHType = message.TypeOf(MessageH{})

	// MessageH1 is an instance of MessageH with a distinct value to be used in tests.
	MessageH1 = MessageH{"H1"}
	// MessageH2 is an instance of MessageH with a distinct value to be used in tests.
	MessageH2 = MessageH{"H2"}
	// MessageH3 is an instance of MessageH with a distinct value to be used in tests.
	MessageH3 = MessageH{"H3"}
)
View Source
var (
	// MessageIType is the message.Type for the MessageI struct.
	MessageIType = message.TypeOf(MessageI{})

	// MessageI1 is an instance of MessageI with a distinct value to be used in tests.
	MessageI1 = MessageI{"I1"}
	// MessageI2 is an instance of MessageI with a distinct value to be used in tests.
	MessageI2 = MessageI{"I2"}
	// MessageI3 is an instance of MessageI with a distinct value to be used in tests.
	MessageI3 = MessageI{"I3"}
)
View Source
var (
	// MessageJType is the message.Type for the MessageJ struct.
	MessageJType = message.TypeOf(MessageJ{})

	// MessageJ1 is an instance of MessageJ with a distinct value to be used in tests.
	MessageJ1 = MessageJ{"J1"}
	// MessageJ2 is an instance of MessageJ with a distinct value to be used in tests.
	MessageJ2 = MessageJ{"J2"}
	// MessageJ3 is an instance of MessageJ with a distinct value to be used in tests.
	MessageJ3 = MessageJ{"J3"}
)
View Source
var (
	// MessageKType is the message.Type for the MessageK struct.
	MessageKType = message.TypeOf(MessageK{})

	// MessageK1 is an instance of MessageK with a distinct value to be used in tests.
	MessageK1 = MessageK{"K1"}
	// MessageK2 is an instance of MessageK with a distinct value to be used in tests.
	MessageK2 = MessageK{"K2"}
	// MessageK3 is an instance of MessageK with a distinct value to be used in tests.
	MessageK3 = MessageK{"K3"}
)
View Source
var (
	// MessageLType is the message.Type for the MessageL struct.
	MessageLType = message.TypeOf(MessageL{})

	// MessageL1 is an instance of MessageL with a distinct value to be used in tests.
	MessageL1 = MessageL{"L1"}
	// MessageL2 is an instance of MessageL with a distinct value to be used in tests.
	MessageL2 = MessageL{"L2"}
	// MessageL3 is an instance of MessageL with a distinct value to be used in tests.
	MessageL3 = MessageL{"L3"}
)
View Source
var (
	// MessageMType is the message.Type for the MessageM struct.
	MessageMType = message.TypeOf(MessageM{})

	// MessageM1 is an instance of MessageM with a distinct value to be used in tests.
	MessageM1 = MessageM{"M1"}
	// MessageM2 is an instance of MessageM with a distinct value to be used in tests.
	MessageM2 = MessageM{"M2"}
	// MessageM3 is an instance of MessageM with a distinct value to be used in tests.
	MessageM3 = MessageM{"M3"}
)
View Source
var (
	// MessageNType is the message.Type for the MessageN struct.
	MessageNType = message.TypeOf(MessageN{})

	// MessageN1 is an instance of MessageN with a distinct value to be used in tests.
	MessageN1 = MessageN{"N1"}
	// MessageN2 is an instance of MessageN with a distinct value to be used in tests.
	MessageN2 = MessageN{"N2"}
	// MessageN3 is an instance of MessageN with a distinct value to be used in tests.
	MessageN3 = MessageN{"N3"}
)
View Source
var (
	// MessageOType is the message.Type for the MessageO struct.
	MessageOType = message.TypeOf(MessageO{})

	// MessageO1 is an instance of MessageO with a distinct value to be used in tests.
	MessageO1 = MessageO{"O1"}
	// MessageO2 is an instance of MessageO with a distinct value to be used in tests.
	MessageO2 = MessageO{"O2"}
	// MessageO3 is an instance of MessageO with a distinct value to be used in tests.
	MessageO3 = MessageO{"O3"}
)
View Source
var (
	// MessagePType is the message.Type for the MessageP struct.
	MessagePType = message.TypeOf(MessageP{})

	// MessageP1 is an instance of MessageP with a distinct value to be used in tests.
	MessageP1 = MessageP{"P1"}
	// MessageP2 is an instance of MessageP with a distinct value to be used in tests.
	MessageP2 = MessageP{"P2"}
	// MessageP3 is an instance of MessageP with a distinct value to be used in tests.
	MessageP3 = MessageP{"P3"}
)
View Source
var (
	// MessageQType is the message.Type for the MessageQ struct.
	MessageQType = message.TypeOf(MessageQ{})

	// MessageQ1 is an instance of MessageQ with a distinct value to be used in tests.
	MessageQ1 = MessageQ{"Q1"}
	// MessageQ2 is an instance of MessageQ with a distinct value to be used in tests.
	MessageQ2 = MessageQ{"Q2"}
	// MessageQ3 is an instance of MessageQ with a distinct value to be used in tests.
	MessageQ3 = MessageQ{"Q3"}
)
View Source
var (
	// MessageRType is the message.Type for the MessageR struct.
	MessageRType = message.TypeOf(MessageR{})

	// MessageR1 is an instance of MessageR with a distinct value to be used in tests.
	MessageR1 = MessageR{"R1"}
	// MessageR2 is an instance of MessageR with a distinct value to be used in tests.
	MessageR2 = MessageR{"R2"}
	// MessageR3 is an instance of MessageR with a distinct value to be used in tests.
	MessageR3 = MessageR{"R3"}
)
View Source
var (
	// MessageSType is the message.Type for the MessageS struct.
	MessageSType = message.TypeOf(MessageS{})

	// MessageS1 is an instance of MessageS with a distinct value to be used in tests.
	MessageS1 = MessageS{"S1"}
	// MessageS2 is an instance of MessageS with a distinct value to be used in tests.
	MessageS2 = MessageS{"S2"}
	// MessageS3 is an instance of MessageS with a distinct value to be used in tests.
	MessageS3 = MessageS{"S3"}
)
View Source
var (
	// MessageTType is the message.Type for the MessageT struct.
	MessageTType = message.TypeOf(MessageT{})

	// MessageT1 is an instance of MessageT with a distinct value to be used in tests.
	MessageT1 = MessageT{"T1"}
	// MessageT2 is an instance of MessageT with a distinct value to be used in tests.
	MessageT2 = MessageT{"T2"}
	// MessageT3 is an instance of MessageT with a distinct value to be used in tests.
	MessageT3 = MessageT{"T3"}
)
View Source
var (
	// MessageUType is the message.Type for the MessageU struct.
	MessageUType = message.TypeOf(MessageU{})

	// MessageU1 is an instance of MessageU with a distinct value to be used in tests.
	MessageU1 = MessageU{"U1"}
	// MessageU2 is an instance of MessageU with a distinct value to be used in tests.
	MessageU2 = MessageU{"U2"}
	// MessageU3 is an instance of MessageU with a distinct value to be used in tests.
	MessageU3 = MessageU{"U3"}
)
View Source
var (
	// MessageVType is the message.Type for the MessageV struct.
	MessageVType = message.TypeOf(MessageV{})

	// MessageV1 is an instance of MessageV with a distinct value to be used in tests.
	MessageV1 = MessageV{"V1"}
	// MessageV2 is an instance of MessageV with a distinct value to be used in tests.
	MessageV2 = MessageV{"V2"}
	// MessageV3 is an instance of MessageV with a distinct value to be used in tests.
	MessageV3 = MessageV{"V3"}
)
View Source
var (
	// MessageWType is the message.Type for the MessageW struct.
	MessageWType = message.TypeOf(MessageW{})

	// MessageW1 is an instance of MessageW with a distinct value to be used in tests.
	MessageW1 = MessageW{"W1"}
	// MessageW2 is an instance of MessageW with a distinct value to be used in tests.
	MessageW2 = MessageW{"W2"}
	// MessageW3 is an instance of MessageW with a distinct value to be used in tests.
	MessageW3 = MessageW{"W3"}
)
View Source
var (
	// MessageXType is the message.Type for the MessageX struct.
	MessageXType = message.TypeOf(MessageX{})

	// MessageX1 is an instance of MessageX with a distinct value to be used in tests.
	MessageX1 = MessageX{"X1"}
	// MessageX2 is an instance of MessageX with a distinct value to be used in tests.
	MessageX2 = MessageX{"X2"}
	// MessageX3 is an instance of MessageX with a distinct value to be used in tests.
	MessageX3 = MessageX{"X3"}
)
View Source
var (
	// MessageYType is the message.Type for the MessageY struct.
	MessageYType = message.TypeOf(MessageY{})

	// MessageY1 is an instance of MessageY with a distinct value to be used in tests.
	MessageY1 = MessageY{"Y1"}
	// MessageY2 is an instance of MessageY with a distinct value to be used in tests.
	MessageY2 = MessageY{"Y2"}
	// MessageY3 is an instance of MessageY with a distinct value to be used in tests.
	MessageY3 = MessageY{"Y3"}
)
View Source
var (
	// MessageZType is the message.Type for the MessageZ struct.
	MessageZType = message.TypeOf(MessageZ{})

	// MessageZ1 is an instance of MessageZ with a distinct value to be used in tests.
	MessageZ1 = MessageZ{"Z1"}
	// MessageZ2 is an instance of MessageZ with a distinct value to be used in tests.
	MessageZ2 = MessageZ{"Z2"}
	// MessageZ3 is an instance of MessageZ with a distinct value to be used in tests.
	MessageZ3 = MessageZ{"Z3"}
)

Marshaler is a marshaler that is aware of the message and aggregate/process root fixture types. It uses the JSON codec.

Functions

This section is empty.

Types

type AggregateMessageHandler

type AggregateMessageHandler struct {
	NewFunc                    func() dogma.AggregateRoot
	ConfigureFunc              func(dogma.AggregateConfigurer)
	RouteCommandToInstanceFunc func(dogma.Message) string
	HandleCommandFunc          func(dogma.AggregateCommandScope, dogma.Message)
}

AggregateMessageHandler is a test implementation of dogma.AggregateMessageHandler.

func (*AggregateMessageHandler) Configure

Configure configures the behavior of the engine as it relates to this handler.

c provides access to the various configuration options, such as specifying which types of domain command messages are routed to this handler.

If h.ConfigureFunc is non-nil, it calls h.ConfigureFunc(c)

func (*AggregateMessageHandler) HandleCommand

HandleCommand handles a domain command message that has been routed to this handler.

Handling a domain command message involves inspecting the state of the target aggregate instance to determine what changes, if any, should occur. Each change is indicated by recording a domain event message.

s provides access to the operations available within the scope of handling m, such as creating or destroying the targeted instance, accessing its state, and recording domain event messages.

This method must not modify the targeted instance directly. All modifications must be applied by the instance's ApplyEvent() method, which is called for each domain event message that is recorded via s.

It panics with the UnexpectedMessage value if m is not one of the domain command types that is routed to this handler via Configure().

If h.HandleCommandFunc is non-nil it calls h.HandleCommandFunc(s, m).

func (*AggregateMessageHandler) New

New constructs a new aggregate instance and returns its root.

If h.NewFunc is nil, it returns a new empty fixtures.AggregateRoot, otherwise it calls h.NewFunc().

func (*AggregateMessageHandler) RouteCommandToInstance

func (h *AggregateMessageHandler) RouteCommandToInstance(m dogma.Message) string

RouteCommandToInstance returns the ID of the aggregate instance that is targetted by m.

It panics with the UnexpectedMessage value if m is not one of the domain command types that is routed to this handler via Configure().

If h.RouteCommandToInstanceFunc is non-nil it returns the result of h.RouteCommandToInstanceFunc(m), otherwise it panics.

type AggregateRoot

type AggregateRoot struct {
	Value          interface{}
	ApplyEventFunc func(dogma.Message, interface{})
}

AggregateRoot is a test implementation of dogma.AggregateRoot.

func (*AggregateRoot) ApplyEvent

func (v *AggregateRoot) ApplyEvent(m dogma.Message)

ApplyEvent updates the aggregate instance to reflect the fact that a particular domain event has occurred.

It calls v.ApplyEventFunc(m, v.Value)

type Application

type Application struct {
	ConfigureFunc func(dogma.ApplicationConfigurer)
}

Application is a test implementation of dogma.Application.

func (*Application) Configure

func (a *Application) Configure(c dogma.ApplicationConfigurer)

Configure configures the behavior of the engine as it relates to this application.

c provides access to the various configuration options, such as specifying which message handlers the application contains.

If a.ConfigureFunc is non-nil, it calls a.ConfigureFunc(c)

type IntegrationMessageHandler

type IntegrationMessageHandler struct {
	ConfigureFunc     func(dogma.IntegrationConfigurer)
	HandleCommandFunc func(context.Context, dogma.IntegrationCommandScope, dogma.Message) error
	TimeoutHintFunc   func(m dogma.Message) time.Duration
}

IntegrationMessageHandler is a test implementation of dogma.IntegrationMessageHandler.

func (*IntegrationMessageHandler) Configure

Configure configures the behavior of the engine as it relates to this handler.

c provides access to the various configuration options, such as specifying which types of integration command messages are routed to this handler.

If h.ConfigureFunc is non-nil, it calls h.ConfigureFunc(c)

func (*IntegrationMessageHandler) HandleCommand

HandleCommand handles an integration command message that has been routed to this handler.

s provides access to the operations available within the scope of handling m, such as publishing integration event messages.

It panics with the UnexpectedMessage value if m is not one of the integration command types that is routed to this handler via Configure().

If h.HandleCommandFunc is non-nil it calls h.HandleCommandFunc(s, m).

func (*IntegrationMessageHandler) TimeoutHint added in v0.6.0

TimeoutHint returns a duration that is suitable for computing a deadline for the handling of the given message by this handler.

If h.TimeoutHintFunc is non-nil it calls h.TimeoutHintFunc(m).

type MessageA

type MessageA struct {
	Value interface{}
}

MessageA is type used as a dogma.Message in tests.

type MessageB

type MessageB struct {
	Value interface{}
}

MessageB is type used as a dogma.Message in tests.

type MessageC

type MessageC struct {
	Value interface{}
}

MessageC is type used as a dogma.Message in tests.

type MessageD

type MessageD struct {
	Value interface{}
}

MessageD is type used as a dogma.Message in tests.

type MessageE

type MessageE struct {
	Value interface{}
}

MessageE is type used as a dogma.Message in tests.

type MessageF

type MessageF struct {
	Value interface{}
}

MessageF is type used as a dogma.Message in tests.

type MessageG

type MessageG struct {
	Value interface{}
}

MessageG is type used as a dogma.Message in tests.

type MessageH

type MessageH struct {
	Value interface{}
}

MessageH is type used as a dogma.Message in tests.

type MessageI

type MessageI struct {
	Value interface{}
}

MessageI is type used as a dogma.Message in tests.

type MessageJ

type MessageJ struct {
	Value interface{}
}

MessageJ is type used as a dogma.Message in tests.

type MessageK

type MessageK struct {
	Value interface{}
}

MessageK is type used as a dogma.Message in tests.

type MessageL

type MessageL struct {
	Value interface{}
}

MessageL is type used as a dogma.Message in tests.

type MessageM

type MessageM struct {
	Value interface{}
}

MessageM is type used as a dogma.Message in tests.

type MessageN

type MessageN struct {
	Value interface{}
}

MessageN is type used as a dogma.Message in tests.

type MessageO

type MessageO struct {
	Value interface{}
}

MessageO is type used as a dogma.Message in tests.

type MessageP

type MessageP struct {
	Value interface{}
}

MessageP is type used as a dogma.Message in tests.

type MessageQ

type MessageQ struct {
	Value interface{}
}

MessageQ is type used as a dogma.Message in tests.

type MessageR

type MessageR struct {
	Value interface{}
}

MessageR is type used as a dogma.Message in tests.

type MessageS

type MessageS struct {
	Value interface{}
}

MessageS is type used as a dogma.Message in tests.

type MessageT

type MessageT struct {
	Value interface{}
}

MessageT is type used as a dogma.Message in tests.

type MessageU

type MessageU struct {
	Value interface{}
}

MessageU is type used as a dogma.Message in tests.

type MessageV

type MessageV struct {
	Value interface{}
}

MessageV is type used as a dogma.Message in tests.

type MessageW

type MessageW struct {
	Value interface{}
}

MessageW is type used as a dogma.Message in tests.

type MessageX

type MessageX struct {
	Value interface{}
}

MessageX is type used as a dogma.Message in tests.

type MessageY

type MessageY struct {
	Value interface{}
}

MessageY is type used as a dogma.Message in tests.

type MessageZ

type MessageZ struct {
	Value interface{}
}

MessageZ is type used as a dogma.Message in tests.

type ProcessMessageHandler

type ProcessMessageHandler struct {
	NewFunc                  func() dogma.ProcessRoot
	ConfigureFunc            func(dogma.ProcessConfigurer)
	RouteEventToInstanceFunc func(context.Context, dogma.Message) (string, bool, error)
	HandleEventFunc          func(context.Context, dogma.ProcessEventScope, dogma.Message) error
	HandleTimeoutFunc        func(context.Context, dogma.ProcessTimeoutScope, dogma.Message) error
	TimeoutHintFunc          func(m dogma.Message) time.Duration
}

ProcessMessageHandler is a test implementation of dogma.ProcessMessageHandler.

func (*ProcessMessageHandler) Configure

Configure configures the behavior of the engine as it relates to this handler.

c provides access to the various configuration options, such as specifying which types of event messages are routed to this handler.

If h.ConfigureFunc is non-nil, it calls h.ConfigureFunc(c)

func (*ProcessMessageHandler) HandleEvent

HandleEvent handles an event message that has been routed to this handler.

Handling an event message involves inspecting the state of the target process instance to determine what command messages, if any, should be produced.

s provides access to the operations available within the scope of handling m, such as beginning or ending the targeted instance, accessing its state, sending command messages or scheduling timeouts.

This method may manipulate the process's state directly.

It panics with the UnexpectedMessage value if m is not one of the event types that is routed to this handler via Configure().

If h.HandleEventFunc is non-nil it calls h.HandleEventFunc(ctx, s, m).

func (*ProcessMessageHandler) HandleTimeout

HandleTimeout handles a timeout message that has been scheduled with ProcessScope.ScheduleTimeout().

Timeouts can be used to model time within the domain. For example, an application might use a timeout to mark an invoice as overdue after some period of non-payment.

Handling a timeout is much like handling an event in that much the same operations are available to the handler via s.

This method may manipulate the process's state directly.

If m was not expected by the handler the implementation must panic with an UnexpectedMessage value.

If h.HandleTimeoutFunc is non-nil it calls h.HandleTimeoutFunc(ctx, s, m).

func (*ProcessMessageHandler) New

New constructs a new process instance and returns its root.

If h.NewFunc is nil, it returns a new empty fixtures.ProcessRoot, otherwise it calls h.NewFunc().

func (*ProcessMessageHandler) RouteEventToInstance

func (h *ProcessMessageHandler) RouteEventToInstance(
	ctx context.Context,
	m dogma.Message,
) (string, bool, error)

RouteEventToInstance returns the ID of the process instance that is targetted by m.

It panics with the UnexpectedMessage value if m is not one of the event types that is routed to this handler via Configure().

If ok is false, the message is not routed to this handler at all.

If h.RouteEventToInstance is non-nil it returns the result of h.RouteEventToInstance(ctx, m), otherwise it panics.

func (*ProcessMessageHandler) TimeoutHint added in v0.6.0

func (h *ProcessMessageHandler) TimeoutHint(m dogma.Message) time.Duration

TimeoutHint returns a duration that is suitable for computing a deadline for the handling of the given message by this handler.

If h.TimeoutHintFunc is non-nil it calls h.TimeoutHintFunc(m).

type ProcessRoot

type ProcessRoot struct {
	Value interface{}
}

ProcessRoot is a test implementation of dogma.ProcessRoot.

type ProjectionMessageHandler

type ProjectionMessageHandler struct {
	ConfigureFunc       func(dogma.ProjectionConfigurer)
	HandleEventFunc     func(context.Context, []byte, []byte, []byte, dogma.ProjectionEventScope, dogma.Message) (bool, error)
	ResourceVersionFunc func(context.Context, []byte) ([]byte, error)
	CloseResourceFunc   func(context.Context, []byte) error
	TimeoutHintFunc     func(m dogma.Message) time.Duration
}

ProjectionMessageHandler is a test implementation of dogma.ProjectionMessageHandler.

func (*ProjectionMessageHandler) CloseResource added in v0.6.0

func (h *ProjectionMessageHandler) CloseResource(ctx context.Context, k []byte) error

CloseResource informs the projection that the resource r will not be used in any future calls to HandleEvent().

If h.CloseResourceFunc is non-nil it calls h.CloseResourceFunc(ctx, k).

func (*ProjectionMessageHandler) Configure

Configure configures the behavior of the engine as it relates to this handler.

c provides access to the various configuration options, such as specifying which types of event messages are routed to this handler.

If h.ConfigureFunc is non-nil, it calls h.ConfigureFunc(c)

func (*ProjectionMessageHandler) HandleEvent

func (h *ProjectionMessageHandler) HandleEvent(
	ctx context.Context,
	r, c, n []byte,
	s dogma.ProjectionEventScope,
	m dogma.Message,
) (bool, error)

HandleEvent handles a domain event message that has been routed to this handler.

s provides access to the operations available within the scope of handling m.

It panics with the UnexpectedMessage value if m is not one of the event types that is routed to this handler via Configure().

If h.HandleEventFunc is non-nil it calls h.HandleEventFunc(ctx, r,c,n, s, m).

func (*ProjectionMessageHandler) ResourceVersion added in v0.6.0

func (h *ProjectionMessageHandler) ResourceVersion(ctx context.Context, k []byte) ([]byte, error)

ResourceVersion returns the version of the resource r.

If h.ResourceVersionFunc is non-nil it calls h.ResourceVersionFunc(ctx, k).

func (*ProjectionMessageHandler) TimeoutHint added in v0.6.0

TimeoutHint returns a duration that is suitable for computing a deadline for the handling of the given message by this handler.

If h.TimeoutHintFunc is non-nil it calls h.TimeoutHintFunc(m).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL