Files
novel_server/utility/oss/oss.go

19 lines
389 B
Go

package oss
import "github.com/gogf/gf/v2/net/ghttp"
type OSSClient interface {
Upload(file *ghttp.UploadFile, folder string) (string, error)
UploadLocalFile(path, name string) (string, error)
}
var clients = make(map[string]OSSClient)
func RegisterClient(name string, client OSSClient) {
clients[name] = client
}
func GetOSSClient(name string) OSSClient {
return clients[name]
}