Passed
Push — master ( ad04e3...c5b8de )
by eval
01:47
created

config/env.go   A

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 11
eloc 35
dl 0
loc 72
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A config.EnvSQSEndpoint 0 2 1
A config.EnvSNSEndpoint 0 2 1
A config.EnvKMSEndpoint 0 2 1
A config.EnvEndpoint 0 2 1
A config.EnvSSMEndpoint 0 2 1
A config.EnvCloudwatchLogsEndpoint 0 2 1
A config.EnvS3Endpoint 0 2 1
A config.EnvDynamoDBEndpoint 0 2 1
A config.EnvPinpointEmailEndpoint 0 2 1
A config.EnvRegion 0 2 1
A config.EnvEC2Endpoint 0 2 1
1
package config
2
3
import "os"
4
5
const (
6
	envRegion = "AWS_REGION"
7
8
	envEndpoint               = "AWS_ENDPOINT"
9
	envCloudwatchLogsEndpoint = "AWS_CLOUDWATCH_LOGS_ENDPOINT"
10
	envDynamoDBEndpoint       = "AWS_DYNAMODB_ENDPOINT"
11
	envEC2Endpoint            = "AWS_EC2_ENDPOINT"
12
	envKMSEndpoint            = "AWS_KMS_ENDPOINT"
13
	envPinpointEmailEndpoint  = "AWS_PINPOINT_EMAIL_ENDPOINT"
14
	envS3Endpoint             = "AWS_S3_ENDPOINT"
15
	envSNSEndpoint            = "AWS_SNS_ENDPOINT"
16
	envSQSEndpoint            = "AWS_SQS_ENDPOINT"
17
	envSSMEndpoint            = "AWS_SSM_ENDPOINT"
18
)
19
20
// EnvRegion get region from env vars.
21
func EnvRegion() string {
22
	return os.Getenv(envRegion)
23
}
24
25
// EnvEndpoint get endpoint from env vars.
26
func EnvEndpoint() string {
27
	return os.Getenv(envEndpoint)
28
}
29
30
// EnvCloudwatchLogsEndpoint get CloudwatchLogs endpoint from env vars.
31
func EnvCloudwatchLogsEndpoint() string {
32
	return os.Getenv(envCloudwatchLogsEndpoint)
33
}
34
35
// EnvDynamoDBEndpoint get DynamoDB endpoint from env vars.
36
func EnvDynamoDBEndpoint() string {
37
	return os.Getenv(envDynamoDBEndpoint)
38
}
39
40
// EnvEC2Endpoint get EC2 endpoint from env vars.
41
func EnvEC2Endpoint() string {
42
	return os.Getenv(envEC2Endpoint)
43
}
44
45
// EnvPinpointEmailEndpoint get PinpointEmail endpoint from env vars.
46
func EnvPinpointEmailEndpoint() string {
47
	return os.Getenv(envPinpointEmailEndpoint)
48
}
49
50
// EnvKMSEndpoint get KMS endpoint from env vars.
51
func EnvKMSEndpoint() string {
52
	return os.Getenv(envKMSEndpoint)
53
}
54
55
// EnvS3Endpoint get S3 endpoint from env vars.
56
func EnvS3Endpoint() string {
57
	return os.Getenv(envS3Endpoint)
58
}
59
60
// EnvSNSEndpoint get SNS endpoint from env vars.
61
func EnvSNSEndpoint() string {
62
	return os.Getenv(envSNSEndpoint)
63
}
64
65
// EnvSQSEndpoint get SQS endpoint from env vars.
66
func EnvSQSEndpoint() string {
67
	return os.Getenv(envSQSEndpoint)
68
}
69
70
// EnvSSMEndpoint get SSM endpoint from env vars.
71
func EnvSSMEndpoint() string {
72
	return os.Getenv(envSSMEndpoint)
73
}
74