Types
IPDefect = object of IPResponseError
- Raised if the provided IP is defected or invalid.
IPRef = ref object address*: string locale*: Locale timeUntilReset*: int remainingRequests*: int
- An object representing an IP address. This is the core object which can be used to interact with the application's base.
IPResponseError = object of HttpRequestError
- Raised if the code can't communicate with the API due to unstable internet connection or other circumstances.
Locale {.pure.} = enum EN = "en", DE = "de", ES = "es", PT_BR = "pt-BR", FR = "fr", JA = "ja", ZH_CN = "zh-CN", RU = "ru"
- An enum representing different types of locales. These can be used to modify the language in which the application receives data.
NotInitializedError = object of KeyError
- Raised if the developer has not initialized the data inside the IPRef object with IPRef.refreshData().
Procs
proc continentCode(self: IPRef): string {....raises: [NotInitializedError], tags: [], forbids: [].}
- The two-letter continent code (ISO 3166-1 alpha-2) of the IP address.
proc countryCode(self: IPRef): string {....raises: [NotInitializedError], tags: [], forbids: [].}
- The two-letter country code (ISO 3166-1 alpha-2) of the IP address.
proc refreshData(self: IPRef): Future[void] {....stackTrace: false, raises: [Exception], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Query the API for the provided IP and load the returned data to the IPRef instance if successful.
proc regionName(self: IPRef): string {....raises: [NotInitializedError], tags: [], forbids: [].}
- The name of the region of the IP address.