lab5: очереди и асинхронная обработка изображений
Durable staging handoff, transactional outbox, at-least-once worker with lease fencing, idempotent versioned pipeline, three variants, operator tooling, contract tests and evidence. Includes the review fixes: reprocess source selection and failure settlement, replay guards, stale-job retirement, PNG structural/raster validation, migration rollback safety and audit events.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user