go get github.com/zhchsf/ufile
import "github.com/zhchsf/ufile"
config ufile settings:
ufile.SetConfig(
ufile.Config{
PublicKey: GlobolConfig.Ufile.PublicKey,
PrivateKey: GlobolConfig.Ufile.PrivateKey,
UserAgent: GlobolConfig.Ufile.UserAgent,
ExpireSecond: GlobolConfig.Ufile.ExpireSecond,
UrlSuffix: GlobolConfig.Ufile.UrlSuffix,
},
)
upload to ufile:
ufile.Upload(filepath string, key string, bucketName string) (bool, error)
get 私密地址:
ufile.PrivateCloudUrl(key string, bucketName string) string