refactor: replace Azure Blob SDK with a REST client (#39315)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind
2026-09-16 17:06:00 +02:00
committed by GitHub
co-authored by wxiaoguang
parent f0a535b641
commit c6c671e113
12 changed files with 520 additions and 455 deletions
+14
View File
@@ -12,6 +12,7 @@ import (
"os"
"path"
"strings"
"time"
"gitea.dev/modules/httplib"
"gitea.dev/modules/log"
@@ -42,6 +43,19 @@ type Object interface {
Stat() (os.FileInfo, error)
}
type objectFileInfo struct {
name string
size int64
modTime time.Time
}
func (o *objectFileInfo) Name() string { return o.name } // base name, no dir path
func (o *objectFileInfo) Size() int64 { return o.size }
func (o *objectFileInfo) ModTime() time.Time { return o.modTime }
func (o *objectFileInfo) IsDir() bool { return false } // object storage doesn't support dir
func (o *objectFileInfo) Mode() os.FileMode { return os.ModePerm }
func (o *objectFileInfo) Sys() any { return nil }
// ServeDirectOptions customizes HTTP headers for a generated signed URL.
type ServeDirectOptions struct {
// Overrides the automatically detected MIME type.