giddy

Types

Resolve a record of rrtype for the hostname hostname.

Only available on the erlang backend. See resolve_js for the javascript backend equivalent. IP version family used for the gethostbyname_* functions.

pub type LookupFamily {
  V4
  V6
}

Constructors

  • V4
  • V6
pub type LookupResponse {
  LookupResponse(address: String, family: LookupFamily)
}

Constructors

pub type RRType {
  A
  Aaaa
  Any
  Caa
  Cname
  Mx
  Naptr
  Ns
  Ptr
  Soa
  Srv
  Txt
  Tlsa
  Gid
  Hinfo
  Mb
  Md
  Mg
  Mf
  Minfo
  Null
  Spf
  Uid
  Uinfo
  Unspec
  Wks
}

Constructors

  • A
  • Aaaa
  • Any
  • Caa
  • Cname
  • Mx
  • Naptr
  • Ns
  • Ptr
  • Soa
  • Srv
  • Txt
  • Tlsa
  • Gid
  • Hinfo
  • Mb
  • Md
  • Mg
  • Mf
  • Minfo
  • Null
  • Spf
  • Uid
  • Uinfo
  • Unspec
  • Wks

Values

pub fn gethostbyname_js(
  hostname: String,
  family: option.Option(LookupFamily),
) -> promise.Promise(
  Result(List(LookupResponse), error.GiddyError),
)

Resolve a hostname to a list of IP addresses.

If family is None, return both IPv4 and IPv6 addresses. Order of addresses is not guaranteed. String representation of addresses may differ between targets.

Only available on the javascript backend. See gethostbyname_erl for the erlang backend equivalent.

pub fn is_supported_erl(rrtype: RRType) -> Bool

Return True if a record type is supported on the erlang backend.

pub fn is_supported_js(rrtype: RRType) -> Bool

Return True if a record type is supported on the javascript backend.

pub fn main() -> promise.Promise(Nil)

Resolve a hostname to a list of IP addresses.

If family is None, return both IPv4 and IPv6 addresses. Order of addresses is not guaranteed. String representation of addresses may differ between targets.

Only available on the erlang backend. See gethostbyname_js for the javascript backend equivalent.

pub fn resolve_js(
  hostname: String,
  rrtype: RRType,
) -> promise.Promise(
  List(Result(dns_response.RRResponse, error.GiddyError)),
)

Resolve a record of rrtype for the hostname hostname.

Only available on the javascript backend. See resolve_erl for the erlang backend equivalent.

pub fn rrtype_from_string(
  rrtype: String,
) -> Result(RRType, error.GiddyError)

Convert a string to a record type.

pub fn rrtype_to_string(rrtype: RRType) -> String

Convert a record type to a string representation.

✨ Search Document