chore: add lab5 files and merge env.example.

This commit is contained in:
Голиков Maximillian Антон
2026-11-14 16:12:32 +03:00
parent 470d9d6f1e
commit 0d1a4261f8
93 changed files with 7085 additions and 11 deletions
+28
View File
@@ -0,0 +1,28 @@
package domain
import "time"
const (
OutboxAggregateAttachment = "attachment"
OutboxEventProcess = "attachment.process"
)
// OutboxEntry — намерение опубликовать сообщение, записанное
// в одной транзакции с бизнес-изменением (transactional outbox).
//
// Инварианты:
// - PublishedAt == nil => ещё не опубликовано, publisher обязан дослать;
// - PublishedAt != nil => RabbitMQ принял сообщение,
// а не «мы вызвали Publish». At-least-once: повторная доставка
// возможна и нормальна, гасится идемпотентностью consumer'а.
//
type OutboxEntry struct {
ID string
AggregateType string
AggregateID string
EventType string
Payload []byte
CreatedAt time.Time
PublishedAt *time.Time
Attempts int
}