Feat: client method to upload file from master node to slave node

This commit is contained in:
HFO4
2022-03-13 16:16:58 +08:00
parent 081e75146c
commit b96019be7c
12 changed files with 174 additions and 59 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/cloudreve/Cloudreve/v3/pkg/auth"
"net/http"
"net/url"
"strings"
"time"
)
@@ -103,6 +104,10 @@ func WithSlaveMeta(s string) Option {
// Endpoint 使用同一的请求Endpoint
func WithEndpoint(endpoint string) Option {
if !strings.HasSuffix(endpoint, "/") {
endpoint += "/"
}
endpointURL, _ := url.Parse(endpoint)
return optionFunc(func(o *options) {
o.endpoint = endpointURL