View Source Cachex.Spec.Validator (Cachex v3.6.0)

Validation module for records defined in the specification.

This module just exposes runtime validation functions for records defined in the spec; records themselves only determine keys and structure but cannot enforce type (that I know of) without additional runtime validations.

This shouldn't be used outside of the library, but it can be if required.

Link to this section Summary

Functions

Validates a specification record type.

Link to this section Types

Link to this section Functions

@spec valid?(atom(), record()) :: boolean()

Validates a specification record type.

This will provide runtime validation of types and values contained inside the specification records. Although records provide key validation, they don't expose much coverage of the provided values.

This will delegate each record type to a customized validation function.