common

package
v0.0.0-...-12e3172 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(eventBus eventhorizon.EventBus, commandBus eventhorizon.CommandBus,
	newEventStore NewEventStoreFunc,
	newReadRepository NewReadRepositoryFunc)

Run runs the test scenario with the given EventStore and CommandBus. EventStores and ReadRepositories are created as needed with the given functions.

Types

type AcceptInvite

type AcceptInvite struct {
	InvitationID string
}

func (*AcceptInvite) AggregateID

func (c *AcceptInvite) AggregateID() string

func (*AcceptInvite) AggregateType

func (c *AcceptInvite) AggregateType() string

func (*AcceptInvite) CommandType

func (c *AcceptInvite) CommandType() string

type CreateInvite

type CreateInvite struct {
	InvitationID string
	EventID      string
	Name         string
	Age          int `eh:"optional"`
}

func (*CreateInvite) AggregateID

func (c *CreateInvite) AggregateID() string

func (*CreateInvite) AggregateType

func (c *CreateInvite) AggregateType() string

func (*CreateInvite) CommandType

func (c *CreateInvite) CommandType() string

type DeclineInvite

type DeclineInvite struct {
	InvitationID string
}

func (*DeclineInvite) AggregateID

func (c *DeclineInvite) AggregateID() string

func (*DeclineInvite) AggregateType

func (c *DeclineInvite) AggregateType() string

func (*DeclineInvite) CommandType

func (c *DeclineInvite) CommandType() string

type GuestList

type GuestList struct {
	ID          string `json:"id"`
	NumGuests   int    `json:"num_guests"`
	NumAccepted int    `json:"num_accepted"`
	NumDeclined int    `json:"num_declined"`
}

type GuestListProjector

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

GuestListProjector projects guest lists. Note, it currently only works for one guest list.

func NewGuestListProjector

func NewGuestListProjector(repository eventhorizon.ReadRepository, eventID string) *GuestListProjector

NewGuestListProjector creates a new GuestListProjector.

func (*GuestListProjector) HandleEvent

func (p *GuestListProjector) HandleEvent(event eventhorizon.Event)

HandleEvent handles events that GuestListProjector is concerned about. HandleEvent builds guest lists.

type Invitation

type Invitation struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Status string `json:"status"`
}

type InvitationAggregate

type InvitationAggregate struct {
	*eventhorizon.AggregateBase
	// contains filtered or unexported fields
}

func (*InvitationAggregate) AggregateType

func (i *InvitationAggregate) AggregateType() string

func (*InvitationAggregate) ApplyEvent

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

func (*InvitationAggregate) HandleCommand

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

type InvitationProjector

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

func NewInvitationProjector

func NewInvitationProjector(repository eventhorizon.ReadRepository) *InvitationProjector

func (*InvitationProjector) HandleEvent

func (p *InvitationProjector) HandleEvent(event eventhorizon.Event)

type InviteAccepted

type InviteAccepted struct {
	InvitationID string `bson:"invitation_id" json:"id"`
}

func (*InviteAccepted) AggregateID

func (c *InviteAccepted) AggregateID() string

func (*InviteAccepted) AggregateType

func (c *InviteAccepted) AggregateType() string

func (*InviteAccepted) EventType

func (c *InviteAccepted) EventType() string

type InviteCreated

type InviteCreated struct {
	InvitationID string `bson:"invitation_id" json:"id"`
	EventID      string `bson:"event_id" json:"event_id"`
	Name         string `bson:"name" json:"name"`
	Age          int    `bson:"age" json:"age"`
}

func (*InviteCreated) AggregateID

func (c *InviteCreated) AggregateID() string

func (*InviteCreated) AggregateType

func (c *InviteCreated) AggregateType() string

func (*InviteCreated) EventType

func (c *InviteCreated) EventType() string

type InviteDeclined

type InviteDeclined struct {
	InvitationID string `bson:"invitation_id" json:"id"`
}

func (*InviteDeclined) AggregateID

func (c *InviteDeclined) AggregateID() string

func (*InviteDeclined) AggregateType

func (c *InviteDeclined) AggregateType() string

func (*InviteDeclined) EventType

func (c *InviteDeclined) EventType() string

type NewEventStoreFunc

type NewEventStoreFunc func() (eventhorizon.EventStore, error)

NewEventStoreFunc creates a new EventStore

type NewReadRepositoryFunc

type NewReadRepositoryFunc func(string) (eventhorizon.ReadRepository, error)

NewReadRepositoryFunc creates a new ReadRepository

Jump to

Keyboard shortcuts

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