event

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Store

func Store(s Source, events ...Event)

Store given events in the given source. In order to use this method, you must embed the `event.Emitter` struct.

Types

type Emitter

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

Implements the Source interface, embed it in your own entities to enable functions such as `Store` and `Unwrap`.

I really like this solution because it does not poluate the domain stuff by exposing methods on entities. You have to explicitly ask for it.

type Event

type Event bus.Signal

Event triggered by main aggregates.

func Unwrap

func Unwrap(s Source) []Event

Unwrap events from the given source. In order to use this method, you must embed the `event.Emitter` struct.

type Source

type Source interface {
	// contains filtered or unexported methods
}

Represents an event source which contains events before dispatching. Methods are unexported to avoid polluting the domain entities with those considerations for external clients.

You may use `Store` and `Unwrap` to manipulate a struct which embed an `Emitter`.

Jump to

Keyboard shortcuts

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