Go语言事件溯源:Event Sourcing
Go语言事件溯源:Event Sourcing
1. 事件溯源
type Event interface { EventType() string } type AccountCreated struct { AccountID string Owner string } func (e *AccountCreated) EventType() string { return "AccountCreated" }2. 总结
事件溯源通过记录完整的事件序列实现状态的重建和审计。
