domain

package
v0.0.0-...-1759ba1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const InvitationAggregateType = "Invitation"

InvitationAggregateType is the type name of the aggregate.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptInvite

type AcceptInvite struct {
	InvitationID eventhorizon.UUID
}

AcceptInvite is a command for accepting invites.

func (*AcceptInvite) AggregateID

func (c *AcceptInvite) AggregateID() eventhorizon.UUID

func (*AcceptInvite) AggregateType

func (c *AcceptInvite) AggregateType() string

func (*AcceptInvite) CommandType

func (c *AcceptInvite) CommandType() string

type CreateInvite

type CreateInvite struct {
	InvitationID eventhorizon.UUID
	Name         string
	Age          int `eh:"optional"`
}

CreateInvite is a command for creating invites.

func (*CreateInvite) AggregateID

func (c *CreateInvite) AggregateID() eventhorizon.UUID

func (*CreateInvite) AggregateType

func (c *CreateInvite) AggregateType() string

func (*CreateInvite) CommandType

func (c *CreateInvite) CommandType() string

type DeclineInvite

type DeclineInvite struct {
	InvitationID eventhorizon.UUID
}

DeclineInvite is a command for declining invites.

func (*DeclineInvite) AggregateID

func (c *DeclineInvite) AggregateID() eventhorizon.UUID

func (*DeclineInvite) AggregateType

func (c *DeclineInvite) AggregateType() string

func (*DeclineInvite) CommandType

func (c *DeclineInvite) CommandType() string

type InvitationAggregate

type InvitationAggregate struct {
	// AggregateBase implements most of the eventhorizon.Aggregate interface.
	*eventhorizon.AggregateBase
	// contains filtered or unexported fields
}

InvitationAggregate is the root aggregate.

The aggregate root will guard that the invitation can only be accepted OR declined, but not both.

func (*InvitationAggregate) AggregateType

func (i *InvitationAggregate) AggregateType() string

AggregateType implements the AggregateType method of the Aggregate interface.

func (*InvitationAggregate) ApplyEvent

func (i *InvitationAggregate) ApplyEvent(event eventhorizon.Event)

ApplyEvent implements the ApplyEvent method of the Aggregate interface.

func (*InvitationAggregate) HandleCommand

func (i *InvitationAggregate) HandleCommand(command eventhorizon.Command) error

HandleCommand implements the HandleCommand method of the Aggregate interface.

type InviteAccepted

type InviteAccepted struct {
	InvitationID eventhorizon.UUID `bson:"invitation_id"`
}

InviteAccepted is an event for when an invite has been accepted.

func (*InviteAccepted) AggregateID

func (c *InviteAccepted) AggregateID() eventhorizon.UUID

func (*InviteAccepted) AggregateType

func (c *InviteAccepted) AggregateType() string

func (*InviteAccepted) EventType

func (c *InviteAccepted) EventType() string

type InviteCreated

type InviteCreated struct {
	InvitationID eventhorizon.UUID `bson:"invitation_id"`
	Name         string            `bson:"name"`
	Age          int               `bson:"age"`
}

InviteCreated is an event for when an invite has been created.

func (*InviteCreated) AggregateID

func (c *InviteCreated) AggregateID() eventhorizon.UUID

func (*InviteCreated) AggregateType

func (c *InviteCreated) AggregateType() string

func (*InviteCreated) EventType

func (c *InviteCreated) EventType() string

type InviteDeclined

type InviteDeclined struct {
	InvitationID eventhorizon.UUID `bson:"invitation_id"`
}

InviteDeclined is an event for when an invite has been declined.

func (*InviteDeclined) AggregateID

func (c *InviteDeclined) AggregateID() eventhorizon.UUID

func (*InviteDeclined) AggregateType

func (c *InviteDeclined) AggregateType() string

func (*InviteDeclined) EventType

func (c *InviteDeclined) EventType() string

Jump to

Keyboard shortcuts

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