inte.go 1.2 KB

1234567891011121314151617181920212223242526
  1. package albb
  2. import (
  3. openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
  4. "github.com/alibabacloud-go/tea/tea"
  5. )
  6. var _result_sdk = &openapi.Client{}
  7. var _result_is bool
  8. func CreateClient () (_result_sdk *openapi.Client,_err error) {
  9. if _result_is {
  10. return _result_sdk, _err
  11. }
  12. // The project code leakage may result in the leakage of AccessKey, posing a threat to the security of all resources under the account. The following code examples are for reference only.
  13. // It is recommended to use the more secure STS credential. For more credentials, please refer to: https://www.alibabacloud.com/help/en/alibaba-cloud-sdk-262060/latest/configure-credentials-378661.
  14. config := &openapi.Config{
  15. // Required, please ensure that the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID is set.
  16. AccessKeyId: tea.String("LTAI5tFYbEUnUBH3sh7wV8Fj"),
  17. // Required, please ensure that the environment variables ALIBABA_CLOUD_ACCESS_KEY_SECRET is set.
  18. AccessKeySecret: tea.String("D2LXL9oMNKUtpp2xqoH1CVIrEHy2vi"),
  19. }
  20. // See https://api.alibabacloud.com/product/Ecs.
  21. config.Endpoint = tea.String("ecs.cn-hangzhou.aliyuncs.com")
  22. _result_sdk, _err = openapi.NewClient(config)
  23. return _result_sdk, _err
  24. }