Selaa lähdekoodia

unexport rawLimiterConfig

tags/v2.0.0-rc1
Shivaram Lingamneni 4 vuotta sitten
vanhempi
commit
42db1778ac

+ 4
- 4
irc/connection_limits/limiter.go Näytä tiedosto

30
 }
30
 }
31
 
31
 
32
 // LimiterConfig controls the automated connection limits.
32
 // LimiterConfig controls the automated connection limits.
33
-// RawLimiterConfig contains all the YAML-visible fields;
33
+// rawLimiterConfig contains all the YAML-visible fields;
34
 // LimiterConfig contains additional denormalized private fields
34
 // LimiterConfig contains additional denormalized private fields
35
-type RawLimiterConfig struct {
35
+type rawLimiterConfig struct {
36
 	Limit         bool
36
 	Limit         bool
37
 	MaxConcurrent int `yaml:"max-concurrent-connections"`
37
 	MaxConcurrent int `yaml:"max-concurrent-connections"`
38
 
38
 
50
 }
50
 }
51
 
51
 
52
 type LimiterConfig struct {
52
 type LimiterConfig struct {
53
-	RawLimiterConfig
53
+	rawLimiterConfig
54
 
54
 
55
 	ipv4Mask     net.IPMask
55
 	ipv4Mask     net.IPMask
56
 	ipv6Mask     net.IPMask
56
 	ipv6Mask     net.IPMask
59
 }
59
 }
60
 
60
 
61
 func (config *LimiterConfig) UnmarshalYAML(unmarshal func(interface{}) error) (err error) {
61
 func (config *LimiterConfig) UnmarshalYAML(unmarshal func(interface{}) error) (err error) {
62
-	if err = unmarshal(&config.RawLimiterConfig); err != nil {
62
+	if err = unmarshal(&config.rawLimiterConfig); err != nil {
63
 		return err
63
 		return err
64
 	}
64
 	}
65
 	return config.postprocess()
65
 	return config.postprocess()

+ 1
- 1
irc/connection_limits/limiter_test.go Näytä tiedosto

18
 }
18
 }
19
 
19
 
20
 var baseConfig = LimiterConfig{
20
 var baseConfig = LimiterConfig{
21
-	RawLimiterConfig: RawLimiterConfig{
21
+	rawLimiterConfig: rawLimiterConfig{
22
 		Limit:         true,
22
 		Limit:         true,
23
 		MaxConcurrent: 4,
23
 		MaxConcurrent: 4,
24
 
24
 

+ 1
- 1
irc/connection_limits/throttler_test.go Näytä tiedosto

66
 	minute, _ := time.ParseDuration("1m")
66
 	minute, _ := time.ParseDuration("1m")
67
 	maxConnections := 3
67
 	maxConnections := 3
68
 	config := LimiterConfig{
68
 	config := LimiterConfig{
69
-		RawLimiterConfig: RawLimiterConfig{
69
+		rawLimiterConfig: rawLimiterConfig{
70
 			Limit:        false,
70
 			Limit:        false,
71
 			Throttle:     true,
71
 			Throttle:     true,
72
 			CidrLenIPv4:  v4len,
72
 			CidrLenIPv4:  v4len,

Loading…
Peruuta
Tallenna