You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-library/vendor/github.com/qiniu/go-sdk/v7/storage/backward_compatible.go

34 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// 原来rpc.go包含了客户端的信息这个部分被调整到了"github.com/qiniu/go-sdk/v7/client"
// 这个文件的内容不应该再被使用
// 客户端应该是所有服务公用的包括kodo, cdn, dora, atlab等不应该放在storage下
// 这个文件兼容保留了原来storage暴露出去的变量函数等
package storage
import (
"fmt"
"github.com/qiniu/go-sdk/v7/client"
"github.com/qiniu/go-sdk/v7/conf"
"runtime"
)
var DefaultClient = client.DefaultClient
var UserAgent = client.UserAgent
type Client = client.Client
type ErrorInfo = client.ErrorInfo
var ResponseError = client.ResponseError
var CallRet = client.CallRet
// var SetAppName = client.SetAppName
// SetAppName设置的是全局的变量如果再这个包引入var SetAppName 那么设置的实际上是
// client包中的UserAgent 所以为了兼容性重复定义了该函数
// userApp should be [A-Za-z0-9_\ \-\.]*
func SetAppName(userApp string) error {
UserAgent = fmt.Sprintf(
"QiniuGo/%s (%s; %s; %s) %s", conf.Version, runtime.GOOS, runtime.GOARCH, userApp, runtime.Version())
return nil
}