feat: attachments over S3 (grade 3)

This commit is contained in:
2026-11-20 03:55:39 +03:00
parent 083d0d80cc
commit 89e9e7b4d4
44 changed files with 1468 additions and 67 deletions
+13
View File
@@ -2,6 +2,7 @@ package service
import (
"context"
"io"
"time"
"uuid"
@@ -25,6 +26,18 @@ type MessageRepository interface {
ListMessages(ctx context.Context, chatID uuid.UUID, after *domain.Cursor, limit int) ([]domain.Message, bool, error)
}
type AttachmentRepository interface {
CreateAttachment(ctx context.Context, a domain.Attachment) error
GetAttachment(ctx context.Context, id uuid.UUID) (domain.Attachment, error)
}
type ObjectStore interface {
Put(ctx context.Context, key string, r io.Reader, size int64, contentType string) error
Get(ctx context.Context, key string) (io.ReadCloser, error)
Delete(ctx context.Context, key string) error
Ping(ctx context.Context) error
}
type SessionStore interface {
Create(ctx context.Context, tokenHash string, userID uuid.UUID, expiresAt time.Time) error
Get(ctx context.Context, tokenHash string) (uuid.UUID, error)