lab5: асинхронная очередь, worker и идемпотентный pipeline

API принимает 202 после durable staging и TX intent (job+outbox); отдельные relay и worker публикуют/обрабатывают задания с publisher confirm, lease, retry/backoff, DLQ и replay. Добавлены версии pipeline, варианты thumbnail/crop/optimized, presign в verified staging, status-aware sweeper и admission control.
This commit is contained in:
Vladislav Kunetskiy
2026-10-30 22:36:52 +03:00
parent 6c5ba026f1
commit 4bdcac3dfa
95 changed files with 8466 additions and 764 deletions
+31
View File
@@ -0,0 +1,31 @@
package domain
import (
"strconv"
"github.com/google/uuid"
)
const (
StagingUploadPrefix = "staging/uploads/"
StagingVerifiedPrefix = "staging/verified/"
StagingPresignPrefix = "staging/presign/"
AttachmentsPrefix = "attachments/"
)
func StagingUploadKey(chatID, attachmentID uuid.UUID) string {
return StagingUploadPrefix + chatID.String() + "/" + attachmentID.String()
}
func StagingVerifiedKey(chatID, attachmentID uuid.UUID) string {
return StagingVerifiedPrefix + chatID.String() + "/" + attachmentID.String()
}
func OriginalObjectKey(chatID, attachmentID uuid.UUID) string {
return AttachmentsPrefix + chatID.String() + "/" + attachmentID.String() + "/original"
}
func VariantObjectKey(chatID, attachmentID uuid.UUID, pipelineVersion int, name VariantName) string {
return AttachmentsPrefix + chatID.String() + "/" + attachmentID.String() +
"/variants/v" + strconv.Itoa(pipelineVersion) + "/" + name.ObjectName()
}