testapp

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: MIT Imports: 10 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_integration_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 EventProjection

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

EventProjection tracks all events produced by the test application.

func (*EventProjection) CloseResource

func (h *EventProjection) CloseResource(_ context.Context, r []byte) error

CloseResource informs the handler that the engine has no further use for a resource.

func (*EventProjection) Configure

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

Configure describes the handler's configuration to the engine.

func (*EventProjection) HandleEvent

func (h *EventProjection) HandleEvent(
	_ context.Context,
	r, c, n []byte,
	_ dogma.ProjectionEventScope,
	e dogma.Event,
) (ok bool, err error)

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.

func (*EventProjection) ResourceVersion

func (h *EventProjection) ResourceVersion(_ context.Context, r []byte) ([]byte, error)

ResourceVersion returns the current version of a resource.

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) 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) Validate

func (x *IntegrationCommandA) Validate() error

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) 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) Validate

func (x *IntegrationCommandB) Validate() error

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) 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) Validate

func (x *IntegrationEventA) Validate() error

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) 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) Validate

func (x *IntegrationEventB) Validate() error

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.

Jump to

Keyboard shortcuts

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