pinger v0.1.1 Pinger.Report

Result of each request to test, contains the target, status code and error description if does

Summary

Functions

Example

iex> Pinger.Target.get_google
...> |> Pinger.Report.new(200)
%Pinger.Report{cause: nil, status_code: 200, target: %Pinger.Target{active: true, address: "https://www.google.com", interval: 10000, name: "Google"}}

Example

iex> Pinger.Target.get_google
...> |> Pinger.Report.new(200)
...> |> Pinger.Report.update_cause("An error occurred")
%Pinger.Report{cause: "An error occurred", status_code: 200, target: %Pinger.Target{active: true, address: "https://www.google.com", interval: 10000, name: "Google"}}

Example

iex> Pinger.Target.get_google
...> |> Pinger.Report.new(200)
...> |> Pinger.Report.update_status_code(500)
%Pinger.Report{cause: nil, status_code: 500, target: %Pinger.Target{active: true, address: "https://www.google.com", interval: 10000, name: "Google"}}

Functions

new(target, status_code, cause \\ nil)

Example

iex> Pinger.Target.get_google
...> |> Pinger.Report.new(200)
%Pinger.Report{cause: nil, status_code: 200, target: %Pinger.Target{active: true, address: "https://www.google.com", interval: 10000, name: "Google"}}
update_cause(report, cause)

Example

iex> Pinger.Target.get_google
...> |> Pinger.Report.new(200)
...> |> Pinger.Report.update_cause("An error occurred")
%Pinger.Report{cause: "An error occurred", status_code: 200, target: %Pinger.Target{active: true, address: "https://www.google.com", interval: 10000, name: "Google"}}
update_status_code(report, status_code)

Example

iex> Pinger.Target.get_google
...> |> Pinger.Report.new(200)
...> |> Pinger.Report.update_status_code(500)
%Pinger.Report{cause: nil, status_code: 500, target: %Pinger.Target{active: true, address: "https://www.google.com", interval: 10000, name: "Google"}}