IPBlocker class

IPBlocker class

Constructors

IPBlocker.new()

Properties

blockedIps Set<String>
Set of blocked IP addresses
final
blockedIpsList List<String>
Returns a list of blocked IP addresses
no setter
count int
Returns the number of blocked IP addresses
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asJson() String
Returns the IP block list as a JSON string
blockIp(String ip) → void
Blocks an IP address Adds the given ip to the blocked list, so that any incoming request from this IP address will be blocked.
clear() → void
Clears the list of blocked IP addresses.
fromJson(String json) → void
Loads the IP block list from a JSON string The JSON string should contain a list of IP addresses. This method clears the current list of blocked IP addresses and replaces it with the list of IP addresses in the JSON string.
isIpBlocked(String ip) bool
Checks if the given IP address is blocked.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
unblockIp(String ip) → void
Unblocks an IP address Removes the given ip from the blocked list, so that any incoming request from this IP address will no longer be blocked. If the IP address is not in the blocked list, this method does nothing.

Operators

operator ==(Object other) bool
The equality operator.
inherited