forked from mtusi2026/mtusi2026lab5
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.
32 lines
947 B
Go
32 lines
947 B
Go
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()
|
|
}
|