event

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDomainEvent

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

BaseDomainEvent 基础领域事件

func NewBaseDomainEvent

func NewBaseDomainEvent(eventType string, aggregateID uint64) BaseDomainEvent

func (BaseDomainEvent) AggregateID

func (e BaseDomainEvent) AggregateID() uint64

func (BaseDomainEvent) EventID

func (e BaseDomainEvent) EventID() uuid.UUID

func (BaseDomainEvent) EventType

func (e BaseDomainEvent) EventType() string

func (BaseDomainEvent) OccurredOn

func (e BaseDomainEvent) OccurredOn() time.Time

type DomainEvent

type DomainEvent interface {
	// EventID 返回事件的唯一标识符
	EventID() uuid.UUID
	// EventType 返回事件的类型名称
	EventType() string
	// AggregateID 返回触发该事件的聚合根ID
	AggregateID() uint64
	// OccurredOn 返回事件发生的时间戳
	OccurredOn() time.Time
	// EventData 返回事件的具体数据载荷
	EventData() map[string]interface{}
}

DomainEvent 领域事件接口

Jump to

Keyboard shortcuts

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