Files
tamabox/dev/s3stub/s3_stub.go
T
tamakyi e3e59e7c69 chore: baseline snapshot before moderation-strictness feature
Repo .git was damaged (refs/ missing, index truncated, object store near-empty).
Repaired via git init (rebuilt refs), stale index preserved as .git/index.corrupt-20260910.bak,
then full worktree committed as a rollback baseline.
2026-09-10 10:56:27 +08:00

32 lines
1.2 KiB
Go

// s3_stub.go 是 internal/storage/s3.go 的本地编译桩:s3.go 依赖 cgo 库
// chai2010/webp(需要 libwebp + C 工具链),Windows 沙箱无此环境。
// 通过 `go build -overlay=dev/overlay.json` 用本文件替换 s3.go,做全模块类型检查。
// 符号覆盖 = s3.go 中被包内其他文件(oss.go 引用 isSupportedImage)与
// 包外调用方(route/user、route/question、route/chat 等)引用的全部标识符。
// 桩仅在类型检查时生效,不会被真正调用;生产构建在 Linux(cgo + libwebp)下不受影响。
package storage
import (
"io"
"mime/multipart"
)
// MaxUploadBytes 与真实实现保持一致(8MB 单图上限,bodylimit 中间件依赖此值语义)。
const MaxUploadBytes = 8 * 1024 * 1024
func UploadPictureToS3(file multipart.File, fileHeader *multipart.FileHeader) (string, error) {
return "", nil
}
func UploadAvatarToS3(file multipart.File, fileHeader *multipart.FileHeader) (string, error) {
return "", nil
}
func UploadBackgroundToS3(file multipart.File, fileHeader *multipart.FileHeader) (string, error) {
return "", nil
}
func ConvertStaticImageToWebP(r io.Reader) ([]byte, error) { return nil, nil }
func isSupportedImage(data []byte) bool { return true }