Skip to content

gabulyaz/elixir-ipify

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ElixirIpify

Build Status Issue Count Test Coverage Hex.pm Hex.pm

A simple elixir library for ipify: A Simple IP Address API.

Usage

ElixirIpify is available in Hex, the package can be installed as:

  1. Add elixir_ipify to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:elixir_ipify, "~> 0.1.0"},
   {:httpotion, "~> 3.0.0"}]
end

def application do
  [applications: [:logger,:elixir_ipify]]
end
```
  1. Run the mix command:
```bash
$ mix deps.get
```
  1. Open your interactive elixir shell:
```bash
$ iex -S mix
```
  1. Try the functions:
```code
iex()> ElixirIpify.fetch
"1.2.3.4" # if success

iex()> ElixirIpify.fetch
"Nothing goes wrong!" # if error
```
  1. You can get also elixir style response:

    iex()> ElixirIpify.get
    {:ok, "1.2.3.4"} # if success
    
    iex()> ElixirIpify.get
    {:error, "Nothing goes wrong!"} # if error
    

License

MIT © Zoltán Gabulya

About

A simple elixir library for ipify: A Simple IP Address API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages