View Source RedactEx.Algorithms.Algorithm behaviour (RedactEx v0.1.6)

Behaviour to implement for an algorithm to be configured as a redacting algorithm when using RedactEx

Link to this section Summary

Callbacks

Returns the AST of the implementing algorithm, given whatever supported configuration

Parses additional configuration at compile time for given algorithm. Configuration will be kept in Context's extra field Shall return any configuration (eventually) readable by generate_ast and generate_fallback_ast

Functions

Check that this behaviour is implemented in given module

Link to this section Types

Link to this section Callbacks

Link to this callback

generate_ast(configuration)

View Source
@callback generate_ast(configuration :: any()) :: Macro.t()

Returns the AST of the implementing algorithm, given whatever supported configuration

Link to this callback

parse_extra_configuration!(configuration)

View Source
@callback parse_extra_configuration!(configuration :: any()) :: any() | no_return()

Parses additional configuration at compile time for given algorithm. Configuration will be kept in Context's extra field Shall return any configuration (eventually) readable by generate_ast and generate_fallback_ast

The function shall raise in case of errors

Link to this section Functions

@spec implemented_by?(module()) :: boolean()

Check that this behaviour is implemented in given module