mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 22:06:38 +08:00
6a8f9a7aea
- Use RWMutex for disk cache reads and singleflight for WebP cache misses - Cache migration read-only state and file access whitelist with pub/sub invalidation - Add w_upload_stats incremental counters updated on upload/delete - Add w_uploads composite indexes and goose backfill migrations - Document performance analysis in docs/PERFORMANCE.md - Fix RegisterCustomRoutes to accept apiV1Router parameter
21 lines
650 B
Go
21 lines
650 B
Go
// Copyright 2026 Arctel.net
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package upload
|
|
|
|
import "github.com/Rain-kl/Wavelet/internal/storage"
|
|
|
|
const (
|
|
maxUploadSize = 32 * 1024 * 1024 // 32MB
|
|
detectContentBytes = 512 // http.DetectContentType 需要的最小字节数
|
|
uploadDirPerm = 0755 // 上传目录权限
|
|
uploadFilePerm = 0644 // 上传文件权限
|
|
imageQualityLow = "low"
|
|
imageQualityMedium = "medium"
|
|
imageQualityHigh = "high"
|
|
imageQualityOrigin = "origin"
|
|
storageDriverLocal = string(storage.DriverLocal)
|
|
defaultPublicUploadType = "avatar"
|
|
fileStatsTrendDays = 7
|
|
)
|