microscope v1.2.0 Microscope.Validation
Provides functions for validating arguments or options to Microscope.
Link to this section Summary
Functions
Checks if the base option is valid.
Checks if the callbacks option is valid.
Checks if the index option is valid.
Checks if the port option is valid.
Checks if the webroot argument is valid.
Link to this section Functions
validate_base(base)
Checks if the base option is valid.
Returns :ok if base is a string.
Raises ArgumentError otherwise.
validate_callbacks(cb_mods)
Checks if the callbacks option is valid.
Returns :ok if callbacks is a list of atoms.
Raises ArgumentError if the list contains non-atom values, or callbacks
is not a list.
validate_index(index)
Checks if the index option is valid.
Returns :ok if index is a boolean value.
Raises ArgumentError otherwise.
validate_port(port)
Checks if the port option is valid.
Returns :ok if port is a positive integer less than 65536.
Raises ArgumentError if port is not an integer, or the value is out of
the acceptable range.
validate_webroot(webroot)
Checks if the webroot argument is valid.
Returns :ok if webroot is the path to an existing directory.
Raises ArgumentError if webroot is not a directory, or webroot is not
a string value.