- PostgreSQL metadata overlay layer on top of existing S3 storage - 3 new tables: folders, files, share_links - Folder CRUD: create, get with children, tree, rename, delete (cascade) - File operations: upload to folder, move between folders - Share links: create with optional password/expiry/download limit, public access - S3 compensation on PG write failure - Existing 14 endpoints untouched
16 lines
551 B
Go
16 lines
551 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
"rag/file-system/internal/domain/model"
|
|
)
|
|
|
|
type ShareRepository interface {
|
|
Create(ctx context.Context, share *model.ShareLink) error
|
|
GetByToken(ctx context.Context, token string) (*model.ShareLink, error)
|
|
GetByID(ctx context.Context, id string) (*model.ShareLink, error)
|
|
Delete(ctx context.Context, id string, createdBy string) error
|
|
IncrementDownloadCount(ctx context.Context, token string) error
|
|
ListByResource(ctx context.Context, resourceType string, resourceID string) ([]model.ShareLink, error)
|
|
}
|