fettle_checks v0.2.2 Fettle.HttpCheckerBase behaviour View Source

Base module for defining Fettle.Checker modules based on an HTTP call.

See Fettle.HttpChecker for details.

Link to this section Summary

Types

ways of specifing a status code

Functions

test a status code against a range, value or list of range or value

Get a header from a keyword-like list (but with string keys), returning header value or nil if not found

Link to this section Types

Link to this type status_code_spec() View Source
status_code_spec() :: non_neg_integer() | Range.t()

ways of specifing a status code

Link to this section Functions

Link to this function expected_status_code?(status_code, expected_spec) View Source
expected_status_code?(
  status_code :: non_neg_integer(),
  expected :: status_code_spec() | [status_code_spec()]
) :: boolean()

test a status code against a range, value or list of range or value

Link to this function get_header(headers, key) View Source
get_header(headers :: [{String.t(), String.t()}], key :: String.t()) ::
  String.t() | nil

Get a header from a keyword-like list (but with string keys), returning header value or nil if not found.

Link to this section Callbacks

Link to this callback compare_resp_body(content_type, body, expected, config) View Source (optional)
compare_resp_body(
  content_type :: String.t(),
  body :: String.t(),
  expected :: any(),
  config :: map()
) :: Result.t()
Link to this callback compare_response(response, config) View Source (optional)
compare_response(response :: HTTPPoison.Response.t(), config :: map()) ::
  Result.t()