forked from mtusi2026/mtusi2026lab5
feat(worker): process attachments with thumbnails and bounded retries
This commit is contained in:
@@ -11,15 +11,39 @@ type ContentType string
|
||||
const (
|
||||
ContentTypePNG ContentType = "image/png"
|
||||
ContentTypeJPEG ContentType = "image/jpeg"
|
||||
ContentTypeWebP ContentType = "image/webp"
|
||||
)
|
||||
|
||||
type AttachmentStatus string
|
||||
|
||||
const (
|
||||
AttachmentStatusReady AttachmentStatus = "ready"
|
||||
AttachmentStatusQueued AttachmentStatus = "queued"
|
||||
AttachmentStatusProcessing AttachmentStatus = "processing"
|
||||
AttachmentStatusReady AttachmentStatus = "ready"
|
||||
AttachmentStatusFailed AttachmentStatus = "failed"
|
||||
)
|
||||
|
||||
const AttachmentContentOriginal = "original"
|
||||
|
||||
type AttachmentVariantName string
|
||||
|
||||
const (
|
||||
AttachmentVariantNameThumbnail AttachmentVariantName = "thumbnail"
|
||||
AttachmentVariantNameCrop AttachmentVariantName = "crop"
|
||||
AttachmentVariantNameOptimized AttachmentVariantName = "optimized"
|
||||
)
|
||||
|
||||
type AttachmentVariant struct {
|
||||
Name AttachmentVariantName
|
||||
ContentType ContentType
|
||||
SizeBytes int
|
||||
Width int
|
||||
Height int
|
||||
Sha256 string
|
||||
}
|
||||
|
||||
type Attachment struct {
|
||||
Variants []AttachmentVariant
|
||||
ID uuid.UUID
|
||||
ChatID uuid.UUID
|
||||
OwnerID uuid.UUID
|
||||
@@ -28,6 +52,8 @@ type Attachment struct {
|
||||
SizeBytes int
|
||||
Sha256 string
|
||||
Status AttachmentStatus
|
||||
Width *int32
|
||||
Height *int32
|
||||
ErrorCode *string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
|
||||
Reference in New Issue
Block a user