@@ -17,25 +17,25 @@ type yamlReplaces struct {
17
17
Name string
18
18
}
19
19
20
- type yamlRateLimit struct {
20
+ type YamlRateLimit struct {
21
21
RequestsPerUnit uint32 `yaml:"requests_per_unit"`
22
22
Unit string
23
23
Unlimited bool `yaml:"unlimited"`
24
24
Name string
25
25
Replaces []yamlReplaces
26
26
}
27
27
28
- type yamlDescriptor struct {
28
+ type YamlDescriptor struct {
29
29
Key string
30
30
Value string
31
- RateLimit * yamlRateLimit `yaml:"rate_limit"`
32
- Descriptors []yamlDescriptor
31
+ RateLimit * YamlRateLimit `yaml:"rate_limit"`
32
+ Descriptors []YamlDescriptor
33
33
ShadowMode bool `yaml:"shadow_mode"`
34
34
}
35
35
36
- type yamlRoot struct {
36
+ type YamlRoot struct {
37
37
Domain string
38
- Descriptors []yamlDescriptor
38
+ Descriptors []YamlDescriptor
39
39
}
40
40
41
41
type rateLimitDescriptor struct {
@@ -116,7 +116,7 @@ func newRateLimitConfigError(config RateLimitConfigToLoad, err string) RateLimit
116
116
// @param parentKey supplies the fully resolved key name that owns this config level.
117
117
// @param descriptors supplies the YAML descriptors to load.
118
118
// @param statsManager that owns the stats.Scope.
119
- func (this * rateLimitDescriptor ) loadDescriptors (config RateLimitConfigToLoad , parentKey string , descriptors []yamlDescriptor , statsManager stats.Manager ) {
119
+ func (this * rateLimitDescriptor ) loadDescriptors (config RateLimitConfigToLoad , parentKey string , descriptors []YamlDescriptor , statsManager stats.Manager ) {
120
120
for _ , descriptorConfig := range descriptors {
121
121
if descriptorConfig .Key == "" {
122
122
panic (newRateLimitConfigError (config , "descriptor has empty key" ))
@@ -245,7 +245,7 @@ func (this *rateLimitConfigImpl) loadConfig(config RateLimitConfigToLoad) {
245
245
}
246
246
validateYamlKeys (config , any )
247
247
248
- var root yamlRoot
248
+ var root YamlRoot
249
249
err = yaml .Unmarshal ([]byte (config .FileBytes ), & root )
250
250
if err != nil {
251
251
errorText := fmt .Sprintf ("error loading config file: %s" , err .Error ())
0 commit comments