event

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Publish

func Publish(ctx context.Context, event DomainEvent)

func ResetMediator

func ResetMediator(m DomainEventMediator)

func Subscribe

func Subscribe(t DomainEventType, sub DomainEventSubscriber)

Types

type DomainEvent

type DomainEvent interface {
	Type() DomainEventType
}

DomainEvent 领域事件

type DomainEventMediator

type DomainEventMediator interface {
	Publish(ctx context.Context, event DomainEvent)
	Subscribe(DomainEventType, DomainEventSubscriber)
}

DomainEventMediator 领域事件调度者

type DomainEventSubscriber

type DomainEventSubscriber interface {
	Handle(ctx context.Context, event DomainEvent)
}

DomainEventSubscriber 领域事件订阅方

type DomainEventType

type DomainEventType string

DomainEventType 事件类型

type Events

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

func NewEvents

func NewEvents() *Events

func (*Events) Add

func (el *Events) Add(event DomainEvent)

func (*Events) Dispatch

func (el *Events) Dispatch(ctx context.Context)

Jump to

Keyboard shortcuts

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