pinger v0.1.1 Pinger.Target
Target specification for the URL to monitor, it can handle address, interval and if is active
Summary
Functions
A simple request to “https://www.google.com”
Mark Target struct as active
Mark Target struct as inactive
Create a new Target struct with name, address, interval (default 10000) and active (default true)
Update Target struct address
Update Target struct name
Functions
A simple request to “https://www.google.com”
Example
iex> Pinger.Target.get_google
...> |> Pinger.Target.update_address("https://www.google.com.br")
%Pinger.Target{active: true, address: "https://www.google.com.br", name: "Google"}
Mark Target struct as active
Example
iex> Pinger.Target.new("Google", "https://www.google.com", 10000, false)
...> |> Pinger.Target.mark_active
%Pinger.Target{active: true, address: "https://www.google.com", interval: 10000, name: "Google"}
Mark Target struct as inactive
Example
iex> dest = Pinger.Target.new("Google", "https://www.google.com")
...> Pinger.Target.mark_inactive(dest)
%Pinger.Target{active: false, address: "https://www.google.com", name: "Google"}
Create a new Target struct with name, address, interval (default 10000) and active (default true)
Example
iex> Pinger.Target.new("Google", "https://www.google.com")
%Pinger.Target{active: true, address: "https://www.google.com", interval: 10000, name: "Google"}
iex> Pinger.Target.new("Google", "https://www.google.com", 5000, false)
%Pinger.Target{active: false, address: "https://www.google.com", interval: 5000, name: "Google"}