Files
mtusi2026lab5/app/internal/config/attachments.go
T

41 lines
1.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package config
// Верхние границы из контракта: конфигурация может их уменьшить, но не превысить.
const (
ContractMaxUploadBytes = 10 * 1024 * 1024
ContractMaxImagePixels = 40_000_000
)
type S3 struct {
Endpoint string
Region string
Bucket string
AccessKeyIDFile string
SecretAccessKeyFile string
// TimeoutMs — предел на одну операцию с S3. Меньше timeout server балансировщика (15 с):
// клиент получает 503 от API, а не 504 от LB.
TimeoutMs int
}
type Attachments struct {
MaxUploadBytes int64
MaxImagePixels int64
// MaxConcurrentUploads ограничивает загрузки на одну реплику и тем самым диск под временные
// файлы (не больше MaxConcurrentUploads × MaxUploadBytes); сверх него — 429.
MaxConcurrentUploads int
}
// MinJanitorGraceSeconds covers the direct ticket lifetime (120s), complete
// timeout (60s), and an additional safety margin before orphan deletion.
const MinJanitorGraceSeconds = 300
// Janitor — очиститель объектов без метаданных (cmd/janitor).
type Janitor struct {
GraceSeconds int
IntervalSeconds int
// MaxDeletes — сколько объектов без строки допустимо удалить за проход. Больше — признак аварии
// (например, БД восстановлена из старой копии), и очиститель ничего не удаляет.
MaxDeletes int
DryRun bool
}