View Source Kungfuig.Validator behaviour (Kungfuig v0.4.2)

Generic validator encapsulation.

Default implementation is NimbleOptions.

Link to this section Summary

Callbacks

Generates a documentation for expected options

Validates given options with the schema, provided by the implementation of this behaviour

Link to this section Callbacks

@callback doc(options :: keyword()) :: String.t()

Generates a documentation for expected options

@callback validate(options :: map() | keyword()) ::
  {:ok, validated_options :: keyword()} | {:error, any()}

Validates given options with the schema, provided by the implementation of this behaviour