fastcfg.validation package
Submodules
fastcfg.validation.policies module
- class fastcfg.validation.policies.LengthValidator(length: int, validate_immediately: bool = True)[source]
Bases:
IConfigValidator
- class fastcfg.validation.policies.PydanticValidator(model: BaseModel, validate_immediately: bool = True, transform: bool = False)[source]
Bases:
IConfigValidator
- class fastcfg.validation.policies.RangeValidator(min_value: int, max_value: int, validate_immediately: bool = True)[source]
Bases:
IConfigValidator
- class fastcfg.validation.policies.RegexValidator(pattern: str, validate_immediately: bool = True)[source]
Bases:
IConfigValidator
- class fastcfg.validation.policies.TypeValidator(expected_type: type, validate_immediately: bool = True)[source]
Bases:
IConfigValidator
- class fastcfg.validation.policies.URLValidator(validate_immediately: bool = True)[source]
Bases:
RegexValidator
fastcfg.validation.validatable module
- class fastcfg.validation.validatable.ValidatableMixin[source]
Bases:
ABC
- add_validator(validator: IConfigValidator) ValidatableMixin [source]
- validate(force_live: bool = False)[source]
Validate the current configuration item and its children.
This method performs validation on the current configuration item and its children. If the item is an instance of LiveConfigItem, it uses an MD5 hash to track the state of the item’s value. Validation is only performed if the state has changed or if the force_live parameter is set to True.
Parameters: force_live (bool): If True, forces validation for LiveConfigItem instances
regardless of whether the state has changed. This is useful when a new validator is added and immediate validation is required.
Raises: ConfigItemValidationError: If any of the validators fail.
- abstract property value: Any