chore: get ws

This commit is contained in:
zzw
2026-10-28 16:10:10 +08:00
parent 747ab25325
commit bb94b1a327
4 changed files with 6 additions and 9 deletions
+4 -4
View File
@@ -13,7 +13,7 @@ import (
alioss "github.com/aliyun/aliyun-oss-go-sdk/oss"
)
const MaxUploadBytes = 128 << 20 // 128MB
const MaxUploadBytes = 128 << 20
var unsafeFileChars = regexp.MustCompile(`[^\w.\-\p{Han}]+`)
@@ -23,12 +23,12 @@ type Config struct {
BucketName string
Endpoint string
Host string
Dir string // 固定前缀,如 test/chore/files/
Dir string
}
type Result struct {
URL string `json:"url"`
Path string `json:"path"` // object key,如 test/chore/files/20260403/a.zip
Path string `json:"path"`
Host string `json:"host"`
}
@@ -36,7 +36,7 @@ type UploadInput struct {
Filename string
Content []byte
ContentType string
Dir string // 可选,覆盖配置 oss.dir
Dir string
}
func LoadConfig() Config {