mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 22:06:38 +08:00
9af84c8ed6
Replace c.JSON(200, response.Err) and middleware gin.H bypasses with response.Abort* helpers so errors flow through Gin Error chain and ErrorHandlerMiddleware for OTel trace correlation. Split oauth/sources.go into domain-focused files and decompose upload into handler/filesrv/stats/task/cache/storage/util subpackages with a root facade preserving existing import paths.
23 lines
836 B
Go
23 lines
836 B
Go
// Copyright 2026 Arctel.net
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package shared
|
|
|
|
import "github.com/Rain-kl/Wavelet/internal/storage"
|
|
|
|
// Upload size, path, media quality, and cache constants shared across subpackages.
|
|
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
|
|
MaxS3KeyLength = 1024
|
|
AccessCacheTTL = 5 // seconds; multiplied by time.Second at use site
|
|
) |