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.
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()
|
|
}
|