Passed
Push — master ( 9acbae...8ba3ae )
by eval
03:10 queued 01:28
created

config/endpoints.go   B

Size/Duplication

Total Lines 181
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 44
eloc 113
dl 0
loc 181
rs 8.8798
c 0
b 0
f 0

22 Methods

Rating   Name   Duplication   Size   Complexity  
A config.Endpoints.HasPinpoint 0 5 2
A config.Endpoints.GetSSM 0 6 2
A config.Endpoints.GetS3 0 6 2
A config.Endpoints.HasSES 0 5 2
A config.Endpoints.HasDynamoDB 0 5 2
A config.Endpoints.GetDynamoDB 0 6 2
A config.Endpoints.HasSSM 0 5 2
A config.Endpoints.HasAthena 0 5 2
A config.Endpoints.HasPinpointEmail 0 5 2
A config.Endpoints.GetCloudwatchLogs 0 6 2
A config.Endpoints.HasSQS 0 5 2
A config.Endpoints.GetEC2 0 6 2
A config.Endpoints.HasCloudwatchLogs 0 5 2
A config.Endpoints.HasS3 0 5 2
A config.Endpoints.GetKMS 0 6 2
A config.Endpoints.HasKMS 0 5 2
A config.Endpoints.GetPinpointEmail 0 6 2
A config.Endpoints.HasEC2 0 5 2
A config.Endpoints.GetSES 0 6 2
A config.Endpoints.GetPinpoint 0 6 2
A config.Endpoints.GetSQS 0 6 2
A config.Endpoints.GetAthena 0 6 2
1
package config
2
3
import "github.com/aws/aws-sdk-go-v2/aws"
4
5
type Endpoints struct {
0 ignored issues
show
introduced by
exported type Endpoints should have comment or be unexported
Loading history...
6
	Athena         string
7
	CloudwatchLogs string
8
	DynamoDB       string
9
	EC2            string
10
	KMS            string
11
	Pinpoint       string
12
	PinpointEmail  string
13
	S3             string
14
	SES            string
15
	SQS            string
16
	SSM            string
17
}
18
19
func (e Endpoints) HasAthena() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasAthena should have comment or be unexported
Loading history...
20
	if e.Athena != "" {
21
		return true
22
	}
23
	return EnvAthenaEndpoint() != ""
24
}
25
26
func (e Endpoints) GetAthena() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetAthena should have comment or be unexported
Loading history...
27
	envvar := EnvAthenaEndpoint()
28
	if envvar != "" {
29
		return aws.ResolveWithEndpointURL(envvar)
30
	}
31
	return aws.ResolveWithEndpointURL(e.Athena)
32
}
33
34
func (e Endpoints) HasCloudwatchLogs() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasCloudwatchLogs should have comment or be unexported
Loading history...
35
	if e.CloudwatchLogs != "" {
36
		return true
37
	}
38
	return EnvCloudwatchLogsEndpoint() != ""
39
}
40
41
func (e Endpoints) GetCloudwatchLogs() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetCloudwatchLogs should have comment or be unexported
Loading history...
42
	envvar := EnvCloudwatchLogsEndpoint()
43
	if envvar != "" {
44
		return aws.ResolveWithEndpointURL(envvar)
45
	}
46
	return aws.ResolveWithEndpointURL(e.CloudwatchLogs)
47
}
48
49
func (e Endpoints) HasDynamoDB() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasDynamoDB should have comment or be unexported
Loading history...
50
	if e.DynamoDB != "" {
51
		return true
52
	}
53
	return EnvDynamoDBEndpoint() != ""
54
}
55
56
func (e Endpoints) GetDynamoDB() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetDynamoDB should have comment or be unexported
Loading history...
57
	envvar := EnvDynamoDBEndpoint()
58
	if envvar != "" {
59
		return aws.ResolveWithEndpointURL(envvar)
60
	}
61
	return aws.ResolveWithEndpointURL(e.DynamoDB)
62
}
63
64
func (e Endpoints) HasEC2() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasEC2 should have comment or be unexported
Loading history...
65
	if e.EC2 != "" {
66
		return true
67
	}
68
	return EnvEC2Endpoint() != ""
69
}
70
71
func (e Endpoints) GetEC2() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetEC2 should have comment or be unexported
Loading history...
72
	envvar := EnvEC2Endpoint()
73
	if envvar != "" {
74
		return aws.ResolveWithEndpointURL(envvar)
75
	}
76
	return aws.ResolveWithEndpointURL(e.EC2)
77
}
78
79
func (e Endpoints) HasPinpoint() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasPinpoint should have comment or be unexported
Loading history...
80
	if e.Pinpoint != "" {
81
		return true
82
	}
83
	return EnvPinpointEndpoint() != ""
84
}
85
86
func (e Endpoints) GetPinpoint() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetPinpoint should have comment or be unexported
Loading history...
87
	envvar := EnvPinpointEndpoint()
88
	if envvar != "" {
89
		return aws.ResolveWithEndpointURL(envvar)
90
	}
91
	return aws.ResolveWithEndpointURL(e.Pinpoint)
92
}
93
94
func (e Endpoints) HasPinpointEmail() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasPinpointEmail should have comment or be unexported
Loading history...
95
	if e.PinpointEmail != "" {
96
		return true
97
	}
98
	return EnvPinpointEmailEndpoint() != ""
99
}
100
101
func (e Endpoints) GetPinpointEmail() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetPinpointEmail should have comment or be unexported
Loading history...
102
	envvar := EnvPinpointEmailEndpoint()
103
	if envvar != "" {
104
		return aws.ResolveWithEndpointURL(envvar)
105
	}
106
	return aws.ResolveWithEndpointURL(e.PinpointEmail)
107
}
108
109
func (e Endpoints) HasKMS() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasKMS should have comment or be unexported
Loading history...
110
	if e.KMS != "" {
111
		return true
112
	}
113
	return EnvKMSEndpoint() != ""
114
}
115
116
func (e Endpoints) GetKMS() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetKMS should have comment or be unexported
Loading history...
117
	envvar := EnvKMSEndpoint()
118
	if envvar != "" {
119
		return aws.ResolveWithEndpointURL(envvar)
120
	}
121
	return aws.ResolveWithEndpointURL(e.KMS)
122
}
123
124
func (e Endpoints) HasS3() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasS3 should have comment or be unexported
Loading history...
125
	if e.S3 != "" {
126
		return true
127
	}
128
	return EnvS3Endpoint() != ""
129
}
130
131
func (e Endpoints) GetS3() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetS3 should have comment or be unexported
Loading history...
132
	envvar := EnvS3Endpoint()
133
	if envvar != "" {
134
		return aws.ResolveWithEndpointURL(envvar)
135
	}
136
	return aws.ResolveWithEndpointURL(e.S3)
137
}
138
139
func (e Endpoints) HasSES() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasSES should have comment or be unexported
Loading history...
140
	if e.SES != "" {
141
		return true
142
	}
143
	return EnvSESEndpoint() != ""
144
}
145
146
func (e Endpoints) GetSES() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetSES should have comment or be unexported
Loading history...
147
	envvar := EnvSESEndpoint()
148
	if envvar != "" {
149
		return aws.ResolveWithEndpointURL(envvar)
150
	}
151
	return aws.ResolveWithEndpointURL(e.SES)
152
}
153
154
func (e Endpoints) HasSQS() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasSQS should have comment or be unexported
Loading history...
155
	if e.SQS != "" {
156
		return true
157
	}
158
	return EnvSQSEndpoint() != ""
159
}
160
161
func (e Endpoints) GetSQS() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetSQS should have comment or be unexported
Loading history...
162
	envvar := EnvSQSEndpoint()
163
	if envvar != "" {
164
		return aws.ResolveWithEndpointURL(envvar)
165
	}
166
	return aws.ResolveWithEndpointURL(e.SQS)
167
}
168
169
func (e Endpoints) HasSSM() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasSSM should have comment or be unexported
Loading history...
170
	if e.SSM != "" {
171
		return true
172
	}
173
	return EnvSSMEndpoint() != ""
174
}
175
176
func (e Endpoints) GetSSM() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetSSM should have comment or be unexported
Loading history...
177
	envvar := EnvSSMEndpoint()
178
	if envvar != "" {
179
		return aws.ResolveWithEndpointURL(envvar)
180
	}
181
	return aws.ResolveWithEndpointURL(e.SSM)
182
}
183