config_test.go 833 B

12345678910111213141516171819202122232425262728293031323334
  1. package ecs
  2. //Modify with your Access Key Id and Access Key Secret
  3. const (
  4. TestAccessKeyId = "MY_ACCESS_KEY_ID"
  5. TestAccessKeySecret = "MY_ACCESS_KEY_SECRET"
  6. TestInstanceId = "MY_TEST_INSTANCE_ID"
  7. TestSecurityGroupId = "MY_TEST_SECURITY_GROUP_ID"
  8. TestImageId = "MY_TEST_IMAGE_ID"
  9. TestAccountId = "MY_TEST_ACCOUNT_ID" //Get from https://account.console.aliyun.com
  10. TestIAmRich = false
  11. TestQuick = false
  12. )
  13. var testClient *Client
  14. func NewTestClient() *Client {
  15. if testClient == nil {
  16. testClient = NewClient(TestAccessKeyId, TestAccessKeySecret)
  17. }
  18. return testClient
  19. }
  20. var testDebugClient *Client
  21. func NewTestClientForDebug() *Client {
  22. if testDebugClient == nil {
  23. testDebugClient = NewClient(TestAccessKeyId, TestAccessKeySecret)
  24. testDebugClient.SetDebug(true)
  25. }
  26. return testDebugClient
  27. }