Lots more tests

This commit is contained in:
Philipp Heckel 2021-12-10 22:57:01 -05:00
parent 5ef83a7ba0
commit e8688fed4b
6 changed files with 186 additions and 98 deletions

View file

@ -12,6 +12,9 @@ const (
DefaultKeepaliveInterval = 30 * time.Second
DefaultManagerInterval = time.Minute
DefaultAtSenderInterval = 10 * time.Second
DefaultMinDelay = 10 * time.Second
DefaultMaxDelay = 3 * 24 * time.Hour
DefaultMessageLimit = 512
)
// Defines all the limits
@ -37,6 +40,9 @@ type Config struct {
KeepaliveInterval time.Duration
ManagerInterval time.Duration
AtSenderInterval time.Duration
MessageLimit int
MinDelay time.Duration
MaxDelay time.Duration
GlobalTopicLimit int
VisitorRequestLimitBurst int
VisitorRequestLimitReplenish time.Duration
@ -56,6 +62,9 @@ func New(listenHTTP string) *Config {
CacheDuration: DefaultCacheDuration,
KeepaliveInterval: DefaultKeepaliveInterval,
ManagerInterval: DefaultManagerInterval,
MessageLimit: DefaultMessageLimit,
MinDelay: DefaultMinDelay,
MaxDelay: DefaultMaxDelay,
AtSenderInterval: DefaultAtSenderInterval,
GlobalTopicLimit: DefaultGlobalTopicLimit,
VisitorRequestLimitBurst: DefaultVisitorRequestLimitBurst,