View Source Sanity.Behaviour behaviour (sanity v1.2.0)

Behaviour implemented by the Sanity module. This behaviour includes all functions that make requests to the Sanity API. Pure functions from the Sanity module are not included. This behaviour is useful for creating mocks using the Mox library.

Link to this section Summary

Link to this section Callbacks

@callback request(
  Sanity.Request.t(),
  keyword()
) :: {:ok, Sanity.Response.t()} | {:error, Sanity.Response.t()}
@callback request!(
  Sanity.Request.t(),
  keyword()
) :: Sanity.Response.t()
@callback stream(Keyword.t()) :: Enumerable.t()