View Source ExRoboCop (ExRoboCop v0.1.5)

Documentation for ExRoboCop.

Summary

Functions

Create a captcha text and a captcha image

Store captcha text under a unique ID for later retrieval

Gets the secret answer for a given uuid; this can be useful for testing

Compare user answer with correct answer under uuid

Put in application children to start in supervision tree

Types

@type captcha_image() :: binary()
@type captcha_text() :: String.t()
@type uuid() :: String.t()

Functions

@spec create_captcha() :: {captcha_text(), captcha_image()}

Create a captcha text and a captcha image

Link to this function

create_form_id(captcha_text)

View Source
@spec create_form_id(captcha_text()) :: uuid()

Store captcha text under a unique ID for later retrieval

Link to this function

get_answer_for_form_id(form_id)

View Source
@spec get_answer_for_form_id(uuid()) ::
  {:error, :form_id_not_found} | {:ok, String.t()}

Gets the secret answer for a given uuid; this can be useful for testing

@spec not_a_robot?({captcha_text(), uuid()}) ::
  :error | {:error, :wrong_captcha} | :ok

Compare user answer with correct answer under uuid

@spec start() :: {ExRoboCop.SecretAnswer, %{}}

Put in application children to start in supervision tree