Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Pythia.Services.GlobalIp
Contents
Description
This modules exports everything needed for retrieving global IP addresses.
Since: 0.1
Synopsis
- queryGlobalIp :: (MonadCatch m, MonadTypedProcess m) => GlobalIpBothConfig -> m (IpAddress Ipv4, IpAddress Ipv6)
- queryGlobalIpv4 :: (MonadCatch m, MonadTypedProcess m) => GlobalIpv4Config -> m (IpAddress Ipv4)
- queryGlobalIpv6 :: (MonadCatch m, MonadTypedProcess m) => GlobalIpv6Config -> m (IpAddress Ipv6)
- data IpType
- newtype IpAddress a = MkIpAddress (Refined (IpRefinement a) Text)
- type GlobalIpv4Config = GlobalIpConfig [UrlSource Ipv4]
- type GlobalIpv6Config = GlobalIpConfig [UrlSource Ipv6]
- type GlobalIpBothConfig = GlobalIpConfig ([UrlSource Ipv4], [UrlSource Ipv6])
- data GlobalIpConfig a = MkGlobalIpConfig {
- app :: GlobalIpApp
- sources :: a
- data GlobalIpApp
- newtype UrlSource a = MkUrlSource {
- unUrlSource :: Text
Queries
queryGlobalIp :: (MonadCatch m, MonadTypedProcess m) => GlobalIpBothConfig -> m (IpAddress Ipv4, IpAddress Ipv6) Source #
Queries for IPv4 and IPv6 global IP address based on the configuration.
Since: 0.1
queryGlobalIpv4 :: (MonadCatch m, MonadTypedProcess m) => GlobalIpv4Config -> m (IpAddress Ipv4) Source #
queryGlobalIp
restricted to IPv4 address only.
Since: 0.1
queryGlobalIpv6 :: (MonadCatch m, MonadTypedProcess m) => GlobalIpv6Config -> m (IpAddress Ipv6) Source #
queryGlobalIp
restricted to IPv6 address only.
Since: 0.1
Types
IP types.
Since: 0.1
Type for an IP address. The type family IpRefinement
refines the
underlying Text
according to the spec.
Ipv4
: All characters are digits or dots, and the length is0 < l < 16
.Ipv6
: All characters are hex digits or colons, and the length is0 < l < 40
.
Since: 0.1
Constructors
MkIpAddress (Refined (IpRefinement a) Text) |
Instances
(k ~ An_Iso, a ~ Refined (IpRefinement s) Text, b ~ Refined (IpRefinement s) Text) => LabelOptic "unIpAddress" k (IpAddress s) (IpAddress s) a b Source # | Since: 0.1 |
Defined in Pythia.Services.Types.Network | |
Generic (IpAddress a) Source # | |
Show (IpAddress a) Source # | Since: 0.1 |
NFData (IpAddress a) Source # | Since: 0.1 |
Defined in Pythia.Services.Types.Network | |
Eq (IpAddress a) Source # | Since: 0.1 |
Ord (IpAddress a) Source # | Since: 0.1 |
Defined in Pythia.Services.Types.Network | |
Display (IpAddress a) Source # | Since: 0.1 |
Defined in Pythia.Services.Types.Network | |
type Rep (IpAddress a) Source # | Since: 0.1 |
Defined in Pythia.Services.Types.Network type Rep (IpAddress a) = D1 ('MetaData "IpAddress" "Pythia.Services.Types.Network" "pythia-0.1-inplace" 'True) (C1 ('MetaCons "MkIpAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "unIpAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Refined (IpRefinement a) Text)))) |
Configuration
type GlobalIpv4Config = GlobalIpConfig [UrlSource Ipv4] Source #
Type alias for Ipv4
GlobalIpConfig
.
Since: 0.1.0.0
type GlobalIpv6Config = GlobalIpConfig [UrlSource Ipv6] Source #
Type alias for Ipv6
GlobalIpConfig
.
Since: 0.1.0.0
type GlobalIpBothConfig = GlobalIpConfig ([UrlSource Ipv4], [UrlSource Ipv6]) Source #
Type alias for Ipv4
and Ipv6
GlobalIpConfig
.
Since: 0.1.0.0
data GlobalIpConfig a Source #
Complete configuration for querying global IP addresses.
Since: 0.1
Constructors
MkGlobalIpConfig | |
Instances
data GlobalIpApp Source #
This type determines what program we use to lookup the ip address.
Since: 0.1
Constructors
GlobalIpAppCurl | Uses curl to lookup the ip addresses. Since: 0.1 |
GlobalIpAppDig | Uses the dig command to perform a DNS lookup. This is generally the fastest and most reliable. Since: 0.1 |
Instances
Additional URL source for retrieving IP information. The intended app should not be included (i.e. curl or dig), but any desired flags should be.
Examples
(dig): "resolver1.opendns.com myip.opendns.com"
(dig): -4 TXT o-o.myaddr.l.google.com
ns1.google.com
(curl): "http://whatismyip.akamai.com/"
...
Since: 0.1
Constructors
MkUrlSource | |
Fields
|
Instances
(k ~ An_Iso, a ~ Text, b ~ Text) => LabelOptic "unUrlSource" k (UrlSource p) (UrlSource p) a b Source # | Since: 0.1 |
Defined in Pythia.Services.GlobalIp.Types | |
IsString (UrlSource a) Source # | Since: 0.1 |
Defined in Pythia.Services.GlobalIp.Types Methods fromString :: String -> UrlSource a # | |
Generic (UrlSource a) Source # | |
Show (UrlSource a) Source # | Since: 0.1 |
NFData (UrlSource a) Source # | Since: 0.1 |
Defined in Pythia.Services.GlobalIp.Types | |
Eq (UrlSource a) Source # | Since: 0.1 |
Ord (UrlSource a) Source # | Since: 0.1 |
Defined in Pythia.Services.GlobalIp.Types | |
type Rep (UrlSource a) Source # | Since: 0.1 |
Defined in Pythia.Services.GlobalIp.Types |