Skip to content

stephenlacy/elixir-urn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URN

Build Status

hex.pm documentation

Uniform Resource Name (URN) parsing and validation in Elixir

Installation

Add urn to your list of dependencies in mix.exs:

def deps do
  [{:urn, "~> 1.0.0"}]
end

Example

defmodule Project do
  alias URN
  def action() do
    # Parse input string "urn:collection:id" to Map
    {:ok, urn} = URN.parse("urn:collection:id")

    IO.inspect urn
    # %URN{fragment: nil, nid: "collection", nss: "id", query: nil, resolution: nil}

    # Turn back into a string
    URN.to_string(urn)
    # urn:collection:id
  end

end

License MIT

About

Uniform Resource Name (URN) parsing and validation in Elixir

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages