Перенеси реализацию мессенджера из ЛР 6
Источник — проверенное рабочее дерево ЛР 6 поверх 18878d6, включая изменения после повторного ревью. SHA-256 списка исходных файлов: e45a3d85b41feff1da78dce3f20fd1f4af1c5ee629e6ed703218bc8e21ad58fe.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user