Module field_registry

Module field_registry 

Source
Expand description

Runtime field registry fetched from the GoaT API.

Runtime field registry, from the live GoaT resultFields endpoint.

This lets the expression engine (-e) and variables (-v) accept fields that were added to GoaT after the last time the static variable-data file was regenerated, without requiring a binary rebuild.

The registry is only loaded when an expression or variable list names a field the static data does not know (see prepare), and the field names are cached on disk for a day, so most runs make no request for it.

§Fallback behaviour

If the HTTP request fails (network error, API down) the registry is silently left empty and all field lookups return false. The static GOAT_TAXON_VARIABLE_DATA / GOAT_ASSEMBLY_VARIABLE_DATA maps are still used for detailed type-checking; the dynamic registry only widens the set of accepted field names.

Functions§

get_all_fields
Returns a clone of all field names in the registry for index_type.
init
Initialise the dynamic field registry for index_type, from the disk cache if it is fresh, otherwise from the API.
is_dynamic_field
Returns true if field appears in the live GoaT field list for index_type.
is_dynamic_field_any
Like is_dynamic_field, for either index.
prepare
Load the registry for index_type if any of expressions (e.g. -e, or arc -x/-y) or variables (-v) name a field that the static data does not know.