| 63 | } |
| 64 | |
| 65 | absl::StatusOr<std::unique_ptr<cel::Runtime>> ConfigureRuntime() { |
| 66 | cel::RuntimeOptions runtime_options; |
| 67 | // Note: this is needed to resolve net.Address as a `type` constant. |
| 68 | runtime_options.enable_qualified_type_identifiers = true; |
| 69 | absl::StatusOr<cel::RuntimeBuilder> runtime_builder = |
| 70 | cel::CreateStandardRuntimeBuilder(cel::GetMinimalDescriptorPool(), |
| 71 | runtime_options); |
| 72 | // =========================================================================== |
| 73 | // Codelab: Update runtime builder with functions from network_functions.h |
| 74 | // =========================================================================== |
| 75 | absl::Status s = |
| 76 | RegisterNetworkTypes(runtime_builder->type_registry(), runtime_options); |
| 77 | s.Update(RegisterNetworkFunctions(runtime_builder->function_registry(), |
| 78 | runtime_options)); |
| 79 | if (!s.ok()) return s; |
| 80 | |
| 81 | return std::move(runtime_builder).value().Build(); |
| 82 | } |
| 83 | |
| 84 | } // namespace |
| 85 |
no test coverage detected