forked from mtusi2026/mtusi2026lab5
46 lines
853 B
Go
46 lines
853 B
Go
package attachment
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type FileStatus string
|
|
|
|
const (
|
|
FileQueued FileStatus = "queued"
|
|
FileProcessing FileStatus = "processing"
|
|
FilePending FileStatus = "pending"
|
|
FileReady FileStatus = "ready"
|
|
FileFailed FileStatus = "failed"
|
|
)
|
|
|
|
type Attachment struct {
|
|
ID, ChatID, OwnerID uuid.UUID
|
|
Filename string
|
|
FileHash []byte
|
|
SizeBytes int64
|
|
MIMEType string
|
|
Status FileStatus
|
|
CreatedAt, UpdatedAt time.Time
|
|
ErrorCode *string
|
|
Variants []Variant
|
|
}
|
|
|
|
type UploadInput struct {
|
|
ChatID uuid.UUID
|
|
Filename string
|
|
MIMEType string
|
|
SizeBytes int64
|
|
}
|
|
|
|
type Variant struct {
|
|
Name string
|
|
ObjectKey string
|
|
MIMEType string
|
|
SizeBytes int64
|
|
Width, Height int
|
|
Hash []byte
|
|
}
|