add file storage: metadata schema, minio upload/download, content-type extension mapping

- add files_metadata and files_metadata_connections tables with CRUD helpers
- add FileMetadata type and Sha256Hash typedef; replace Media struct
- add minio upload, presigned download URL, and key generation
- fix bucket existence check to use FileStorageBucketName instead of hardcoded "main"
- fix files_metadata_connections table name and trailing comma in DDL
- fix column name original -> name in files_metadata schema
- add canonical MIME-to-extension map with .unk fallback
- add FileDownloadLinkTtl constant (24h)
This commit is contained in:
2026-04-14 18:55:22 +02:00
parent 39a28ee888
commit 48d3c6f857
4 changed files with 135 additions and 17 deletions
+5 -2
View File
@@ -1,6 +1,9 @@
package globals
import "time"
const (
MaxDirectMsgCache uint32 = 12
FileStorageBucketName string = "communicator"
MaxDirectMsgCache uint32 = 12
FileStorageBucketName string = "communicator"
FileDownloadLinkTtl time.Duration = 24 * time.Hour
)