mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-20 11:43:40 +09:00
refactor: replace Azure Blob SDK with a REST client (#39315)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user