Documentation ¶
Index ¶
- Variables
- type Limits
- type RateLimit
- func (l *RateLimit) HandleConnect(ctx middleware.Context, msg *types.ConnectMessage) error
- func (l *RateLimit) HandleDisconnect(ctx middleware.Context, msg *types.DisconnectMessage) error
- func (l *RateLimit) HandleDownlink(ctx middleware.Context, msg *types.DownlinkMessage) error
- func (l *RateLimit) HandleStatus(ctx middleware.Context, msg *types.StatusMessage) error
- func (l *RateLimit) HandleUplink(ctx middleware.Context, msg *types.UplinkMessage) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRateLimited = errors.New("rate limit reached")
ErrRateLimited is returned if the rate limit has been reached
Functions ¶
This section is empty.
Types ¶
type RateLimit ¶
type RateLimit struct {
// contains filtered or unexported fields
}
RateLimit uplink, downlink and status messages per gateway
func NewRateLimit ¶
NewRateLimit returns a middleware that rate-limits uplink, downlink and status messages per gateway
func NewRedisRateLimit ¶
NewRedisRateLimit returns a middleware that rate-limits uplink, downlink and status messages per gateway
func (*RateLimit) HandleConnect ¶
func (l *RateLimit) HandleConnect(ctx middleware.Context, msg *types.ConnectMessage) error
HandleConnect initializes the rate limiter
func (*RateLimit) HandleDisconnect ¶
func (l *RateLimit) HandleDisconnect(ctx middleware.Context, msg *types.DisconnectMessage) error
HandleDisconnect cleans up
func (*RateLimit) HandleDownlink ¶
func (l *RateLimit) HandleDownlink(ctx middleware.Context, msg *types.DownlinkMessage) error
HandleDownlink rate-limits downlink messages
func (*RateLimit) HandleStatus ¶
func (l *RateLimit) HandleStatus(ctx middleware.Context, msg *types.StatusMessage) error
HandleStatus rate-limits status messages
func (*RateLimit) HandleUplink ¶
func (l *RateLimit) HandleUplink(ctx middleware.Context, msg *types.UplinkMessage) error
HandleUplink rate-limits status messages
Click to show internal directories.
Click to hide internal directories.