3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 10:42:52 +01:00

unexport rawLimiterConfig

This commit is contained in:
Shivaram Lingamneni 2019-11-18 17:30:54 -05:00
parent 4050b6571a
commit 42db1778ac
3 changed files with 6 additions and 6 deletions

View File

@ -30,9 +30,9 @@ type customLimit struct {
}
// LimiterConfig controls the automated connection limits.
// RawLimiterConfig contains all the YAML-visible fields;
// rawLimiterConfig contains all the YAML-visible fields;
// LimiterConfig contains additional denormalized private fields
type RawLimiterConfig struct {
type rawLimiterConfig struct {
Limit bool
MaxConcurrent int `yaml:"max-concurrent-connections"`
@ -50,7 +50,7 @@ type RawLimiterConfig struct {
}
type LimiterConfig struct {
RawLimiterConfig
rawLimiterConfig
ipv4Mask net.IPMask
ipv6Mask net.IPMask
@ -59,7 +59,7 @@ type LimiterConfig struct {
}
func (config *LimiterConfig) UnmarshalYAML(unmarshal func(interface{}) error) (err error) {
if err = unmarshal(&config.RawLimiterConfig); err != nil {
if err = unmarshal(&config.rawLimiterConfig); err != nil {
return err
}
return config.postprocess()

View File

@ -18,7 +18,7 @@ func easyParseIP(ipstr string) (result net.IP) {
}
var baseConfig = LimiterConfig{
RawLimiterConfig: RawLimiterConfig{
rawLimiterConfig: rawLimiterConfig{
Limit: true,
MaxConcurrent: 4,

View File

@ -66,7 +66,7 @@ func makeTestThrottler(v4len, v6len int) *Limiter {
minute, _ := time.ParseDuration("1m")
maxConnections := 3
config := LimiterConfig{
RawLimiterConfig: RawLimiterConfig{
rawLimiterConfig: rawLimiterConfig{
Limit: false,
Throttle: true,
CidrLenIPv4: v4len,