Interface IGuardrailKind
- Namespace
- IntentSharp.Guardrails
- Assembly
- IntentSharp.dll
Checks a subject's value against a rule's argument. The built-in kinds are allow, deny,
pattern, range and count; implement this interface for a kind of your own and add it through
Kinds. A kind is deterministic: the same value and argument give the same verdict.
public interface IGuardrailKind
- Extension Methods
Remarks
A kind that throws counts as a violation of the rule, never as a pass. Members added to this interface in a later version come with a default implementation.
Properties
- Name
The kind's name, as rules write it. A custom kind's name contains a dot, such as
acme.luhn; names without a dot are the library's.
Methods
- CheckSettings(JsonNode?)
Checks a rule's argument when its set is read; returns the problems, empty when the argument is fine.
- EvaluateAsync(SubjectName, JsonNode?, JsonNode?, GuardrailKindContext, CancellationToken)
Checks
valueagainst the rule's argument.