Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ PacketHandlers: 1 << 4, PacketBuffer: 50, DownlinkPathExpires: 15 * time.Second, ConnectionExpires: 1 * time.Minute, ScheduleLateTime: 800 * time.Millisecond, AddrChangeBlock: 1 * time.Minute, RateLimiting: RateLimitingConfig{ Enable: true, Messages: 10, Threshold: 10 * time.Millisecond, }, }
DefaultConfig contains the default configuration.
Functions ¶
Types ¶
type Config ¶
type Config struct { // PacketHandlers defines the number of concurrent packet handlers. PacketHandlers int `name:"packet-handlers" description:"Number of concurrent packet handlers"` // PacketBuffer defines how many packets are buffered to handlers before it overflows. PacketBuffer int `name:"packet-buffer" description:"Buffer size of unhandled packets"` // DownlinkPathExpires defines for how long a downlink path is valid. A downlink path is renewed on each pull data and // TX acknowledgement packet. // Gateways typically pull data every 5 seconds. DownlinkPathExpires time.Duration `name:"downlink-path-expires" description:"Time after which a downlink path to a gateway expires"` // ConnectionExpires defines for how long a connection remains valid while no pull data, push data or TX // acknowledgement is received. ConnectionExpires time.Duration `name:"connection-expires" description:"Time after which a connection of a gateway expires"` // ScheduleLateTime defines the time in advance to the actual transmission the downlink message should be scheduled to // the gateway. ScheduleLateTime time.Duration `name:"schedule-late-time" description:"Time in advance to send downlink to the gateway when scheduling late"` // AddrChangeBlock defines the time to block traffic when the address changes. AddrChangeBlock time.Duration `name:"addr-change-block" description:"Time to block traffic when a gateway's address changes"` // RateLimitingConfig is the configuration for the rate limiting firewall capabilities. RateLimiting RateLimitingConfig `name:"rate-limiting"` }
Config contains configuration settings for the UDP gateway frontend. Use DefaultConfig for recommended settings.
type Firewall ¶
Firewall filters packets by tracking addresses and time.
func NewMemoryFirewall ¶
NewMemoryFirewall returns an in-memory Firewall.
type RateLimitingConfig ¶
type RateLimitingConfig struct { Enable bool `name:"enable" description:"Enable rate limiting for gateways"` Messages int `name:"messages" description:"Number of past messages to check timestamp for"` Threshold time.Duration `` /* 139-byte string literal not displayed */ }
RateLimitingConfig contains configuration settings for the rate limiting capabilities of the UDP gateway frontend firewall.
Click to show internal directories.
Click to hide internal directories.