Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimiter ¶
RateLimiter is an interface for implementing a rate limiter
type RsyslogStyle ¶
type RsyslogStyle struct {
// contains filtered or unexported fields
}
RsyslogStyle is a rate limiter that works similar to rsyslog (and journald's) rate limiters, allowing you to set an interval and a burst. If there are more messages than burst in a given interval, all further messages are dropped until the end of that interval.
func NewRsyslogStyle ¶
func NewRsyslogStyle(interval time.Duration, burst int) *RsyslogStyle
NewRsyslogStyle returns a RateLimiter based on rsyslog's rate limiter
func (*RsyslogStyle) Expired ¶
func (r *RsyslogStyle) Expired() bool
Expired returns whether or not this rate limiter is able to be removed. We mark an RsyslogStyle rate limiter expired if there have been no checks issued for an hour.
Click to show internal directories.
Click to hide internal directories.