| 1 |
package slb |
| 2 |
|
| 3 |
import ( |
| 4 |
"os" |
| 5 |
|
| 6 |
"github.com/denverdino/aliyungo/common" |
| 7 |
) |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
var ( |
| 12 |
TestAccessKeyId = os.Getenv("AccessKeyId") |
| 13 |
TestAccessKeySecret = os.Getenv("AccessKeySecret") |
| 14 |
TestSecurityToken = os.Getenv("SecurityToken") |
| 15 |
TestLoadBlancerID = "MY_LOADBALANCEID" |
| 16 |
TestVServerGroupID = "MY_VSERVER_GROUPID" |
| 17 |
TestListenerPort = 9000 |
| 18 |
TestInstanceId = "MY_INSTANCE_ID" |
| 19 |
TestRegionID = common.Region(os.Getenv("RegionId")) |
| 20 |
TestIAmRich = false |
| 21 |
TestQuick = false |
| 22 |
) |
| 23 |
|
| 24 |
var testClient *Client |
| 25 |
|
| 26 |
func NewTestClient() *Client { |
| 27 |
if testClient == nil { |
| 28 |
testClient = NewClient(TestAccessKeyId, TestAccessKeySecret) |
| 29 |
} |
| 30 |
return testClient |
| 31 |
} |
| 32 |
|
| 33 |
var testDebugClient *Client |
| 34 |
|
| 35 |
func NewTestClientForDebug() *Client { |
| 36 |
if testDebugClient == nil { |
| 37 |
testDebugClient = NewClient(TestAccessKeyId, TestAccessKeySecret) |
| 38 |
testDebugClient.SetDebug(true) |
| 39 |
} |
| 40 |
return testDebugClient |
| 41 |
} |
| 42 |
|
| 43 |
var testDebugNewSLBClient *Client |
| 44 |
|
| 45 |
func NewTestNewSLBClientForDebug() *Client { |
| 46 |
if testDebugNewSLBClient == nil { |
| 47 |
testDebugNewSLBClient = NewSLBClientWithSecurityToken(TestAccessKeyId, TestAccessKeySecret, TestSecurityToken, TestRegionID) |
| 48 |
testDebugNewSLBClient.SetDebug(true) |
| 49 |
} |
| 50 |
return testDebugNewSLBClient |
| 51 |
} |