23 lines
514 B
Go
23 lines
514 B
Go
package common
|
|
|
|
import (
|
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
|
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
|
|
"github.com/aliyun/alibaba-cloud-sdk-go/services/eci"
|
|
)
|
|
|
|
const (
|
|
accessKeyId = ""
|
|
accessKeySecret = ""
|
|
)
|
|
|
|
func GetEciClient() *eci.Client {
|
|
config := sdk.NewConfig()
|
|
credential := credentials.NewAccessKeyCredential(accessKeyId, accessKeySecret)
|
|
client, err := eci.NewClientWithOptions("cn-hangzhou", config, credential)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return client
|
|
}
|