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

config.Endpoints.GetKMS   A

Complexity

Conditions 2

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
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
	SSM            string
16
}
17
18
func (e Endpoints) HasAthena() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasAthena should have comment or be unexported
Loading history...
19
	if e.Athena != "" {
20
		return true
21
	}
22
	return EnvAthenaEndpoint() != ""
23
}
24
25
func (e Endpoints) GetAthena() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetAthena should have comment or be unexported
Loading history...
26
	envvar := EnvAthenaEndpoint()
27
	if envvar != "" {
28
		return aws.ResolveWithEndpointURL(envvar)
29
	}
30
	return aws.ResolveWithEndpointURL(e.Athena)
31
}
32
33
func (e Endpoints) HasCloudwatchLogs() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasCloudwatchLogs should have comment or be unexported
Loading history...
34
	if e.CloudwatchLogs != "" {
35
		return true
36
	}
37
	return EnvCloudwatchLogsEndpoint() != ""
38
}
39
40
func (e Endpoints) GetCloudwatchLogs() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetCloudwatchLogs should have comment or be unexported
Loading history...
41
	envvar := EnvCloudwatchLogsEndpoint()
42
	if envvar != "" {
43
		return aws.ResolveWithEndpointURL(envvar)
44
	}
45
	return aws.ResolveWithEndpointURL(e.CloudwatchLogs)
46
}
47
48
func (e Endpoints) HasDynamoDB() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasDynamoDB should have comment or be unexported
Loading history...
49
	if e.DynamoDB != "" {
50
		return true
51
	}
52
	return EnvDynamoDBEndpoint() != ""
53
}
54
55
func (e Endpoints) GetDynamoDB() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetDynamoDB should have comment or be unexported
Loading history...
56
	envvar := EnvDynamoDBEndpoint()
57
	if envvar != "" {
58
		return aws.ResolveWithEndpointURL(envvar)
59
	}
60
	return aws.ResolveWithEndpointURL(e.DynamoDB)
61
}
62
63
func (e Endpoints) HasEC2() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasEC2 should have comment or be unexported
Loading history...
64
	if e.EC2 != "" {
65
		return true
66
	}
67
	return EnvEC2Endpoint() != ""
68
}
69
70
func (e Endpoints) GetEC2() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetEC2 should have comment or be unexported
Loading history...
71
	envvar := EnvEC2Endpoint()
72
	if envvar != "" {
73
		return aws.ResolveWithEndpointURL(envvar)
74
	}
75
	return aws.ResolveWithEndpointURL(e.EC2)
76
}
77
78
func (e Endpoints) HasPinpoint() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasPinpoint should have comment or be unexported
Loading history...
79
	if e.Pinpoint != "" {
80
		return true
81
	}
82
	return EnvPinpointEndpoint() != ""
83
}
84
85
func (e Endpoints) GetPinpoint() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetPinpoint should have comment or be unexported
Loading history...
86
	envvar := EnvPinpointEndpoint()
87
	if envvar != "" {
88
		return aws.ResolveWithEndpointURL(envvar)
89
	}
90
	return aws.ResolveWithEndpointURL(e.Pinpoint)
91
}
92
93
func (e Endpoints) HasPinpointEmail() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasPinpointEmail should have comment or be unexported
Loading history...
94
	if e.PinpointEmail != "" {
95
		return true
96
	}
97
	return EnvPinpointEmailEndpoint() != ""
98
}
99
100
func (e Endpoints) GetPinpointEmail() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetPinpointEmail should have comment or be unexported
Loading history...
101
	envvar := EnvPinpointEmailEndpoint()
102
	if envvar != "" {
103
		return aws.ResolveWithEndpointURL(envvar)
104
	}
105
	return aws.ResolveWithEndpointURL(e.PinpointEmail)
106
}
107
108
func (e Endpoints) HasKMS() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasKMS should have comment or be unexported
Loading history...
109
	if e.KMS != "" {
110
		return true
111
	}
112
	return EnvKMSEndpoint() != ""
113
}
114
115
func (e Endpoints) GetKMS() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetKMS should have comment or be unexported
Loading history...
116
	envvar := EnvKMSEndpoint()
117
	if envvar != "" {
118
		return aws.ResolveWithEndpointURL(envvar)
119
	}
120
	return aws.ResolveWithEndpointURL(e.KMS)
121
}
122
123
func (e Endpoints) HasS3() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasS3 should have comment or be unexported
Loading history...
124
	if e.S3 != "" {
125
		return true
126
	}
127
	return EnvS3Endpoint() != ""
128
}
129
130
func (e Endpoints) GetS3() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetS3 should have comment or be unexported
Loading history...
131
	envvar := EnvS3Endpoint()
132
	if envvar != "" {
133
		return aws.ResolveWithEndpointURL(envvar)
134
	}
135
	return aws.ResolveWithEndpointURL(e.S3)
136
}
137
138
func (e Endpoints) HasSES() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasSES should have comment or be unexported
Loading history...
139
	if e.SES != "" {
140
		return true
141
	}
142
	return EnvSESEndpoint() != ""
143
}
144
145
func (e Endpoints) GetSES() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetSES should have comment or be unexported
Loading history...
146
	envvar := EnvSESEndpoint()
147
	if envvar != "" {
148
		return aws.ResolveWithEndpointURL(envvar)
149
	}
150
	return aws.ResolveWithEndpointURL(e.SES)
151
}
152
153
func (e Endpoints) HasSSM() bool {
0 ignored issues
show
introduced by
exported method Endpoints.HasSSM should have comment or be unexported
Loading history...
154
	if e.SSM != "" {
155
		return true
156
	}
157
	return EnvSSMEndpoint() != ""
158
}
159
160
func (e Endpoints) GetSSM() aws.ResolveWithEndpoint {
0 ignored issues
show
introduced by
exported method Endpoints.GetSSM should have comment or be unexported
Loading history...
161
	envvar := EnvSSMEndpoint()
162
	if envvar != "" {
163
		return aws.ResolveWithEndpointURL(envvar)
164
	}
165
	return aws.ResolveWithEndpointURL(e.SSM)
166
}
167