Implement IsProtected interface
1 |
package connmgr |
|
2 |
|
|
3 |
import "time" |
|
4 |
|
|
5 |
// BasicConnManagerConfig is the configuration struct for the basic connection
|
|
6 |
// manager.
|
|
7 |
type BasicConnManagerConfig struct { |
|
8 |
highWater int |
|
9 |
lowWater int |
|
10 |
gracePeriod time.Duration |
|
11 |
silencePeriod time.Duration |
|
12 |
decayer *DecayerCfg |
|
13 |
}
|
|
14 |
|
|
15 |
// Option represents an option for the basic connection manager.
|
|
16 |
type Option func(*BasicConnManagerConfig) error |
|
17 |
|
|
18 |
// DecayerConfig applies a configuration for the decayer.
|
|
19 | 2 |
func DecayerConfig(opts *DecayerCfg) Option { |
20 | 2 |
return func(cfg *BasicConnManagerConfig) error { |
21 | 2 |
cfg.decayer = opts |
22 | 2 |
return nil |
23 |
}
|
|
24 |
}
|
Read our documentation on viewing source code .