eventbus

package
v0.0.0-...-1cb9ecb Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEvent

type BaseEvent struct {
	EventID     string
	AggregateID string
	OccurredOn  time.Time
}

func NewBaseEvent

func NewBaseEvent(aggregateID string) BaseEvent

func (*BaseEvent) IsNotValid

func (e *BaseEvent) IsNotValid() bool

type Body

type Body []byte

Type represents a domain event type.

type Bus

type Bus interface {
	// Publish is the method used to publish new events.
	Publish(context.Context, []Event) error
	// Subscribe is the method used to subscribe new event handlers.
	Subscribe(context.Context, Type, Handler)
}

Bus defines the expected behaviour from an event bus.

type Event

type Event interface {
	Type() Type
}

Event represents a domain command.

type Handler

type Handler interface {
	Handle([]byte) bool
}

type Type

type Type string

Type represents a domain event type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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