61 lines
1.3 KiB
Go
61 lines
1.3 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type ContentType string
|
|
|
|
const (
|
|
ContentTypePNG ContentType = "image/png"
|
|
ContentTypeJPEG ContentType = "image/jpeg"
|
|
ContentTypeWebP ContentType = "image/webp"
|
|
)
|
|
|
|
type AttachmentStatus string
|
|
|
|
const (
|
|
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
|
|
Filename string
|
|
ContentType ContentType
|
|
SizeBytes int
|
|
Sha256 string
|
|
Status AttachmentStatus
|
|
Width *int32
|
|
Height *int32
|
|
ErrorCode *string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|