View Source URL.UUID (URL v2.0.0)

Parses a geo URL

Summary

Functions

Parse a URI with the :scheme of "uuid"

Types

@type t() :: %URL.UUID{params: map(), uuid: binary()}

Functions

@spec parse(URI.t()) :: {:ok, t()} | {:error, {module(), binary()}}

Parse a URI with the :scheme of "uuid"

Example

iex> uuid = URI.parse("uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6;a=b")
iex> URL.UUID.parse(uuid)
{:ok,
 %URL.UUID{uuid: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", params: %{"a" => "b"}}}

iex> uuid = URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6;a=b")
iex> URL.UUID.parse(uuid)
{:ok, %URL.UUID{params: %{"a" => "b"}, uuid: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"}}