View Source EctoIPRange.IP6R (Ecto IP Range v0.2.0)
Struct for PostgreSQL :ip6r fields.
Usage
When used during a changeset cast the following values are accepted:
:inet.ip6_address(): an IP6 tuple, e.g.{8193, 3512, 34211, 0, 0, 35374, 880, 29492}(single address only)binary"2001:0db8:85a3:0000:0000:8a2e:0370:7334": single address"2001:0db8:85a3:0000:0000:8a2e:0370:0000/112": CIDR notation for a range from2001:0db8:85a3:0000:0000:8a2e:0370:0000to2001:0db8:85a3:0000:0000:8a2e:0370:ffff"2001:0db8:85a3:0000:0000:8a2e:0370:7334-2001:0db8:85a3:0000:0000:8a2e:0370:7335": arbitrary range
EctoIPRange.IP4.t(): a pre-casted struct
IP4 addresses (binary and tuple) will be converted to IP6 format when casted.
Fields
rangefirst_iplast_ip
Link to this section Summary
Functions
Callback implementation for Ecto.Type.embed_as/1.
Callback implementation for Ecto.Type.equal?/2.
Link to this section Types
Specs
t() :: %EctoIPRange.IP6R{
first_ip: :inet.ip6_address(),
last_ip: :inet.ip6_address(),
range: binary()
}
Link to this section Functions
Callback implementation for Ecto.Type.embed_as/1.
Callback implementation for Ecto.Type.equal?/2.