File: config_test.go

package info (click to toggle)
golang-github-denverdino-aliyungo 0.0~git20180921.13fa8aa-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,824 kB
  • sloc: xml: 1,359; makefile: 3
file content (45 lines) | stat: -rw-r--r-- 1,180 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package ess

import (
	"github.com/denverdino/aliyungo/common"
	"github.com/denverdino/aliyungo/ecs"
)

const (
	TestAccessKeyId        = "MY_ACCESS_KEY_ID"
	TestAccessKeySecret    = "MY_ACCESS_KEY_SECRET"
	RegionId               = "MY_TEST_REGION"
	ScalingGroupId         = "MY_TEST_SCALING_GROUP_ID"
	TestInstanceId         = "MY_TEST_INSTANCE_ID"
	TestRuleArn            = "MY_TEST_RULE_ARN"
	TestScheduleLaunchTime = "MY_TEST_SCHEDULE_LAUNCH_TIME"
	TestIAmRich            = false
)

var testClient *Client

func NewTestClient(regionId common.Region) *Client {
	if testClient == nil {
		testClient = NewESSClient(TestAccessKeyId, TestAccessKeySecret, regionId)
	}
	return testClient
}

var testDebugClient *Client

func NewTestClientForDebug(regionId common.Region) *Client {
	if testDebugClient == nil {
		testDebugClient = NewESSClient(TestAccessKeyId, TestAccessKeySecret, regionId)
		testDebugClient.SetDebug(true)
	}
	return testDebugClient
}

var testEcsClient *ecs.Client

func NewTestEcsClient(regionId common.Region) *ecs.Client {
	if testEcsClient == nil {
		testEcsClient = ecs.NewECSClient(TestAccessKeyId, TestAccessKeySecret, regionId)
	}
	return testEcsClient
}