25 lines
642 B
Go
25 lines
642 B
Go
package common
|
|
|
|
import (
|
|
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
|
|
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
|
|
tke "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525"
|
|
)
|
|
|
|
const (
|
|
secretId = ""
|
|
secretKey = ""
|
|
)
|
|
|
|
func GetTkeClient() *tke.Client {
|
|
credential := common.NewCredential(secretId, secretKey)
|
|
cpf := profile.NewClientProfile()
|
|
cpf.HttpProfile.Endpoint = "tke.tencentcloudapi.com"
|
|
// 实例化要请求产品的client对象,clientProfile是可选的
|
|
client, err := tke.NewClient(credential, "", cpf)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return client
|
|
}
|