testapp

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package testapp contains a Dogma application that is used to test engine implementations.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidIntegrationMessage = errors.New("integration message is invalid")

ErrInvalidIntegrationMessage is returned by the IntegrationCommand.Validate() if the IsInvalid flag is true.

View Source
var File_github_com_dogmatiq_enginekit_enginetest_internal_testapp_events_proto protoreflect.FileDescriptor
View Source
var File_github_com_dogmatiq_enginekit_enginetest_internal_testapp_integration_proto protoreflect.FileDescriptor
View Source
var File_github_com_dogmatiq_enginekit_enginetest_internal_testapp_process_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type App

type App struct {
	Events EventProjection
}

App is a Dogma application that is used to test the engine.

func (*App) Configure

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

Configure configures the Dogma application.

type DoActions added in v0.16.2

type DoActions struct {
	Actions []*action.Action `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"`
	// contains filtered or unexported fields
}

func (*DoActions) Descriptor deprecated added in v0.16.2

func (*DoActions) Descriptor() ([]byte, []int)

Deprecated: Use DoActions.ProtoReflect.Descriptor instead.

func (*DoActions) GetActions added in v0.16.2

func (x *DoActions) GetActions() []*action.Action

func (*DoActions) MarshalBinary added in v0.18.0

func (x *DoActions) MarshalBinary() ([]byte, error)

MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).

It allows *DoActions to implement encoding.BinaryMarshaler.

func (*DoActions) MessageDescription added in v0.16.2

func (x *DoActions) MessageDescription() string

MessageDescription returns a human-readable description of the message.

func (*DoActions) ProtoMessage added in v0.16.2

func (*DoActions) ProtoMessage()

func (*DoActions) ProtoReflect added in v0.16.2

func (x *DoActions) ProtoReflect() protoreflect.Message

func (*DoActions) Reset added in v0.16.2

func (x *DoActions) Reset()

func (*DoActions) SetActions added in v0.16.2

func (x *DoActions) SetActions(v []*action.Action)

SetActions sets the x.Actions field to v, then returns x.

func (*DoActions) String added in v0.16.2

func (x *DoActions) String() string

func (*DoActions) UnmarshalBinary added in v0.18.0

func (x *DoActions) UnmarshalBinary(data []byte) error

UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).

It allows *DoActions to implement encoding.BinaryUnmarshaler.

func (*DoActions) Validate added in v0.16.2

Validate returns an error if the message is invalid.

type DoActionsBuilder added in v0.16.2

type DoActionsBuilder struct {
	// contains filtered or unexported fields
}

func NewDoActionsBuilder added in v0.16.2

func NewDoActionsBuilder() *DoActionsBuilder

NewDoActionsBuilder returns a builder that constructs DoActions messages.

func (*DoActionsBuilder) Build added in v0.16.2

func (b *DoActionsBuilder) Build() *DoActions

Build returns a new DoActions containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*DoActionsBuilder) From added in v0.16.2

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*DoActionsBuilder) WithActions added in v0.16.2

func (b *DoActionsBuilder) WithActions(v []*action.Action) *DoActionsBuilder

WithActions configures the builder to set the Actions field to v, then returns b.

type EventProjection

type EventProjection struct {
	dogma.NoCompactBehavior
	dogma.NoResetBehavior
	// contains filtered or unexported fields
}

EventProjection tracks all events produced by the test application.

func (*EventProjection) CheckpointOffset added in v0.17.0

func (h *EventProjection) CheckpointOffset(_ context.Context, id string) (uint64, error)

CheckpointOffset returns the offset at which the handler expects to resume handling events from a specific stream.

func (*EventProjection) Configure

func (h *EventProjection) Configure(c dogma.ProjectionConfigurer)

Configure describes the handler's configuration to the engine.

func (*EventProjection) HandleEvent

HandleEvent updates the projection to reflect the occurrence of an event.

func (*EventProjection) Range

func (h *EventProjection) Range(
	ctx context.Context,
	fn func(dogma.Event) bool,
) error

Range calls fn for each event that the application records until fn returns false or ctx is canceled.

type GenericEvent added in v0.16.2

type GenericEvent struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*GenericEvent) Descriptor deprecated added in v0.16.2

func (*GenericEvent) Descriptor() ([]byte, []int)

Deprecated: Use GenericEvent.ProtoReflect.Descriptor instead.

func (*GenericEvent) GetValue added in v0.16.2

func (x *GenericEvent) GetValue() string

func (*GenericEvent) MarshalBinary added in v0.18.0

func (x *GenericEvent) MarshalBinary() ([]byte, error)

MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).

It allows *GenericEvent to implement encoding.BinaryMarshaler.

func (*GenericEvent) MessageDescription added in v0.16.2

func (x *GenericEvent) MessageDescription() string

MessageDescription returns a human-readable description of the message.

func (*GenericEvent) ProtoMessage added in v0.16.2

func (*GenericEvent) ProtoMessage()

func (*GenericEvent) ProtoReflect added in v0.16.2

func (x *GenericEvent) ProtoReflect() protoreflect.Message

func (*GenericEvent) Reset added in v0.16.2

func (x *GenericEvent) Reset()

func (*GenericEvent) SetValue added in v0.16.2

func (x *GenericEvent) SetValue(v string)

SetValue sets the x.Value field to v, then returns x.

func (*GenericEvent) String added in v0.16.2

func (x *GenericEvent) String() string

func (*GenericEvent) UnmarshalBinary added in v0.18.0

func (x *GenericEvent) UnmarshalBinary(data []byte) error

UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).

It allows *GenericEvent to implement encoding.BinaryUnmarshaler.

func (*GenericEvent) Validate added in v0.16.2

Validate returns an error if the message is invalid.

type GenericEventBuilder added in v0.16.2

type GenericEventBuilder struct {
	// contains filtered or unexported fields
}

func NewGenericEventBuilder added in v0.16.2

func NewGenericEventBuilder() *GenericEventBuilder

NewGenericEventBuilder returns a builder that constructs GenericEvent messages.

func (*GenericEventBuilder) Build added in v0.16.2

func (b *GenericEventBuilder) Build() *GenericEvent

Build returns a new GenericEvent containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*GenericEventBuilder) From added in v0.16.2

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*GenericEventBuilder) WithValue added in v0.16.2

WithValue configures the builder to set the Value field to v, then returns b.

type IntegrationCommandA

type IntegrationCommandA struct {
	IsInvalid bool             `protobuf:"varint,1,opt,name=is_invalid,json=isInvalid,proto3" json:"is_invalid,omitempty"`
	Actions   []*action.Action `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"`
	// contains filtered or unexported fields
}

func (*IntegrationCommandA) Descriptor deprecated

func (*IntegrationCommandA) Descriptor() ([]byte, []int)

Deprecated: Use IntegrationCommandA.ProtoReflect.Descriptor instead.

func (*IntegrationCommandA) GetActions

func (x *IntegrationCommandA) GetActions() []*action.Action

func (*IntegrationCommandA) GetIsInvalid

func (x *IntegrationCommandA) GetIsInvalid() bool

func (*IntegrationCommandA) MarshalBinary added in v0.18.0

func (x *IntegrationCommandA) MarshalBinary() ([]byte, error)

MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).

It allows *IntegrationCommandA to implement encoding.BinaryMarshaler.

func (*IntegrationCommandA) MessageDescription

func (x *IntegrationCommandA) MessageDescription() string

MessageDescription returns a human-readable description of the message.

func (*IntegrationCommandA) ProtoMessage

func (*IntegrationCommandA) ProtoMessage()

func (*IntegrationCommandA) ProtoReflect

func (x *IntegrationCommandA) ProtoReflect() protoreflect.Message

func (*IntegrationCommandA) Reset

func (x *IntegrationCommandA) Reset()

func (*IntegrationCommandA) SetActions

func (x *IntegrationCommandA) SetActions(v []*action.Action)

SetActions sets the x.Actions field to v, then returns x.

func (*IntegrationCommandA) SetIsInvalid

func (x *IntegrationCommandA) SetIsInvalid(v bool)

SetIsInvalid sets the x.IsInvalid field to v, then returns x.

func (*IntegrationCommandA) String

func (x *IntegrationCommandA) String() string

func (*IntegrationCommandA) UnmarshalBinary added in v0.18.0

func (x *IntegrationCommandA) UnmarshalBinary(data []byte) error

UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).

It allows *IntegrationCommandA to implement encoding.BinaryUnmarshaler.

func (*IntegrationCommandA) Validate

Validate returns an error if the message is invalid.

type IntegrationCommandABuilder

type IntegrationCommandABuilder struct {
	// contains filtered or unexported fields
}

func NewIntegrationCommandABuilder

func NewIntegrationCommandABuilder() *IntegrationCommandABuilder

NewIntegrationCommandABuilder returns a builder that constructs IntegrationCommandA messages.

func (*IntegrationCommandABuilder) Build

Build returns a new IntegrationCommandA containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*IntegrationCommandABuilder) From

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*IntegrationCommandABuilder) WithActions

WithActions configures the builder to set the Actions field to v, then returns b.

func (*IntegrationCommandABuilder) WithIsInvalid

WithIsInvalid configures the builder to set the IsInvalid field to v, then returns b.

type IntegrationCommandB

type IntegrationCommandB struct {
	IsInvalid bool             `protobuf:"varint,1,opt,name=is_invalid,json=isInvalid,proto3" json:"is_invalid,omitempty"`
	Actions   []*action.Action `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"`
	// contains filtered or unexported fields
}

func (*IntegrationCommandB) Descriptor deprecated

func (*IntegrationCommandB) Descriptor() ([]byte, []int)

Deprecated: Use IntegrationCommandB.ProtoReflect.Descriptor instead.

func (*IntegrationCommandB) GetActions

func (x *IntegrationCommandB) GetActions() []*action.Action

func (*IntegrationCommandB) GetIsInvalid

func (x *IntegrationCommandB) GetIsInvalid() bool

func (*IntegrationCommandB) MarshalBinary added in v0.18.0

func (x *IntegrationCommandB) MarshalBinary() ([]byte, error)

MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).

It allows *IntegrationCommandB to implement encoding.BinaryMarshaler.

func (*IntegrationCommandB) MessageDescription

func (x *IntegrationCommandB) MessageDescription() string

MessageDescription returns a human-readable description of the message.

func (*IntegrationCommandB) ProtoMessage

func (*IntegrationCommandB) ProtoMessage()

func (*IntegrationCommandB) ProtoReflect

func (x *IntegrationCommandB) ProtoReflect() protoreflect.Message

func (*IntegrationCommandB) Reset

func (x *IntegrationCommandB) Reset()

func (*IntegrationCommandB) SetActions

func (x *IntegrationCommandB) SetActions(v []*action.Action)

SetActions sets the x.Actions field to v, then returns x.

func (*IntegrationCommandB) SetIsInvalid

func (x *IntegrationCommandB) SetIsInvalid(v bool)

SetIsInvalid sets the x.IsInvalid field to v, then returns x.

func (*IntegrationCommandB) String

func (x *IntegrationCommandB) String() string

func (*IntegrationCommandB) UnmarshalBinary added in v0.18.0

func (x *IntegrationCommandB) UnmarshalBinary(data []byte) error

UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).

It allows *IntegrationCommandB to implement encoding.BinaryUnmarshaler.

func (*IntegrationCommandB) Validate

Validate returns an error if the message is invalid.

type IntegrationCommandBBuilder

type IntegrationCommandBBuilder struct {
	// contains filtered or unexported fields
}

func NewIntegrationCommandBBuilder

func NewIntegrationCommandBBuilder() *IntegrationCommandBBuilder

NewIntegrationCommandBBuilder returns a builder that constructs IntegrationCommandB messages.

func (*IntegrationCommandBBuilder) Build

Build returns a new IntegrationCommandB containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*IntegrationCommandBBuilder) From

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*IntegrationCommandBBuilder) WithActions

WithActions configures the builder to set the Actions field to v, then returns b.

func (*IntegrationCommandBBuilder) WithIsInvalid

WithIsInvalid configures the builder to set the IsInvalid field to v, then returns b.

type IntegrationEventA

type IntegrationEventA struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*IntegrationEventA) Descriptor deprecated

func (*IntegrationEventA) Descriptor() ([]byte, []int)

Deprecated: Use IntegrationEventA.ProtoReflect.Descriptor instead.

func (*IntegrationEventA) GetValue

func (x *IntegrationEventA) GetValue() string

func (*IntegrationEventA) MarshalBinary added in v0.18.0

func (x *IntegrationEventA) MarshalBinary() ([]byte, error)

MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).

It allows *IntegrationEventA to implement encoding.BinaryMarshaler.

func (*IntegrationEventA) MessageDescription

func (x *IntegrationEventA) MessageDescription() string

MessageDescription returns a human-readable description of the message.

func (*IntegrationEventA) ProtoMessage

func (*IntegrationEventA) ProtoMessage()

func (*IntegrationEventA) ProtoReflect

func (x *IntegrationEventA) ProtoReflect() protoreflect.Message

func (*IntegrationEventA) Reset

func (x *IntegrationEventA) Reset()

func (*IntegrationEventA) SetValue

func (x *IntegrationEventA) SetValue(v string)

SetValue sets the x.Value field to v, then returns x.

func (*IntegrationEventA) String

func (x *IntegrationEventA) String() string

func (*IntegrationEventA) UnmarshalBinary added in v0.18.0

func (x *IntegrationEventA) UnmarshalBinary(data []byte) error

UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).

It allows *IntegrationEventA to implement encoding.BinaryUnmarshaler.

func (*IntegrationEventA) Validate

Validate returns an error if the message is invalid.

type IntegrationEventABuilder

type IntegrationEventABuilder struct {
	// contains filtered or unexported fields
}

func NewIntegrationEventABuilder

func NewIntegrationEventABuilder() *IntegrationEventABuilder

NewIntegrationEventABuilder returns a builder that constructs IntegrationEventA messages.

func (*IntegrationEventABuilder) Build

Build returns a new IntegrationEventA containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*IntegrationEventABuilder) From

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*IntegrationEventABuilder) WithValue

WithValue configures the builder to set the Value field to v, then returns b.

type IntegrationEventB

type IntegrationEventB struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*IntegrationEventB) Descriptor deprecated

func (*IntegrationEventB) Descriptor() ([]byte, []int)

Deprecated: Use IntegrationEventB.ProtoReflect.Descriptor instead.

func (*IntegrationEventB) GetValue

func (x *IntegrationEventB) GetValue() string

func (*IntegrationEventB) MarshalBinary added in v0.18.0

func (x *IntegrationEventB) MarshalBinary() ([]byte, error)

MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).

It allows *IntegrationEventB to implement encoding.BinaryMarshaler.

func (*IntegrationEventB) MessageDescription

func (x *IntegrationEventB) MessageDescription() string

MessageDescription returns a human-readable description of the message.

func (*IntegrationEventB) ProtoMessage

func (*IntegrationEventB) ProtoMessage()

func (*IntegrationEventB) ProtoReflect

func (x *IntegrationEventB) ProtoReflect() protoreflect.Message

func (*IntegrationEventB) Reset

func (x *IntegrationEventB) Reset()

func (*IntegrationEventB) SetValue

func (x *IntegrationEventB) SetValue(v string)

SetValue sets the x.Value field to v, then returns x.

func (*IntegrationEventB) String

func (x *IntegrationEventB) String() string

func (*IntegrationEventB) UnmarshalBinary added in v0.18.0

func (x *IntegrationEventB) UnmarshalBinary(data []byte) error

UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).

It allows *IntegrationEventB to implement encoding.BinaryUnmarshaler.

func (*IntegrationEventB) Validate

Validate returns an error if the message is invalid.

type IntegrationEventBBuilder

type IntegrationEventBBuilder struct {
	// contains filtered or unexported fields
}

func NewIntegrationEventBBuilder

func NewIntegrationEventBBuilder() *IntegrationEventBBuilder

NewIntegrationEventBBuilder returns a builder that constructs IntegrationEventB messages.

func (*IntegrationEventBBuilder) Build

Build returns a new IntegrationEventB containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*IntegrationEventBBuilder) From

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*IntegrationEventBBuilder) WithValue

WithValue configures the builder to set the Value field to v, then returns b.

type ProcessEventA added in v0.16.2

type ProcessEventA struct {
	InstanceId string           `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
	Actions    []*action.Action `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"`
	// contains filtered or unexported fields
}

func (*ProcessEventA) Descriptor deprecated added in v0.16.2

func (*ProcessEventA) Descriptor() ([]byte, []int)

Deprecated: Use ProcessEventA.ProtoReflect.Descriptor instead.

func (*ProcessEventA) GetActions added in v0.16.2

func (x *ProcessEventA) GetActions() []*action.Action

func (*ProcessEventA) GetInstanceId added in v0.16.2

func (x *ProcessEventA) GetInstanceId() string

func (*ProcessEventA) MarshalBinary added in v0.18.0

func (x *ProcessEventA) MarshalBinary() ([]byte, error)

MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).

It allows *ProcessEventA to implement encoding.BinaryMarshaler.

func (*ProcessEventA) MessageDescription added in v0.16.2

func (x *ProcessEventA) MessageDescription() string

MessageDescription returns a human-readable description of the message.

func (*ProcessEventA) ProtoMessage added in v0.16.2

func (*ProcessEventA) ProtoMessage()

func (*ProcessEventA) ProtoReflect added in v0.16.2

func (x *ProcessEventA) ProtoReflect() protoreflect.Message

func (*ProcessEventA) Reset added in v0.16.2

func (x *ProcessEventA) Reset()

func (*ProcessEventA) SetActions added in v0.16.2

func (x *ProcessEventA) SetActions(v []*action.Action)

SetActions sets the x.Actions field to v, then returns x.

func (*ProcessEventA) SetInstanceId added in v0.16.2

func (x *ProcessEventA) SetInstanceId(v string)

SetInstanceId sets the x.InstanceId field to v, then returns x.

func (*ProcessEventA) String added in v0.16.2

func (x *ProcessEventA) String() string

func (*ProcessEventA) UnmarshalBinary added in v0.18.0

func (x *ProcessEventA) UnmarshalBinary(data []byte) error

UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).

It allows *ProcessEventA to implement encoding.BinaryUnmarshaler.

func (*ProcessEventA) Validate added in v0.16.2

Validate returns an error if the message is invalid.

type ProcessEventABuilder added in v0.16.2

type ProcessEventABuilder struct {
	// contains filtered or unexported fields
}

func NewProcessEventABuilder added in v0.16.2

func NewProcessEventABuilder() *ProcessEventABuilder

NewProcessEventABuilder returns a builder that constructs ProcessEventA messages.

func (*ProcessEventABuilder) Build added in v0.16.2

func (b *ProcessEventABuilder) Build() *ProcessEventA

Build returns a new ProcessEventA containing the values configured via the builder.

Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.

func (*ProcessEventABuilder) From added in v0.16.2

From configures the builder to use x as the prototype for new messages, then returns b.

It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.

func (*ProcessEventABuilder) WithActions added in v0.16.2

WithActions configures the builder to set the Actions field to v, then returns b.

func (*ProcessEventABuilder) WithInstanceId added in v0.16.2

func (b *ProcessEventABuilder) WithInstanceId(v string) *ProcessEventABuilder

WithInstanceId configures the builder to set the InstanceId field to v, then returns b.

Jump to

Keyboard shortcuts

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